net/sfc: use own logging helper macros
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2020 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_ERROR_RECOVERY_QCFG                  UINT32_C(0xc)
273         #define HWRM_FUNC_DRV_IF_CHANGE                   UINT32_C(0xd)
274         #define HWRM_FUNC_BUF_UNRGTR                      UINT32_C(0xe)
275         #define HWRM_FUNC_VF_CFG                          UINT32_C(0xf)
276         /* Reserved for future use. */
277         #define HWRM_RESERVED1                            UINT32_C(0x10)
278         #define HWRM_FUNC_RESET                           UINT32_C(0x11)
279         #define HWRM_FUNC_GETFID                          UINT32_C(0x12)
280         #define HWRM_FUNC_VF_ALLOC                        UINT32_C(0x13)
281         #define HWRM_FUNC_VF_FREE                         UINT32_C(0x14)
282         #define HWRM_FUNC_QCAPS                           UINT32_C(0x15)
283         #define HWRM_FUNC_QCFG                            UINT32_C(0x16)
284         #define HWRM_FUNC_CFG                             UINT32_C(0x17)
285         #define HWRM_FUNC_QSTATS                          UINT32_C(0x18)
286         #define HWRM_FUNC_CLR_STATS                       UINT32_C(0x19)
287         #define HWRM_FUNC_DRV_UNRGTR                      UINT32_C(0x1a)
288         #define HWRM_FUNC_VF_RESC_FREE                    UINT32_C(0x1b)
289         #define HWRM_FUNC_VF_VNIC_IDS_QUERY               UINT32_C(0x1c)
290         #define HWRM_FUNC_DRV_RGTR                        UINT32_C(0x1d)
291         #define HWRM_FUNC_DRV_QVER                        UINT32_C(0x1e)
292         #define HWRM_FUNC_BUF_RGTR                        UINT32_C(0x1f)
293         #define HWRM_PORT_PHY_CFG                         UINT32_C(0x20)
294         #define HWRM_PORT_MAC_CFG                         UINT32_C(0x21)
295         /* Experimental */
296         #define HWRM_PORT_TS_QUERY                        UINT32_C(0x22)
297         #define HWRM_PORT_QSTATS                          UINT32_C(0x23)
298         #define HWRM_PORT_LPBK_QSTATS                     UINT32_C(0x24)
299         /* Experimental */
300         #define HWRM_PORT_CLR_STATS                       UINT32_C(0x25)
301         /* Experimental */
302         #define HWRM_PORT_LPBK_CLR_STATS                  UINT32_C(0x26)
303         #define HWRM_PORT_PHY_QCFG                        UINT32_C(0x27)
304         #define HWRM_PORT_MAC_QCFG                        UINT32_C(0x28)
305         /* Experimental */
306         #define HWRM_PORT_MAC_PTP_QCFG                    UINT32_C(0x29)
307         #define HWRM_PORT_PHY_QCAPS                       UINT32_C(0x2a)
308         #define HWRM_PORT_PHY_I2C_WRITE                   UINT32_C(0x2b)
309         #define HWRM_PORT_PHY_I2C_READ                    UINT32_C(0x2c)
310         #define HWRM_PORT_LED_CFG                         UINT32_C(0x2d)
311         #define HWRM_PORT_LED_QCFG                        UINT32_C(0x2e)
312         #define HWRM_PORT_LED_QCAPS                       UINT32_C(0x2f)
313         #define HWRM_QUEUE_QPORTCFG                       UINT32_C(0x30)
314         #define HWRM_QUEUE_QCFG                           UINT32_C(0x31)
315         #define HWRM_QUEUE_CFG                            UINT32_C(0x32)
316         #define HWRM_FUNC_VLAN_CFG                        UINT32_C(0x33)
317         #define HWRM_FUNC_VLAN_QCFG                       UINT32_C(0x34)
318         #define HWRM_QUEUE_PFCENABLE_QCFG                 UINT32_C(0x35)
319         #define HWRM_QUEUE_PFCENABLE_CFG                  UINT32_C(0x36)
320         #define HWRM_QUEUE_PRI2COS_QCFG                   UINT32_C(0x37)
321         #define HWRM_QUEUE_PRI2COS_CFG                    UINT32_C(0x38)
322         #define HWRM_QUEUE_COS2BW_QCFG                    UINT32_C(0x39)
323         #define HWRM_QUEUE_COS2BW_CFG                     UINT32_C(0x3a)
324         #define HWRM_QUEUE_DSCP_QCAPS                     UINT32_C(0x3b)
325         #define HWRM_QUEUE_DSCP2PRI_QCFG                  UINT32_C(0x3c)
326         #define HWRM_QUEUE_DSCP2PRI_CFG                   UINT32_C(0x3d)
327         #define HWRM_VNIC_ALLOC                           UINT32_C(0x40)
328         #define HWRM_VNIC_FREE                            UINT32_C(0x41)
329         #define HWRM_VNIC_CFG                             UINT32_C(0x42)
330         #define HWRM_VNIC_QCFG                            UINT32_C(0x43)
331         #define HWRM_VNIC_TPA_CFG                         UINT32_C(0x44)
332         /* Experimental */
333         #define HWRM_VNIC_TPA_QCFG                        UINT32_C(0x45)
334         #define HWRM_VNIC_RSS_CFG                         UINT32_C(0x46)
335         #define HWRM_VNIC_RSS_QCFG                        UINT32_C(0x47)
336         #define HWRM_VNIC_PLCMODES_CFG                    UINT32_C(0x48)
337         #define HWRM_VNIC_PLCMODES_QCFG                   UINT32_C(0x49)
338         #define HWRM_VNIC_QCAPS                           UINT32_C(0x4a)
339         #define HWRM_RING_ALLOC                           UINT32_C(0x50)
340         #define HWRM_RING_FREE                            UINT32_C(0x51)
341         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS        UINT32_C(0x52)
342         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS     UINT32_C(0x53)
343         #define HWRM_RING_AGGINT_QCAPS                    UINT32_C(0x54)
344         #define HWRM_RING_SCHQ_ALLOC                      UINT32_C(0x55)
345         #define HWRM_RING_SCHQ_CFG                        UINT32_C(0x56)
346         #define HWRM_RING_SCHQ_FREE                       UINT32_C(0x57)
347         #define HWRM_RING_RESET                           UINT32_C(0x5e)
348         #define HWRM_RING_GRP_ALLOC                       UINT32_C(0x60)
349         #define HWRM_RING_GRP_FREE                        UINT32_C(0x61)
350         #define HWRM_RING_CFG                             UINT32_C(0x62)
351         #define HWRM_RING_QCFG                            UINT32_C(0x63)
352         /* Reserved for future use. */
353         #define HWRM_RESERVED5                            UINT32_C(0x64)
354         /* Reserved for future use. */
355         #define HWRM_RESERVED6                            UINT32_C(0x65)
356         #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC            UINT32_C(0x70)
357         #define HWRM_VNIC_RSS_COS_LB_CTX_FREE             UINT32_C(0x71)
358         #define HWRM_QUEUE_MPLS_QCAPS                     UINT32_C(0x80)
359         #define HWRM_QUEUE_MPLSTC2PRI_QCFG                UINT32_C(0x81)
360         #define HWRM_QUEUE_MPLSTC2PRI_CFG                 UINT32_C(0x82)
361         #define HWRM_CFA_L2_FILTER_ALLOC                  UINT32_C(0x90)
362         #define HWRM_CFA_L2_FILTER_FREE                   UINT32_C(0x91)
363         #define HWRM_CFA_L2_FILTER_CFG                    UINT32_C(0x92)
364         #define HWRM_CFA_L2_SET_RX_MASK                   UINT32_C(0x93)
365         #define HWRM_CFA_VLAN_ANTISPOOF_CFG               UINT32_C(0x94)
366         #define HWRM_CFA_TUNNEL_FILTER_ALLOC              UINT32_C(0x95)
367         #define HWRM_CFA_TUNNEL_FILTER_FREE               UINT32_C(0x96)
368         /* Experimental */
369         #define HWRM_CFA_ENCAP_RECORD_ALLOC               UINT32_C(0x97)
370         /* Experimental */
371         #define HWRM_CFA_ENCAP_RECORD_FREE                UINT32_C(0x98)
372         #define HWRM_CFA_NTUPLE_FILTER_ALLOC              UINT32_C(0x99)
373         #define HWRM_CFA_NTUPLE_FILTER_FREE               UINT32_C(0x9a)
374         #define HWRM_CFA_NTUPLE_FILTER_CFG                UINT32_C(0x9b)
375         /* Experimental */
376         #define HWRM_CFA_EM_FLOW_ALLOC                    UINT32_C(0x9c)
377         /* Experimental */
378         #define HWRM_CFA_EM_FLOW_FREE                     UINT32_C(0x9d)
379         /* Experimental */
380         #define HWRM_CFA_EM_FLOW_CFG                      UINT32_C(0x9e)
381         #define HWRM_TUNNEL_DST_PORT_QUERY                UINT32_C(0xa0)
382         #define HWRM_TUNNEL_DST_PORT_ALLOC                UINT32_C(0xa1)
383         #define HWRM_TUNNEL_DST_PORT_FREE                 UINT32_C(0xa2)
384         #define HWRM_STAT_CTX_ENG_QUERY                   UINT32_C(0xaf)
385         #define HWRM_STAT_CTX_ALLOC                       UINT32_C(0xb0)
386         #define HWRM_STAT_CTX_FREE                        UINT32_C(0xb1)
387         #define HWRM_STAT_CTX_QUERY                       UINT32_C(0xb2)
388         #define HWRM_STAT_CTX_CLR_STATS                   UINT32_C(0xb3)
389         #define HWRM_PORT_QSTATS_EXT                      UINT32_C(0xb4)
390         #define HWRM_PORT_PHY_MDIO_WRITE                  UINT32_C(0xb5)
391         #define HWRM_PORT_PHY_MDIO_READ                   UINT32_C(0xb6)
392         #define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE            UINT32_C(0xb7)
393         #define HWRM_PORT_PHY_MDIO_BUS_RELEASE            UINT32_C(0xb8)
394         #define HWRM_PORT_QSTATS_EXT_PFC_WD               UINT32_C(0xb9)
395         #define HWRM_PORT_ECN_QSTATS                      UINT32_C(0xba)
396         #define HWRM_FW_RESET                             UINT32_C(0xc0)
397         #define HWRM_FW_QSTATUS                           UINT32_C(0xc1)
398         #define HWRM_FW_HEALTH_CHECK                      UINT32_C(0xc2)
399         #define HWRM_FW_SYNC                              UINT32_C(0xc3)
400         #define HWRM_FW_STATE_QCAPS                       UINT32_C(0xc4)
401         #define HWRM_FW_STATE_QUIESCE                     UINT32_C(0xc5)
402         #define HWRM_FW_STATE_BACKUP                      UINT32_C(0xc6)
403         #define HWRM_FW_STATE_RESTORE                     UINT32_C(0xc7)
404         /* Experimental */
405         #define HWRM_FW_SET_TIME                          UINT32_C(0xc8)
406         /* Experimental */
407         #define HWRM_FW_GET_TIME                          UINT32_C(0xc9)
408         /* Experimental */
409         #define HWRM_FW_SET_STRUCTURED_DATA               UINT32_C(0xca)
410         /* Experimental */
411         #define HWRM_FW_GET_STRUCTURED_DATA               UINT32_C(0xcb)
412         /* Experimental */
413         #define HWRM_FW_IPC_MAILBOX                       UINT32_C(0xcc)
414         #define HWRM_FW_ECN_CFG                           UINT32_C(0xcd)
415         #define HWRM_FW_ECN_QCFG                          UINT32_C(0xce)
416         #define HWRM_FW_SECURE_CFG                        UINT32_C(0xcf)
417         #define HWRM_EXEC_FWD_RESP                        UINT32_C(0xd0)
418         #define HWRM_REJECT_FWD_RESP                      UINT32_C(0xd1)
419         #define HWRM_FWD_RESP                             UINT32_C(0xd2)
420         #define HWRM_FWD_ASYNC_EVENT_CMPL                 UINT32_C(0xd3)
421         #define HWRM_OEM_CMD                              UINT32_C(0xd4)
422         /* Tells the fw to run PRBS test on a given port and lane. */
423         #define HWRM_PORT_PRBS_TEST                       UINT32_C(0xd5)
424         #define HWRM_PORT_SFP_SIDEBAND_CFG                UINT32_C(0xd6)
425         #define HWRM_PORT_SFP_SIDEBAND_QCFG               UINT32_C(0xd7)
426         #define HWRM_FW_STATE_UNQUIESCE                   UINT32_C(0xd8)
427         /* Tells the fw to collect dsc dump on a given port and lane. */
428         #define HWRM_PORT_DSC_DUMP                        UINT32_C(0xd9)
429         #define HWRM_TEMP_MONITOR_QUERY                   UINT32_C(0xe0)
430         #define HWRM_REG_POWER_QUERY                      UINT32_C(0xe1)
431         #define HWRM_CORE_FREQUENCY_QUERY                 UINT32_C(0xe2)
432         #define HWRM_REG_POWER_HISTOGRAM                  UINT32_C(0xe3)
433         #define HWRM_WOL_FILTER_ALLOC                     UINT32_C(0xf0)
434         #define HWRM_WOL_FILTER_FREE                      UINT32_C(0xf1)
435         #define HWRM_WOL_FILTER_QCFG                      UINT32_C(0xf2)
436         #define HWRM_WOL_REASON_QCFG                      UINT32_C(0xf3)
437         /* Experimental */
438         #define HWRM_CFA_METER_QCAPS                      UINT32_C(0xf4)
439         /* Experimental */
440         #define HWRM_CFA_METER_PROFILE_ALLOC              UINT32_C(0xf5)
441         /* Experimental */
442         #define HWRM_CFA_METER_PROFILE_FREE               UINT32_C(0xf6)
443         /* Experimental */
444         #define HWRM_CFA_METER_PROFILE_CFG                UINT32_C(0xf7)
445         /* Experimental */
446         #define HWRM_CFA_METER_INSTANCE_ALLOC             UINT32_C(0xf8)
447         /* Experimental */
448         #define HWRM_CFA_METER_INSTANCE_FREE              UINT32_C(0xf9)
449         /* Experimental */
450         #define HWRM_CFA_METER_INSTANCE_CFG               UINT32_C(0xfa)
451         /* Experimental */
452         #define HWRM_CFA_VFR_ALLOC                        UINT32_C(0xfd)
453         /* Experimental */
454         #define HWRM_CFA_VFR_FREE                         UINT32_C(0xfe)
455         /* Experimental */
456         #define HWRM_CFA_VF_PAIR_ALLOC                    UINT32_C(0x100)
457         /* Experimental */
458         #define HWRM_CFA_VF_PAIR_FREE                     UINT32_C(0x101)
459         /* Experimental */
460         #define HWRM_CFA_VF_PAIR_INFO                     UINT32_C(0x102)
461         /* Experimental */
462         #define HWRM_CFA_FLOW_ALLOC                       UINT32_C(0x103)
463         /* Experimental */
464         #define HWRM_CFA_FLOW_FREE                        UINT32_C(0x104)
465         /* Experimental */
466         #define HWRM_CFA_FLOW_FLUSH                       UINT32_C(0x105)
467         /* Experimental */
468         #define HWRM_CFA_FLOW_STATS                       UINT32_C(0x106)
469         /* Experimental */
470         #define HWRM_CFA_FLOW_INFO                        UINT32_C(0x107)
471         /* Experimental */
472         #define HWRM_CFA_DECAP_FILTER_ALLOC               UINT32_C(0x108)
473         /* Experimental */
474         #define HWRM_CFA_DECAP_FILTER_FREE                UINT32_C(0x109)
475         #define HWRM_CFA_VLAN_ANTISPOOF_QCFG              UINT32_C(0x10a)
476         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC       UINT32_C(0x10b)
477         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE        UINT32_C(0x10c)
478         /* Experimental */
479         #define HWRM_CFA_PAIR_ALLOC                       UINT32_C(0x10d)
480         /* Experimental */
481         #define HWRM_CFA_PAIR_FREE                        UINT32_C(0x10e)
482         /* Experimental */
483         #define HWRM_CFA_PAIR_INFO                        UINT32_C(0x10f)
484         /* Experimental */
485         #define HWRM_FW_IPC_MSG                           UINT32_C(0x110)
486         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO        UINT32_C(0x111)
487         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE       UINT32_C(0x112)
488         /* Experimental */
489         #define HWRM_CFA_FLOW_AGING_TIMER_RESET           UINT32_C(0x113)
490         /* Experimental */
491         #define HWRM_CFA_FLOW_AGING_CFG                   UINT32_C(0x114)
492         /* Experimental */
493         #define HWRM_CFA_FLOW_AGING_QCFG                  UINT32_C(0x115)
494         /* Experimental */
495         #define HWRM_CFA_FLOW_AGING_QCAPS                 UINT32_C(0x116)
496         /* Experimental */
497         #define HWRM_CFA_CTX_MEM_RGTR                     UINT32_C(0x117)
498         /* Experimental */
499         #define HWRM_CFA_CTX_MEM_UNRGTR                   UINT32_C(0x118)
500         /* Experimental */
501         #define HWRM_CFA_CTX_MEM_QCTX                     UINT32_C(0x119)
502         /* Experimental */
503         #define HWRM_CFA_CTX_MEM_QCAPS                    UINT32_C(0x11a)
504         /* Experimental */
505         #define HWRM_CFA_COUNTER_QCAPS                    UINT32_C(0x11b)
506         /* Experimental */
507         #define HWRM_CFA_COUNTER_CFG                      UINT32_C(0x11c)
508         /* Experimental */
509         #define HWRM_CFA_COUNTER_QCFG                     UINT32_C(0x11d)
510         /* Experimental */
511         #define HWRM_CFA_COUNTER_QSTATS                   UINT32_C(0x11e)
512         /* Experimental */
513         #define HWRM_CFA_TCP_FLAG_PROCESS_QCFG            UINT32_C(0x11f)
514         /* Experimental */
515         #define HWRM_CFA_EEM_QCAPS                        UINT32_C(0x120)
516         /* Experimental */
517         #define HWRM_CFA_EEM_CFG                          UINT32_C(0x121)
518         /* Experimental */
519         #define HWRM_CFA_EEM_QCFG                         UINT32_C(0x122)
520         /* Experimental */
521         #define HWRM_CFA_EEM_OP                           UINT32_C(0x123)
522         /* Experimental */
523         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS              UINT32_C(0x124)
524         /* Experimental - DEPRECATED */
525         #define HWRM_CFA_TFLIB                            UINT32_C(0x125)
526         /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
527         #define HWRM_ENGINE_CKV_STATUS                    UINT32_C(0x12e)
528         /* Engine CKV - Add a new CKEK used to encrypt keys. */
529         #define HWRM_ENGINE_CKV_CKEK_ADD                  UINT32_C(0x12f)
530         /* Engine CKV - Delete a previously added CKEK. */
531         #define HWRM_ENGINE_CKV_CKEK_DELETE               UINT32_C(0x130)
532         /* Engine CKV - Add a new key to the key vault. */
533         #define HWRM_ENGINE_CKV_KEY_ADD                   UINT32_C(0x131)
534         /* Engine CKV - Delete a key from the key vault. */
535         #define HWRM_ENGINE_CKV_KEY_DELETE                UINT32_C(0x132)
536         /* Engine CKV - Delete all keys from the key vault. */
537         #define HWRM_ENGINE_CKV_FLUSH                     UINT32_C(0x133)
538         /* Engine CKV - Get random data. */
539         #define HWRM_ENGINE_CKV_RNG_GET                   UINT32_C(0x134)
540         /* Engine CKV - Generate and encrypt a new AES key. */
541         #define HWRM_ENGINE_CKV_KEY_GEN                   UINT32_C(0x135)
542         /* Engine CKV - Configure a label index with a label value. */
543         #define HWRM_ENGINE_CKV_KEY_LABEL_CFG             UINT32_C(0x136)
544         /* Engine CKV - Query a label */
545         #define HWRM_ENGINE_CKV_KEY_LABEL_QCFG            UINT32_C(0x137)
546         /* Engine - Query the available queue groups configuration. */
547         #define HWRM_ENGINE_QG_CONFIG_QUERY               UINT32_C(0x13c)
548         /* Engine - Query the queue groups assigned to a function. */
549         #define HWRM_ENGINE_QG_QUERY                      UINT32_C(0x13d)
550         /* Engine - Query the available queue group meter profile configuration. */
551         #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
552         /* Engine - Query the configuration of a queue group meter profile. */
553         #define HWRM_ENGINE_QG_METER_PROFILE_QUERY        UINT32_C(0x13f)
554         /* Engine - Allocate a queue group meter profile. */
555         #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC        UINT32_C(0x140)
556         /* Engine - Free a queue group meter profile. */
557         #define HWRM_ENGINE_QG_METER_PROFILE_FREE         UINT32_C(0x141)
558         /* Engine - Query the meters assigned to a queue group. */
559         #define HWRM_ENGINE_QG_METER_QUERY                UINT32_C(0x142)
560         /* Engine - Bind a queue group meter profile to a queue group. */
561         #define HWRM_ENGINE_QG_METER_BIND                 UINT32_C(0x143)
562         /* Engine - Unbind a queue group meter profile from a queue group. */
563         #define HWRM_ENGINE_QG_METER_UNBIND               UINT32_C(0x144)
564         /* Engine - Bind a queue group to a function. */
565         #define HWRM_ENGINE_QG_FUNC_BIND                  UINT32_C(0x145)
566         /* Engine - Query the scheduling group configuration. */
567         #define HWRM_ENGINE_SG_CONFIG_QUERY               UINT32_C(0x146)
568         /* Engine - Query the queue groups assigned to a scheduling group. */
569         #define HWRM_ENGINE_SG_QUERY                      UINT32_C(0x147)
570         /* Engine - Query the configuration of a scheduling group's meter profiles. */
571         #define HWRM_ENGINE_SG_METER_QUERY                UINT32_C(0x148)
572         /* Engine - Configure a scheduling group's meter profiles. */
573         #define HWRM_ENGINE_SG_METER_CONFIG               UINT32_C(0x149)
574         /* Engine - Bind a queue group to a scheduling group. */
575         #define HWRM_ENGINE_SG_QG_BIND                    UINT32_C(0x14a)
576         /* Engine - Unbind a queue group from its scheduling group. */
577         #define HWRM_ENGINE_QG_SG_UNBIND                  UINT32_C(0x14b)
578         /* Engine - Query the Engine configuration. */
579         #define HWRM_ENGINE_CONFIG_QUERY                  UINT32_C(0x154)
580         /* Engine - Configure the statistics accumulator for an Engine. */
581         #define HWRM_ENGINE_STATS_CONFIG                  UINT32_C(0x155)
582         /* Engine - Clear the statistics accumulator for an Engine. */
583         #define HWRM_ENGINE_STATS_CLEAR                   UINT32_C(0x156)
584         /* Engine - Query the statistics accumulator for an Engine. */
585         #define HWRM_ENGINE_STATS_QUERY                   UINT32_C(0x157)
586         /* Engine - Query statistics counters for continuous errors from all CDDIP Engines. */
587         #define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR  UINT32_C(0x158)
588         /* Engine - Allocate an Engine RQ. */
589         #define HWRM_ENGINE_RQ_ALLOC                      UINT32_C(0x15e)
590         /* Engine - Free an Engine RQ. */
591         #define HWRM_ENGINE_RQ_FREE                       UINT32_C(0x15f)
592         /* Engine - Allocate an Engine CQ. */
593         #define HWRM_ENGINE_CQ_ALLOC                      UINT32_C(0x160)
594         /* Engine - Free an Engine CQ. */
595         #define HWRM_ENGINE_CQ_FREE                       UINT32_C(0x161)
596         /* Engine - Allocate an NQ. */
597         #define HWRM_ENGINE_NQ_ALLOC                      UINT32_C(0x162)
598         /* Engine - Free an NQ. */
599         #define HWRM_ENGINE_NQ_FREE                       UINT32_C(0x163)
600         /* Engine - Set the on-die RQE credit update location. */
601         #define HWRM_ENGINE_ON_DIE_RQE_CREDITS            UINT32_C(0x164)
602         /* Engine - Query the engine function configuration. */
603         #define HWRM_ENGINE_FUNC_QCFG                     UINT32_C(0x165)
604         /* Experimental */
605         #define HWRM_FUNC_RESOURCE_QCAPS                  UINT32_C(0x190)
606         /* Experimental */
607         #define HWRM_FUNC_VF_RESOURCE_CFG                 UINT32_C(0x191)
608         /* Experimental */
609         #define HWRM_FUNC_BACKING_STORE_QCAPS             UINT32_C(0x192)
610         /* Experimental */
611         #define HWRM_FUNC_BACKING_STORE_CFG               UINT32_C(0x193)
612         /* Experimental */
613         #define HWRM_FUNC_BACKING_STORE_QCFG              UINT32_C(0x194)
614         /* Configures the BW of any VF */
615         #define HWRM_FUNC_VF_BW_CFG                       UINT32_C(0x195)
616         /* Queries the BW of any VF */
617         #define HWRM_FUNC_VF_BW_QCFG                      UINT32_C(0x196)
618         /* Queries pf ids belong to specified host(s) */
619         #define HWRM_FUNC_HOST_PF_IDS_QUERY               UINT32_C(0x197)
620         /* Queries extended stats per function */
621         #define HWRM_FUNC_QSTATS_EXT                      UINT32_C(0x198)
622         /* Queries extended statistics context */
623         #define HWRM_STAT_EXT_CTX_QUERY                   UINT32_C(0x199)
624         /* Experimental */
625         #define HWRM_SELFTEST_QLIST                       UINT32_C(0x200)
626         /* Experimental */
627         #define HWRM_SELFTEST_EXEC                        UINT32_C(0x201)
628         /* Experimental */
629         #define HWRM_SELFTEST_IRQ                         UINT32_C(0x202)
630         /* Experimental */
631         #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA        UINT32_C(0x203)
632         /* Experimental */
633         #define HWRM_PCIE_QSTATS                          UINT32_C(0x204)
634         /* Experimental */
635         #define HWRM_MFG_FRU_WRITE_CONTROL                UINT32_C(0x205)
636         /* Returns the current value of a free running counter from the device. */
637         #define HWRM_MFG_TIMERS_QUERY                     UINT32_C(0x206)
638         /* Experimental */
639         #define HWRM_MFG_OTP_CFG                          UINT32_C(0x207)
640         /* Experimental */
641         #define HWRM_MFG_OTP_QCFG                         UINT32_C(0x208)
642         /*
643          * Tells the fw to run the DMA read from the host and DMA write
644          * to the host test.
645          */
646         #define HWRM_MFG_HDMA_TEST                        UINT32_C(0x209)
647         /* Tells the fw to program the fru memory */
648         #define HWRM_MFG_FRU_EEPROM_WRITE                 UINT32_C(0x20a)
649         /* Tells the fw to read the fru memory */
650         #define HWRM_MFG_FRU_EEPROM_READ                  UINT32_C(0x20b)
651         /* Experimental */
652         #define HWRM_TF                                   UINT32_C(0x2bc)
653         /* Experimental */
654         #define HWRM_TF_VERSION_GET                       UINT32_C(0x2bd)
655         /* Experimental */
656         #define HWRM_TF_SESSION_OPEN                      UINT32_C(0x2c6)
657         /* Experimental */
658         #define HWRM_TF_SESSION_ATTACH                    UINT32_C(0x2c7)
659         /* Experimental */
660         #define HWRM_TF_SESSION_REGISTER                  UINT32_C(0x2c8)
661         /* Experimental */
662         #define HWRM_TF_SESSION_UNREGISTER                UINT32_C(0x2c9)
663         /* Experimental */
664         #define HWRM_TF_SESSION_CLOSE                     UINT32_C(0x2ca)
665         /* Experimental */
666         #define HWRM_TF_SESSION_QCFG                      UINT32_C(0x2cb)
667         /* Experimental */
668         #define HWRM_TF_SESSION_RESC_QCAPS                UINT32_C(0x2cc)
669         /* Experimental */
670         #define HWRM_TF_SESSION_RESC_ALLOC                UINT32_C(0x2cd)
671         /* Experimental */
672         #define HWRM_TF_SESSION_RESC_FREE                 UINT32_C(0x2ce)
673         /* Experimental */
674         #define HWRM_TF_SESSION_RESC_FLUSH                UINT32_C(0x2cf)
675         /* Experimental */
676         #define HWRM_TF_TBL_TYPE_GET                      UINT32_C(0x2da)
677         /* Experimental */
678         #define HWRM_TF_TBL_TYPE_SET                      UINT32_C(0x2db)
679         /* Experimental */
680         #define HWRM_TF_CTXT_MEM_RGTR                     UINT32_C(0x2e4)
681         /* Experimental */
682         #define HWRM_TF_CTXT_MEM_UNRGTR                   UINT32_C(0x2e5)
683         /* Experimental */
684         #define HWRM_TF_EXT_EM_QCAPS                      UINT32_C(0x2e6)
685         /* Experimental */
686         #define HWRM_TF_EXT_EM_OP                         UINT32_C(0x2e7)
687         /* Experimental */
688         #define HWRM_TF_EXT_EM_CFG                        UINT32_C(0x2e8)
689         /* Experimental */
690         #define HWRM_TF_EXT_EM_QCFG                       UINT32_C(0x2e9)
691         /* Experimental */
692         #define HWRM_TF_EM_INSERT                         UINT32_C(0x2ea)
693         /* Experimental */
694         #define HWRM_TF_EM_DELETE                         UINT32_C(0x2eb)
695         /* Experimental */
696         #define HWRM_TF_TCAM_SET                          UINT32_C(0x2f8)
697         /* Experimental */
698         #define HWRM_TF_TCAM_GET                          UINT32_C(0x2f9)
699         /* Experimental */
700         #define HWRM_TF_TCAM_MOVE                         UINT32_C(0x2fa)
701         /* Experimental */
702         #define HWRM_TF_TCAM_FREE                         UINT32_C(0x2fb)
703         /* Experimental */
704         #define HWRM_TF_GLOBAL_CFG_SET                    UINT32_C(0x2fc)
705         /* Experimental */
706         #define HWRM_TF_GLOBAL_CFG_GET                    UINT32_C(0x2fd)
707         /* Experimental */
708         #define HWRM_TF_IF_TBL_SET                        UINT32_C(0x2fe)
709         /* Experimental */
710         #define HWRM_TF_IF_TBL_GET                        UINT32_C(0x2ff)
711         /* Experimental */
712         #define HWRM_SV                                   UINT32_C(0x400)
713         /* Experimental */
714         #define HWRM_DBG_READ_DIRECT                      UINT32_C(0xff10)
715         /* Experimental */
716         #define HWRM_DBG_READ_INDIRECT                    UINT32_C(0xff11)
717         /* Experimental */
718         #define HWRM_DBG_WRITE_DIRECT                     UINT32_C(0xff12)
719         /* Experimental */
720         #define HWRM_DBG_WRITE_INDIRECT                   UINT32_C(0xff13)
721         #define HWRM_DBG_DUMP                             UINT32_C(0xff14)
722         /* Experimental */
723         #define HWRM_DBG_ERASE_NVM                        UINT32_C(0xff15)
724         /* Experimental */
725         #define HWRM_DBG_CFG                              UINT32_C(0xff16)
726         /* Experimental */
727         #define HWRM_DBG_COREDUMP_LIST                    UINT32_C(0xff17)
728         /* Experimental */
729         #define HWRM_DBG_COREDUMP_INITIATE                UINT32_C(0xff18)
730         /* Experimental */
731         #define HWRM_DBG_COREDUMP_RETRIEVE                UINT32_C(0xff19)
732         /* Experimental */
733         #define HWRM_DBG_FW_CLI                           UINT32_C(0xff1a)
734         /*  */
735         #define HWRM_DBG_I2C_CMD                          UINT32_C(0xff1b)
736         /*  */
737         #define HWRM_DBG_RING_INFO_GET                    UINT32_C(0xff1c)
738         /* Experimental */
739         #define HWRM_DBG_CRASHDUMP_HEADER                 UINT32_C(0xff1d)
740         /* Experimental */
741         #define HWRM_DBG_CRASHDUMP_ERASE                  UINT32_C(0xff1e)
742         /* Send driver debug information to firmware */
743         #define HWRM_DBG_DRV_TRACE                        UINT32_C(0xff1f)
744         /* Query debug capabilities of firmware */
745         #define HWRM_DBG_QCAPS                            UINT32_C(0xff20)
746         /* Retrieve debug settings of firmware */
747         #define HWRM_DBG_QCFG                             UINT32_C(0xff21)
748         /* Set destination parameters for crashdump medium */
749         #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG             UINT32_C(0xff22)
750         #define HWRM_NVM_REQ_ARBITRATION                  UINT32_C(0xffed)
751         /* Experimental */
752         #define HWRM_NVM_FACTORY_DEFAULTS                 UINT32_C(0xffee)
753         #define HWRM_NVM_VALIDATE_OPTION                  UINT32_C(0xffef)
754         #define HWRM_NVM_FLUSH                            UINT32_C(0xfff0)
755         #define HWRM_NVM_GET_VARIABLE                     UINT32_C(0xfff1)
756         #define HWRM_NVM_SET_VARIABLE                     UINT32_C(0xfff2)
757         #define HWRM_NVM_INSTALL_UPDATE                   UINT32_C(0xfff3)
758         #define HWRM_NVM_MODIFY                           UINT32_C(0xfff4)
759         #define HWRM_NVM_VERIFY_UPDATE                    UINT32_C(0xfff5)
760         #define HWRM_NVM_GET_DEV_INFO                     UINT32_C(0xfff6)
761         #define HWRM_NVM_ERASE_DIR_ENTRY                  UINT32_C(0xfff7)
762         #define HWRM_NVM_MOD_DIR_ENTRY                    UINT32_C(0xfff8)
763         #define HWRM_NVM_FIND_DIR_ENTRY                   UINT32_C(0xfff9)
764         #define HWRM_NVM_GET_DIR_ENTRIES                  UINT32_C(0xfffa)
765         #define HWRM_NVM_GET_DIR_INFO                     UINT32_C(0xfffb)
766         #define HWRM_NVM_RAW_DUMP                         UINT32_C(0xfffc)
767         #define HWRM_NVM_READ                             UINT32_C(0xfffd)
768         #define HWRM_NVM_WRITE                            UINT32_C(0xfffe)
769         #define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
770         #define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
771         uint16_t        unused_0[3];
772 } __rte_packed;
773
774 /* Return Codes */
775 /* ret_codes (size:64b/8B) */
776 struct ret_codes {
777         uint16_t        error_code;
778         /* Request was successfully executed by the HWRM. */
779         #define HWRM_ERR_CODE_SUCCESS                      UINT32_C(0x0)
780         /* The HWRM failed to execute the request. */
781         #define HWRM_ERR_CODE_FAIL                         UINT32_C(0x1)
782         /*
783          * The request contains invalid argument(s) or input
784          * parameters.
785          */
786         #define HWRM_ERR_CODE_INVALID_PARAMS               UINT32_C(0x2)
787         /*
788          * The requester is not allowed to access the requested
789          * resource. This error code shall be provided in a
790          * response to a request to query or modify an existing
791          * resource that is not accessible by the requester.
792          */
793         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED       UINT32_C(0x3)
794         /*
795          * The HWRM is unable to allocate the requested resource.
796          * This code only applies to requests for HWRM resource
797          * allocations.
798          */
799         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR         UINT32_C(0x4)
800         /*
801          * Invalid combination of flags is specified in the
802          * request.
803          */
804         #define HWRM_ERR_CODE_INVALID_FLAGS                UINT32_C(0x5)
805         /*
806          * Invalid combination of enables fields is specified in
807          * the request.
808          */
809         #define HWRM_ERR_CODE_INVALID_ENABLES              UINT32_C(0x6)
810         /*
811          * Request contains a required TLV that is not supported by
812          * the installed version of firmware.
813          */
814         #define HWRM_ERR_CODE_UNSUPPORTED_TLV              UINT32_C(0x7)
815         /*
816          * No firmware buffer available to accept the request. Driver
817          * should retry the request.
818          */
819         #define HWRM_ERR_CODE_NO_BUFFER                    UINT32_C(0x8)
820         /*
821          * This error code is only reported by firmware when some
822          * sub-option of a supported HWRM command is unsupported.
823          */
824         #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR       UINT32_C(0x9)
825         /*
826          * This error code is only reported by firmware when the specific
827          * request is not able to process when the HOT reset in progress.
828          */
829         #define HWRM_ERR_CODE_HOT_RESET_PROGRESS           UINT32_C(0xa)
830         /*
831          * This error code is only reported by firmware when the registered
832          * driver instances are not capable of hot reset.
833          */
834         #define HWRM_ERR_CODE_HOT_RESET_FAIL               UINT32_C(0xb)
835         /*
836          * This error code is only reported by the firmware when during
837          * flow allocation when a request for a flow counter fails because
838          * the number of flow counters are exhausted.
839          */
840         #define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
841         /*
842          * This error code is only reported by firmware when the registered
843          * driver instances requested to offloaded a flow but was unable to because
844          * the requested key's hash collides with the installed keys.
845          */
846         #define HWRM_ERR_CODE_KEY_HASH_COLLISION           UINT32_C(0xd)
847         /*
848          * This error code is only reported by firmware when the registered
849          * driver instances requested to offloaded a flow but was unable to because
850          * the same key has already been installed.
851          */
852         #define HWRM_ERR_CODE_KEY_ALREADY_EXISTS           UINT32_C(0xe)
853         /*
854          * Generic HWRM execution error that represents an
855          * internal error.
856          */
857         #define HWRM_ERR_CODE_HWRM_ERROR                   UINT32_C(0xf)
858         /*
859          * Firmware is unable to service the request at the present time. Caller
860          * may try again later.
861          */
862         #define HWRM_ERR_CODE_BUSY                         UINT32_C(0x10)
863         /*
864          * This value indicates that the HWRM response is in TLV format and
865          * should be interpreted as one or more TLVs starting with the
866          * hwrm_resp_hdr TLV. This value is not an indication of any error
867          * by itself, just an indication that the response should be parsed
868          * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
869          */
870         #define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE    UINT32_C(0x8000)
871         /* Unknown error */
872         #define HWRM_ERR_CODE_UNKNOWN_ERR                  UINT32_C(0xfffe)
873         /* Unsupported or invalid command */
874         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED            UINT32_C(0xffff)
875         #define HWRM_ERR_CODE_LAST \
876                 HWRM_ERR_CODE_CMD_NOT_SUPPORTED
877         uint16_t        unused_0[3];
878 } __rte_packed;
879
880 /* Output */
881 /* hwrm_err_output (size:128b/16B) */
882 struct hwrm_err_output {
883         /*
884          * Pass/Fail or error type
885          *
886          * Note: receiver to verify the in parameters, and fail the call
887          * with an error when appropriate
888          */
889         uint16_t        error_code;
890         /* This field returns the type of original request. */
891         uint16_t        req_type;
892         /* This field provides original sequence number of the command. */
893         uint16_t        seq_id;
894         /*
895          * This field is the length of the response in bytes.  The
896          * last byte of the response is a valid flag that will read
897          * as '1' when the command has been completely written to
898          * memory.
899          */
900         uint16_t        resp_len;
901         /* debug info for this error response. */
902         uint32_t        opaque_0;
903         /* debug info for this error response. */
904         uint16_t        opaque_1;
905         /*
906          * In the case of an error response, command specific error
907          * code is returned in this field.
908          */
909         uint8_t cmd_err;
910         /*
911          * This field is used in Output records to indicate that the output
912          * is completely written to RAM.  This field should be read as '1'
913          * to indicate that the output has been completely written.
914          * When writing a command completion or response to an internal processor,
915          * the order of writes has to be such that this field is written last.
916          */
917         uint8_t valid;
918 } __rte_packed;
919 /*
920  * Following is the signature for HWRM message field that indicates not
921  * applicable (All F's). Need to cast it the size of the field if needed.
922  */
923 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
924 /* hwrm_func_buf_rgtr */
925 #define HWRM_MAX_REQ_LEN 128
926 /* hwrm_cfa_flow_info */
927 #define HWRM_MAX_RESP_LEN 704
928 /* 7 bit indirection table index. */
929 #define HW_HASH_INDEX_SIZE 0x80
930 #define HW_HASH_KEY_SIZE 40
931 /* valid key for HWRM response */
932 #define HWRM_RESP_VALID_KEY 1
933 /* Reserved for BONO processor */
934 #define HWRM_TARGET_ID_BONO 0xFFF8
935 /* Reserved for KONG processor */
936 #define HWRM_TARGET_ID_KONG 0xFFF9
937 /* Reserved for APE processor */
938 #define HWRM_TARGET_ID_APE 0xFFFA
939 /*
940  * This value will be used by tools for User-space HWRM Interface.
941  * When tool execute any HWRM command with this target_id, firmware
942  * will copy the response and/or data payload via register space instead
943  * of DMAing it.
944  */
945 #define HWRM_TARGET_ID_TOOLS 0xFFFD
946 #define HWRM_VERSION_MAJOR 1
947 #define HWRM_VERSION_MINOR 10
948 #define HWRM_VERSION_UPDATE 1
949 /* non-zero means beta version */
950 #define HWRM_VERSION_RSVD 56
951 #define HWRM_VERSION_STR "1.10.1.56"
952
953 /****************
954  * hwrm_ver_get *
955  ****************/
956
957
958 /* hwrm_ver_get_input (size:192b/24B) */
959 struct hwrm_ver_get_input {
960         /* The HWRM command request type. */
961         uint16_t        req_type;
962         /*
963          * The completion ring to send the completion event on. This should
964          * be the NQ ID returned from the `nq_alloc` HWRM command.
965          */
966         uint16_t        cmpl_ring;
967         /*
968          * The sequence ID is used by the driver for tracking multiple
969          * commands. This ID is treated as opaque data by the firmware and
970          * the value is returned in the `hwrm_resp_hdr` upon completion.
971          */
972         uint16_t        seq_id;
973         /*
974          * The target ID of the command:
975          * * 0x0-0xFFF8 - The function ID
976          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
977          * * 0xFFFD - Reserved for user-space HWRM interface
978          * * 0xFFFF - HWRM
979          */
980         uint16_t        target_id;
981         /*
982          * A physical address pointer pointing to a host buffer that the
983          * command's response data will be written. This can be either a host
984          * physical address (HPA) or a guest physical address (GPA) and must
985          * point to a physically contiguous block of memory.
986          */
987         uint64_t        resp_addr;
988         /*
989          * This field represents the major version of HWRM interface
990          * specification supported by the driver HWRM implementation.
991          * The interface major version is intended to change only when
992          * non backward compatible changes are made to the HWRM
993          * interface specification.
994          */
995         uint8_t hwrm_intf_maj;
996         /*
997          * This field represents the minor version of HWRM interface
998          * specification supported by the driver HWRM implementation.
999          * A change in interface minor version is used to reflect
1000          * significant backward compatible modification to HWRM
1001          * interface specification.
1002          * This can be due to addition or removal of functionality.
1003          * HWRM interface specifications with the same major version
1004          * but different minor versions are compatible.
1005          */
1006         uint8_t hwrm_intf_min;
1007         /*
1008          * This field represents the update version of HWRM interface
1009          * specification supported by the driver HWRM implementation.
1010          * The interface update version is used to reflect minor
1011          * changes or bug fixes to a released HWRM interface
1012          * specification.
1013          */
1014         uint8_t hwrm_intf_upd;
1015         uint8_t unused_0[5];
1016 } __rte_packed;
1017
1018 /* hwrm_ver_get_output (size:1408b/176B) */
1019 struct hwrm_ver_get_output {
1020         /* The specific error status for the command. */
1021         uint16_t        error_code;
1022         /* The HWRM command request type. */
1023         uint16_t        req_type;
1024         /* The sequence ID from the original command. */
1025         uint16_t        seq_id;
1026         /* The length of the response data in number of bytes. */
1027         uint16_t        resp_len;
1028         /*
1029          * This field represents the major version of HWRM interface
1030          * specification supported by the HWRM implementation.
1031          * The interface major version is intended to change only when
1032          * non backward compatible changes are made to the HWRM
1033          * interface specification.
1034          * A HWRM implementation that is compliant with this
1035          * specification shall provide value of 1 in this field.
1036          */
1037         uint8_t hwrm_intf_maj_8b;
1038         /*
1039          * This field represents the minor version of HWRM interface
1040          * specification supported by the HWRM implementation.
1041          * A change in interface minor version is used to reflect
1042          * significant backward compatible modification to HWRM
1043          * interface specification.
1044          * This can be due to addition or removal of functionality.
1045          * HWRM interface specifications with the same major version
1046          * but different minor versions are compatible.
1047          * A HWRM implementation that is compliant with this
1048          * specification shall provide value of 2 in this field.
1049          */
1050         uint8_t hwrm_intf_min_8b;
1051         /*
1052          * This field represents the update version of HWRM interface
1053          * specification supported by the HWRM implementation.
1054          * The interface update version is used to reflect minor
1055          * changes or bug fixes to a released HWRM interface
1056          * specification.
1057          * A HWRM implementation that is compliant with this
1058          * specification shall provide value of 2 in this field.
1059          */
1060         uint8_t hwrm_intf_upd_8b;
1061         uint8_t hwrm_intf_rsvd_8b;
1062         /*
1063          * This field represents the major version of HWRM firmware.
1064          * A change in firmware major version represents a major
1065          * firmware release.
1066          */
1067         uint8_t hwrm_fw_maj_8b;
1068         /*
1069          * This field represents the minor version of HWRM firmware.
1070          * A change in firmware minor version represents significant
1071          * firmware functionality changes.
1072          */
1073         uint8_t hwrm_fw_min_8b;
1074         /*
1075          * This field represents the build version of HWRM firmware.
1076          * A change in firmware build version represents bug fixes
1077          * to a released firmware.
1078          */
1079         uint8_t hwrm_fw_bld_8b;
1080         /*
1081          * This field is a reserved field. This field can be used to
1082          * represent firmware branches or customer specific releases
1083          * tied to a specific (major,minor,update) version of the
1084          * HWRM firmware.
1085          */
1086         uint8_t hwrm_fw_rsvd_8b;
1087         /*
1088          * This field represents the major version of mgmt firmware.
1089          * A change in major version represents a major release.
1090          */
1091         uint8_t mgmt_fw_maj_8b;
1092         /*
1093          * This field represents the minor version of mgmt firmware.
1094          * A change in minor version represents significant
1095          * functionality changes.
1096          */
1097         uint8_t mgmt_fw_min_8b;
1098         /*
1099          * This field represents the build version of mgmt firmware.
1100          * A change in update version represents bug fixes.
1101          */
1102         uint8_t mgmt_fw_bld_8b;
1103         /*
1104          * This field is a reserved field. This field can be used to
1105          * represent firmware branches or customer specific releases
1106          * tied to a specific (major,minor,update) version
1107          */
1108         uint8_t mgmt_fw_rsvd_8b;
1109         /*
1110          * This field represents the major version of network
1111          * control firmware.
1112          * A change in major version represents a major release.
1113          */
1114         uint8_t netctrl_fw_maj_8b;
1115         /*
1116          * This field represents the minor version of network
1117          * control firmware.
1118          * A change in minor version represents significant
1119          * functionality changes.
1120          */
1121         uint8_t netctrl_fw_min_8b;
1122         /*
1123          * This field represents the build version of network
1124          * control firmware.
1125          * A change in update version represents bug fixes.
1126          */
1127         uint8_t netctrl_fw_bld_8b;
1128         /*
1129          * This field is a reserved field. This field can be used to
1130          * represent firmware branches or customer specific releases
1131          * tied to a specific (major,minor,update) version
1132          */
1133         uint8_t netctrl_fw_rsvd_8b;
1134         /*
1135          * This field is used to indicate device's capabilities and
1136          * configurations.
1137          */
1138         uint32_t        dev_caps_cfg;
1139         /*
1140          * If set to 1, then secure firmware update behavior
1141          * is supported.
1142          * If set to 0, then secure firmware update behavior is
1143          * not supported.
1144          */
1145         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
1146                 UINT32_C(0x1)
1147         /*
1148          * If set to 1, then firmware based DCBX agent is supported.
1149          * If set to 0, then firmware based DCBX agent capability
1150          * is not supported on this device.
1151          */
1152         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
1153                 UINT32_C(0x2)
1154         /*
1155          * If set to 1, then HWRM short command format is supported.
1156          * If set to 0, then HWRM short command format is not supported.
1157          */
1158         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
1159                 UINT32_C(0x4)
1160         /*
1161          * If set to 1, then HWRM short command format is required.
1162          * If set to 0, then HWRM short command format is not required.
1163          */
1164         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \
1165                 UINT32_C(0x8)
1166         /*
1167          * If set to 1, then the KONG host mailbox channel is supported.
1168          * If set to 0, then the KONG host mailbox channel is not supported.
1169          * By default, this flag should be 0 for older version of core firmware.
1170          */
1171         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED \
1172                 UINT32_C(0x10)
1173         /*
1174          * If set to 1, then the 64bit flow handle is supported in addition to the
1175          * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
1176          * supported. By default, this flag should be 0 for older version of core firmware.
1177          */
1178         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED \
1179                 UINT32_C(0x20)
1180         /*
1181          * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
1182          * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
1183          * If set to 0, then filter types not supported.
1184          * By default, this flag should be 0 for older version of core firmware.
1185          */
1186         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED \
1187                 UINT32_C(0x40)
1188         /*
1189          * If set to 1, firmware is capable to support virtio vSwitch offload model.
1190          * If set to 0, firmware can't supported virtio vSwitch offload model.
1191          * By default, this flag should be 0 for older version of core firmware.
1192          */
1193         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED \
1194                 UINT32_C(0x80)
1195         /*
1196          * If set to 1, firmware is capable to support trusted VF.
1197          * If set to 0, firmware is not capable to support trusted VF.
1198          * By default, this flag should be 0 for older version of core firmware.
1199          */
1200         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED \
1201                 UINT32_C(0x100)
1202         /*
1203          * If set to 1, firmware is capable to support flow aging.
1204          * If set to 0, firmware is not capable to support flow aging.
1205          * By default, this flag should be 0 for older version of core firmware.
1206          */
1207         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED \
1208                 UINT32_C(0x200)
1209         /*
1210          * If set to 1, firmware is capable to support advanced flow counters like,
1211          * Meter drop counters and EEM counters.
1212          * If set to 0, firmware is not capable to support advanced flow counters.
1213          * By default, this flag should be 0 for older version of core firmware.
1214          */
1215         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED \
1216                 UINT32_C(0x400)
1217         /*
1218          * If set to 1, the firmware is able to support the use of the CFA
1219          * Extended Exact Match(EEM) feature.
1220          * If set to 0, firmware is not capable to support the use of the
1221          * CFA EEM feature.
1222          * By default, this flag should be 0 for older version of core firmware.
1223          */
1224         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED \
1225                 UINT32_C(0x800)
1226         /*
1227          * If set to 1, the firmware is able to support advance CFA flow management
1228          * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
1229          * If set to 0, then the firmware doesn’t support the advance CFA flow management
1230          * features.
1231          * By default, this flag should be 0 for older version of core firmware.
1232          */
1233         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED \
1234                 UINT32_C(0x1000)
1235         /*
1236          * Deprecated and replaced with cfa_truflow_supported.
1237          * If set to 1, the firmware is able to support TFLIB features.
1238          * If set to 0, then the firmware doesn’t support TFLIB features.
1239          * By default, this flag should be 0 for older version of core firmware.
1240          */
1241         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED \
1242                 UINT32_C(0x2000)
1243         /*
1244          * If set to 1, the firmware is able to support TruFlow features.
1245          * If set to 0, then the firmware doesn’t support TruFlow features.
1246          * By default, this flag should be 0 for older version of
1247          * core firmware.
1248          */
1249         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED \
1250                 UINT32_C(0x4000)
1251         /*
1252          * This field represents the major version of RoCE firmware.
1253          * A change in major version represents a major release.
1254          */
1255         uint8_t roce_fw_maj_8b;
1256         /*
1257          * This field represents the minor version of RoCE firmware.
1258          * A change in minor version represents significant
1259          * functionality changes.
1260          */
1261         uint8_t roce_fw_min_8b;
1262         /*
1263          * This field represents the build version of RoCE firmware.
1264          * A change in update version represents bug fixes.
1265          */
1266         uint8_t roce_fw_bld_8b;
1267         /*
1268          * This field is a reserved field. This field can be used to
1269          * represent firmware branches or customer specific releases
1270          * tied to a specific (major,minor,update) version
1271          */
1272         uint8_t roce_fw_rsvd_8b;
1273         /*
1274          * This field represents the name of HWRM FW (ASCII chars
1275          * with NULL at the end).
1276          */
1277         char    hwrm_fw_name[16];
1278         /*
1279          * This field represents the name of mgmt FW (ASCII chars
1280          * with NULL at the end).
1281          */
1282         char    mgmt_fw_name[16];
1283         /*
1284          * This field represents the name of network control
1285          * firmware (ASCII chars with NULL at the end).
1286          */
1287         char    netctrl_fw_name[16];
1288         /* This field represents the active board package name. */
1289         char    active_pkg_name[16];
1290         /*
1291          * This field represents the name of RoCE FW (ASCII chars
1292          * with NULL at the end).
1293          */
1294         char    roce_fw_name[16];
1295         /* This field returns the chip number. */
1296         uint16_t        chip_num;
1297         /* This field returns the revision of chip. */
1298         uint8_t chip_rev;
1299         /* This field returns the chip metal number. */
1300         uint8_t chip_metal;
1301         /* This field returns the bond id of the chip. */
1302         uint8_t chip_bond_id;
1303         /* This value indicates the type of platform used for chip implementation. */
1304         uint8_t chip_platform_type;
1305         /* ASIC */
1306         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC      UINT32_C(0x0)
1307         /* FPGA platform of the chip. */
1308         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA      UINT32_C(0x1)
1309         /* Palladium platform of the chip. */
1310         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
1311         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \
1312                 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
1313         /*
1314          * This field returns the maximum value of request window that
1315          * is supported by the HWRM. The request window is mapped
1316          * into device address space using MMIO.
1317          */
1318         uint16_t        max_req_win_len;
1319         /*
1320          * This field returns the maximum value of response buffer in
1321          * bytes.
1322          */
1323         uint16_t        max_resp_len;
1324         /*
1325          * This field returns the default request timeout value in
1326          * milliseconds.
1327          */
1328         uint16_t        def_req_timeout;
1329         /*
1330          * This field will indicate if any subsystems is not fully
1331          * initialized.
1332          */
1333         uint8_t flags;
1334         /*
1335          * If set to 1, it will indicate to host drivers that firmware is
1336          * not ready to start full blown HWRM commands. Host drivers should
1337          * re-try HWRM_VER_GET with some timeout period. The timeout period
1338          * can be selected up to 5 seconds.
1339          * For Example, PCIe hot-plug:
1340          *     Hot plug timing is system dependent. It generally takes up to
1341          *     600 miliseconds for firmware to clear DEV_NOT_RDY flag.
1342          * If set to 0, device is ready to accept all HWRM commands.
1343          */
1344         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY       UINT32_C(0x1)
1345         /*
1346          * If set to 1, external version present.
1347          * If set to 0, external version not present.
1348          */
1349         #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL     UINT32_C(0x2)
1350         uint8_t unused_0[2];
1351         /*
1352          * For backward compatibility this field must be set to 1.
1353          * Older drivers might look for this field to be 1 before
1354          * processing the message.
1355          */
1356         uint8_t always_1;
1357         /*
1358          * This field represents the major version of HWRM interface
1359          * specification supported by the HWRM implementation.
1360          * The interface major version is intended to change only when
1361          * non backward compatible changes are made to the HWRM
1362          * interface specification. A HWRM implementation that is
1363          * compliant with this specification shall provide value of 1
1364          * in this field.
1365          */
1366         uint16_t        hwrm_intf_major;
1367         /*
1368          * This field represents the minor version of HWRM interface
1369          * specification supported by the HWRM implementation.
1370          * A change in interface minor version is used to reflect
1371          * significant backward compatible modification to HWRM
1372          * interface specification. This can be due to addition or
1373          * removal of functionality. HWRM interface specifications
1374          * with the same major version but different minor versions are
1375          * compatible. A HWRM implementation that is compliant with
1376          * this specification shall provide value of 2 in this field.
1377          */
1378         uint16_t        hwrm_intf_minor;
1379         /*
1380          * This field represents the update version of HWRM interface
1381          * specification supported by the HWRM implementation. The
1382          * interface update version is used to reflect minor changes or
1383          * bug fixes to a released HWRM interface specification.
1384          * A HWRM implementation that is compliant with this
1385          * specification shall provide value of 2 in this field.
1386          */
1387         uint16_t        hwrm_intf_build;
1388         /*
1389          * This field represents the patch version of HWRM interface
1390          * specification supported by the HWRM implementation.
1391          */
1392         uint16_t        hwrm_intf_patch;
1393         /*
1394          * This field represents the major version of HWRM firmware.
1395          * A change in firmware major version represents a major
1396          * firmware release.
1397          */
1398         uint16_t        hwrm_fw_major;
1399         /*
1400          * This field represents the minor version of HWRM firmware.
1401          * A change in firmware minor version represents significant
1402          * firmware functionality changes.
1403          */
1404         uint16_t        hwrm_fw_minor;
1405         /*
1406          * This field represents the build version of HWRM firmware.
1407          * A change in firmware build version represents bug fixes to
1408          * a released firmware.
1409          */
1410         uint16_t        hwrm_fw_build;
1411         /*
1412          * This field is a reserved field.
1413          * This field can be used to represent firmware branches or customer
1414          * specific releases tied to a specific (major,minor,update) version
1415          * of the HWRM firmware.
1416          */
1417         uint16_t        hwrm_fw_patch;
1418         /*
1419          * This field represents the major version of mgmt firmware.
1420          * A change in major version represents a major release.
1421          */
1422         uint16_t        mgmt_fw_major;
1423         /*
1424          * This field represents the minor version of HWRM firmware.
1425          * A change in firmware minor version represents significant
1426          * firmware functionality changes.
1427          */
1428         uint16_t        mgmt_fw_minor;
1429         /*
1430          * This field represents the build version of mgmt firmware.
1431          * A change in update version represents bug fixes.
1432          */
1433         uint16_t        mgmt_fw_build;
1434         /*
1435          * This field is a reserved field. This field can be used to
1436          * represent firmware branches or customer specific releases
1437          * tied to a specific (major,minor,update) version.
1438          */
1439         uint16_t        mgmt_fw_patch;
1440         /*
1441          * This field represents the major version of network control
1442          * firmware. A change in major version represents
1443          * a major release.
1444          */
1445         uint16_t        netctrl_fw_major;
1446         /*
1447          * This field represents the minor version of network control
1448          * firmware. A change in minor version represents significant
1449          * functionality changes.
1450          */
1451         uint16_t        netctrl_fw_minor;
1452         /*
1453          * This field represents the build version of network control
1454          * firmware. A change in update version represents bug fixes.
1455          */
1456         uint16_t        netctrl_fw_build;
1457         /*
1458          * This field is a reserved field. This field can be used to
1459          * represent firmware branches or customer specific releases
1460          * tied to a specific (major,minor,update) version
1461          */
1462         uint16_t        netctrl_fw_patch;
1463         /*
1464          * This field represents the major version of RoCE firmware.
1465          * A change in major version represents a major release.
1466          */
1467         uint16_t        roce_fw_major;
1468         /*
1469          * This field represents the minor version of RoCE firmware.
1470          * A change in minor version represents significant
1471          * functionality changes.
1472          */
1473         uint16_t        roce_fw_minor;
1474         /*
1475          * This field represents the build version of RoCE firmware.
1476          * A change in update version represents bug fixes.
1477          */
1478         uint16_t        roce_fw_build;
1479         /*
1480          * This field is a reserved field. This field can be used to
1481          * represent firmware branches or customer specific releases
1482          * tied to a specific (major,minor,update) version
1483          */
1484         uint16_t        roce_fw_patch;
1485         /*
1486          * This field returns the maximum extended request length acceptable
1487          * by the device which allows requests greater than mailbox size when
1488          * used with the short cmd request format.
1489          */
1490         uint16_t        max_ext_req_len;
1491         uint8_t unused_1[5];
1492         /*
1493          * This field is used in Output records to indicate that the output
1494          * is completely written to RAM.  This field should be read as '1'
1495          * to indicate that the output has been completely written.
1496          * When writing a command completion or response to an internal processor,
1497          * the order of writes has to be such that this field is written last.
1498          */
1499         uint8_t valid;
1500 } __rte_packed;
1501
1502 /* bd_base (size:64b/8B) */
1503 struct bd_base {
1504         uint8_t type;
1505         /* This value identifies the type of buffer descriptor. */
1506         #define BD_BASE_TYPE_MASK             UINT32_C(0x3f)
1507         #define BD_BASE_TYPE_SFT              0
1508         /*
1509          * Indicates that this BD is 16B long and is used for
1510          * normal L2 packet transmission.
1511          */
1512         #define BD_BASE_TYPE_TX_BD_SHORT        UINT32_C(0x0)
1513         /*
1514          * Indicates that this BD is 1BB long and is an empty
1515          * TX BD. Not valid for use by the driver.
1516          */
1517         #define BD_BASE_TYPE_TX_BD_EMPTY        UINT32_C(0x1)
1518         /*
1519          * Indicates that this BD is 16B long and is an RX Producer
1520          * (i.e. empty) buffer descriptor.
1521          */
1522         #define BD_BASE_TYPE_RX_PROD_PKT        UINT32_C(0x4)
1523         /*
1524          * Indicates that this BD is 16B long and is an RX
1525          * Producer Buffer BD.
1526          */
1527         #define BD_BASE_TYPE_RX_PROD_BFR        UINT32_C(0x5)
1528         /*
1529          * Indicates that this BD is 16B long and is an
1530          * RX Producer Assembly Buffer Descriptor.
1531          */
1532         #define BD_BASE_TYPE_RX_PROD_AGG        UINT32_C(0x6)
1533         /*
1534          * Indicates that this BD is 32B long and is used for
1535          * normal L2 packet transmission.
1536          */
1537         #define BD_BASE_TYPE_TX_BD_LONG         UINT32_C(0x10)
1538         /*
1539          * Indicates that this BD is 32B long and is used for
1540          * L2 packet transmission for small packets that require
1541          * low latency.
1542          */
1543         #define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
1544         #define BD_BASE_TYPE_LAST              BD_BASE_TYPE_TX_BD_LONG_INLINE
1545         uint8_t unused_1[7];
1546 } __rte_packed;
1547
1548 /* tx_bd_short (size:128b/16B) */
1549 struct tx_bd_short {
1550         /*
1551          * All bits in this field must be valid on the first BD of a packet.
1552          * Only the packet_end bit must be valid for the remaining BDs
1553          * of a packet.
1554          */
1555         uint16_t        flags_type;
1556         /* This value identifies the type of buffer descriptor. */
1557         #define TX_BD_SHORT_TYPE_MASK            UINT32_C(0x3f)
1558         #define TX_BD_SHORT_TYPE_SFT             0
1559         /*
1560          * Indicates that this BD is 16B long and is used for
1561          * normal L2 packet transmission.
1562          */
1563         #define TX_BD_SHORT_TYPE_TX_BD_SHORT       UINT32_C(0x0)
1564         #define TX_BD_SHORT_TYPE_LAST             TX_BD_SHORT_TYPE_TX_BD_SHORT
1565         /*
1566          * All bits in this field must be valid on the first BD of a packet.
1567          * Only the packet_end bit must be valid for the remaining BDs
1568          * of a packet.
1569          */
1570         #define TX_BD_SHORT_FLAGS_MASK           UINT32_C(0xffc0)
1571         #define TX_BD_SHORT_FLAGS_SFT            6
1572         /*
1573          * If set to 1, the packet ends with the data in the buffer
1574          * pointed to by this descriptor. This flag must be
1575          * valid on every BD.
1576          */
1577         #define TX_BD_SHORT_FLAGS_PACKET_END      UINT32_C(0x40)
1578         /*
1579          * If set to 1, the device will not generate a completion for
1580          * this transmit packet unless there is an error in it's
1581          * processing.
1582          * If this bit
1583          * is set to 0, then the packet will be completed normally.
1584          *
1585          * This bit must be valid only on the first BD of a packet.
1586          */
1587         #define TX_BD_SHORT_FLAGS_NO_CMPL         UINT32_C(0x80)
1588         /*
1589          * This value indicates how many 16B BD locations are consumed
1590          * in the ring by this packet.
1591          * A value of 1 indicates that this BD is the only BD (and that
1592          * it is a short BD). A value
1593          * of 3 indicates either 3 short BDs or 1 long BD and one short
1594          * BD in the packet. A value of 0 indicates
1595          * that there are 32 BD locations in the packet (the maximum).
1596          *
1597          * This field is valid only on the first BD of a packet.
1598          */
1599         #define TX_BD_SHORT_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1600         #define TX_BD_SHORT_FLAGS_BD_CNT_SFT      8
1601         /*
1602          * This value is a hint for the length of the entire packet.
1603          * It is used by the chip to optimize internal processing.
1604          *
1605          * The packet will be dropped if the hint is too short.
1606          *
1607          * This field is valid only on the first BD of a packet.
1608          */
1609         #define TX_BD_SHORT_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1610         #define TX_BD_SHORT_FLAGS_LHINT_SFT       13
1611         /* indicates packet length < 512B */
1612         #define TX_BD_SHORT_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1613         /* indicates 512 <= packet length < 1KB */
1614         #define TX_BD_SHORT_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1615         /* indicates 1KB <= packet length < 2KB */
1616         #define TX_BD_SHORT_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1617         /* indicates packet length >= 2KB */
1618         #define TX_BD_SHORT_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1619         #define TX_BD_SHORT_FLAGS_LHINT_LAST \
1620                 TX_BD_SHORT_FLAGS_LHINT_GTE2K
1621         /*
1622          * If set to 1, the device immediately updates the Send Consumer
1623          * Index after the buffer associated with this descriptor has
1624          * been transferred via DMA to NIC memory from host memory. An
1625          * interrupt may or may not be generated according to the state
1626          * of the interrupt avoidance mechanisms. If this bit
1627          * is set to 0, then the Consumer Index is only updated as soon
1628          * as one of the host interrupt coalescing conditions has been met.
1629          *
1630          * This bit must be valid on the first BD of a packet.
1631          */
1632         #define TX_BD_SHORT_FLAGS_COAL_NOW        UINT32_C(0x8000)
1633         /*
1634          * This is the length of the host physical buffer this BD describes
1635          * in bytes.
1636          *
1637          * This field must be valid on all BDs of a packet.
1638          */
1639         uint16_t        len;
1640         /*
1641          * The opaque data field is pass through to the completion and can be
1642          * used for any data that the driver wants to associate with the
1643          * transmit BD.
1644          *
1645          * This field must be valid on the first BD of a packet.
1646          */
1647         uint32_t        opaque;
1648         /*
1649          * This is the host physical address for the portion of the packet
1650          * described by this TX BD.
1651          *
1652          * This value must be valid on all BDs of a packet.
1653          */
1654         uint64_t        address;
1655 } __rte_packed;
1656
1657 /* tx_bd_long (size:128b/16B) */
1658 struct tx_bd_long {
1659         /* This value identifies the type of buffer descriptor. */
1660         uint16_t        flags_type;
1661         /*
1662          * This value indicates the type of buffer descriptor.
1663          * packet.
1664          */
1665         #define TX_BD_LONG_TYPE_MASK            UINT32_C(0x3f)
1666         #define TX_BD_LONG_TYPE_SFT             0
1667         /*
1668          * Indicates that this BD is 32B long and is used for
1669          * normal L2 packet transmission.
1670          */
1671         #define TX_BD_LONG_TYPE_TX_BD_LONG        UINT32_C(0x10)
1672         #define TX_BD_LONG_TYPE_LAST             TX_BD_LONG_TYPE_TX_BD_LONG
1673         /*
1674          * All bits in this field must be valid on the first BD of a packet.
1675          * Only the packet_end bit must be valid for the remaining BDs
1676          * of a packet.
1677          */
1678         #define TX_BD_LONG_FLAGS_MASK           UINT32_C(0xffc0)
1679         #define TX_BD_LONG_FLAGS_SFT            6
1680         /*
1681          * If set to 1, the packet ends with the data in the buffer
1682          * pointed to by this descriptor. This flag must be
1683          * valid on every BD.
1684          */
1685         #define TX_BD_LONG_FLAGS_PACKET_END      UINT32_C(0x40)
1686         /*
1687          * If set to 1, the device will not generate a completion for
1688          * this transmit packet unless there is an error in it's
1689          * processing.
1690          * If this bit
1691          * is set to 0, then the packet will be completed normally.
1692          *
1693          * This bit must be valid only on the first BD of a packet.
1694          */
1695         #define TX_BD_LONG_FLAGS_NO_CMPL         UINT32_C(0x80)
1696         /*
1697          * This value indicates how many 16B BD locations are consumed
1698          * in the ring by this packet.
1699          * A value of 1 indicates that this BD is the only BD (and that
1700          * it is a short BD). A value
1701          * of 3 indicates either 3 short BDs or 1 long BD and one short
1702          * BD in the packet. A value of 0 indicates
1703          * that there are 32 BD locations in the packet (the maximum).
1704          *
1705          * This field is valid only on the first BD of a packet.
1706          */
1707         #define TX_BD_LONG_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1708         #define TX_BD_LONG_FLAGS_BD_CNT_SFT      8
1709         /*
1710          * This value is a hint for the length of the entire packet.
1711          * It is used by the chip to optimize internal processing.
1712          *
1713          * The packet will be dropped if the hint is too short.
1714          *
1715          * This field is valid only on the first BD of a packet.
1716          */
1717         #define TX_BD_LONG_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1718         #define TX_BD_LONG_FLAGS_LHINT_SFT       13
1719         /* indicates packet length < 512B */
1720         #define TX_BD_LONG_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1721         /* indicates 512 <= packet length < 1KB */
1722         #define TX_BD_LONG_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1723         /* indicates 1KB <= packet length < 2KB */
1724         #define TX_BD_LONG_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1725         /* indicates packet length >= 2KB */
1726         #define TX_BD_LONG_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1727         #define TX_BD_LONG_FLAGS_LHINT_LAST       TX_BD_LONG_FLAGS_LHINT_GTE2K
1728         /*
1729          * If set to 1, the device immediately updates the Send Consumer
1730          * Index after the buffer associated with this descriptor has
1731          * been transferred via DMA to NIC memory from host memory. An
1732          * interrupt may or may not be generated according to the state
1733          * of the interrupt avoidance mechanisms. If this bit
1734          * is set to 0, then the Consumer Index is only updated as soon
1735          * as one of the host interrupt coalescing conditions has been met.
1736          *
1737          * This bit must be valid on the first BD of a packet.
1738          */
1739         #define TX_BD_LONG_FLAGS_COAL_NOW        UINT32_C(0x8000)
1740         /*
1741          * This is the length of the host physical buffer this BD describes
1742          * in bytes.
1743          *
1744          * This field must be valid on all BDs of a packet.
1745          */
1746         uint16_t        len;
1747         /*
1748          * The opaque data field is pass through to the completion and can be
1749          * used for any data that the driver wants to associate with the
1750          * transmit BD.
1751          *
1752          * This field must be valid on the first BD of a packet.
1753          */
1754         uint32_t        opaque;
1755         /*
1756          * This is the host physical address for the portion of the packet
1757          * described by this TX BD.
1758          *
1759          * This value must be valid on all BDs of a packet.
1760          */
1761         uint64_t        address;
1762 } __rte_packed;
1763
1764 /* Last 16 bytes of tx_bd_long. */
1765 /* tx_bd_long_hi (size:128b/16B) */
1766 struct tx_bd_long_hi {
1767         /*
1768          * All bits in this field must be valid on the first BD of a packet.
1769          * Their value on other BDs of the packet will be ignored.
1770          */
1771         uint16_t        lflags;
1772         /*
1773          * If set to 1, the controller replaces the TCP/UPD checksum
1774          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
1775          * checksum field of the encapsulated TCP/UDP packets with the
1776          * hardware calculated TCP/UDP checksum for the packet associated
1777          * with this descriptor. The flag is ignored if the LSO flag is set.
1778          *
1779          * This bit must be valid on the first BD of a packet.
1780          */
1781         #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
1782         /*
1783          * If set to 1, the controller replaces the IP checksum of the
1784          * normal packets, or the inner IP checksum of the encapsulated
1785          * packets with the hardware calculated IP checksum for the
1786          * packet associated with this descriptor.
1787          *
1788          * This bit must be valid on the first BD of a packet.
1789          */
1790         #define TX_BD_LONG_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
1791         /*
1792          * If set to 1, the controller will not append an Ethernet CRC
1793          * to the end of the frame.
1794          *
1795          * This bit must be valid on the first BD of a packet.
1796          *
1797          * Packet must be 64B or longer when this flag is set. It is not
1798          * useful to use this bit with any form of TX offload such as
1799          * CSO or LSO. The intent is that the packet from the host already
1800          * has a valid Ethernet CRC on the packet.
1801          */
1802         #define TX_BD_LONG_LFLAGS_NOCRC              UINT32_C(0x4)
1803         /*
1804          * If set to 1, the device will record the time at which the packet
1805          * was actually transmitted at the TX MAC.
1806          *
1807          * This bit must be valid on the first BD of a packet.
1808          */
1809         #define TX_BD_LONG_LFLAGS_STAMP              UINT32_C(0x8)
1810         /*
1811          * If set to 1, The controller replaces the tunnel IP checksum
1812          * field with hardware calculated IP checksum for the IP header
1813          * of the packet associated with this descriptor.
1814          *
1815          * For outer UDP checksum, global outer UDP checksum TE_NIC register
1816          * needs to be enabled. If the global outer UDP checksum TE_NIC register
1817          * bit is set, outer UDP checksum will be calculated for the following
1818          * cases:
1819          * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
1820          * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
1821          * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
1822          * checksum will not be calculated.
1823          * 2. Packets with lso flag set which implies inner TCP checksum calculation
1824          * as part of LSO operation.
1825          */
1826         #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
1827         /*
1828          * If set to 1, the device will treat this packet with LSO(Large
1829          * Send Offload) processing for both normal or encapsulated
1830          * packets, which is a form of TCP segmentation. When this bit
1831          * is 1, the hdr_size and mss fields must be valid. The driver
1832          * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
1833          * flags since the controller will replace the appropriate
1834          * checksum fields for segmented packets.
1835          *
1836          * When this bit is 1, the hdr_size and mss fields must be valid.
1837          */
1838         #define TX_BD_LONG_LFLAGS_LSO                UINT32_C(0x20)
1839         /*
1840          * If set to zero when LSO is '1', then the IPID will be treated
1841          * as a 16b number and will be wrapped if it exceeds a value of
1842          * 0xffff.
1843          *
1844          * If set to one when LSO is '1', then the IPID will be treated
1845          * as a 15b number and will be wrapped if it exceeds a value 0f
1846          * 0x7fff.
1847          */
1848         #define TX_BD_LONG_LFLAGS_IPID_FMT           UINT32_C(0x40)
1849         /*
1850          * If set to zero when LSO is '1', then the IPID of the tunnel
1851          * IP header will not be modified during LSO operations.
1852          *
1853          * If set to one when LSO is '1', then the IPID of the tunnel
1854          * IP header will be incremented for each subsequent segment of an
1855          * LSO operation.
1856          *
1857          * The flag is ignored if the LSO packet is a normal (non-tunneled)
1858          * TCP packet.
1859          */
1860         #define TX_BD_LONG_LFLAGS_T_IPID             UINT32_C(0x80)
1861         /*
1862          * If set to '1', then the RoCE ICRC will be appended to the
1863          * packet. Packet must be a valid RoCE format packet.
1864          */
1865         #define TX_BD_LONG_LFLAGS_ROCE_CRC           UINT32_C(0x100)
1866         /*
1867          * If set to '1', then the FCoE CRC will be appended to the
1868          * packet. Packet must be a valid FCoE format packet.
1869          */
1870         #define TX_BD_LONG_LFLAGS_FCOE_CRC           UINT32_C(0x200)
1871         uint16_t        hdr_size;
1872         /*
1873          * When LSO is '1', this field must contain the offset of the
1874          * TCP payload from the beginning of the packet in as
1875          * 16b words. In case of encapsulated/tunneling packet, this field
1876          * contains the offset of the inner TCP payload from beginning of the
1877          * packet as 16-bit words.
1878          *
1879          * This value must be valid on the first BD of a packet.
1880          */
1881         #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
1882         #define TX_BD_LONG_HDR_SIZE_SFT 0
1883         uint32_t        mss;
1884         /*
1885          * This is the MSS value that will be used to do the LSO processing.
1886          * The value is the length in bytes of the TCP payload for each
1887          * segment generated by the LSO operation.
1888          *
1889          * This value must be valid on the first BD of a packet.
1890          */
1891         #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
1892         #define TX_BD_LONG_MSS_SFT 0
1893         uint16_t        unused2;
1894         /*
1895          * This value selects a CFA action to perform on the packet.
1896          * Set this value to zero if no CFA action is desired.
1897          *
1898          * This value must be valid on the first BD of a packet.
1899          */
1900         uint16_t        cfa_action;
1901         /*
1902          * This value is action meta-data that defines CFA edit operations
1903          * that are done in addition to any action editing.
1904          */
1905         uint32_t        cfa_meta;
1906         /* When key=1, This is the VLAN tag VID value. */
1907         #define TX_BD_LONG_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
1908         #define TX_BD_LONG_CFA_META_VLAN_VID_SFT      0
1909         /* When key=1, This is the VLAN tag DE value. */
1910         #define TX_BD_LONG_CFA_META_VLAN_DE           UINT32_C(0x1000)
1911         /* When key=1, This is the VLAN tag PRI value. */
1912         #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
1913         #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT      13
1914         /* When key=1, This is the VLAN tag TPID select value. */
1915         #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
1916         #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT     16
1917         /* 0x88a8 */
1918         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
1919         /* 0x8100 */
1920         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
1921         /* 0x9100 */
1922         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
1923         /* 0x9200 */
1924         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
1925         /* 0x9300 */
1926         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
1927         /* Value programmed in CFA VLANTPID register. */
1928         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
1929         #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
1930                 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
1931         /* When key=1, This is the VLAN tag TPID select value. */
1932         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
1933         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
1934         /*
1935          * This field identifies the type of edit to be performed
1936          * on the packet.
1937          *
1938          * This value must be valid on the first BD of a packet.
1939          */
1940         #define TX_BD_LONG_CFA_META_KEY_MASK          UINT32_C(0xf0000000)
1941         #define TX_BD_LONG_CFA_META_KEY_SFT           28
1942         /* No editing */
1943         #define TX_BD_LONG_CFA_META_KEY_NONE            (UINT32_C(0x0) << 28)
1944         /*
1945          * - meta[17:16] - TPID select value (0 = 0x8100).
1946          * - meta[15:12] - PRI/DE value.
1947          * - meta[11:0] - VID value.
1948          */
1949         #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG        (UINT32_C(0x1) << 28)
1950         #define TX_BD_LONG_CFA_META_KEY_LAST \
1951                 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
1952 } __rte_packed;
1953
1954 /*
1955  * This structure is used to inform the NIC of packet data that needs to be
1956  * transmitted with additional processing that requires extra data such as
1957  * VLAN insertion plus attached inline data. This BD type may be used to
1958  * improve latency for small packets needing the additional extended features
1959  * supported by long BDs.
1960  */
1961 /* tx_bd_long_inline (size:256b/32B) */
1962 struct tx_bd_long_inline {
1963         uint16_t        flags_type;
1964         /* This value identifies the type of buffer descriptor. */
1965         #define TX_BD_LONG_INLINE_TYPE_MASK             UINT32_C(0x3f)
1966         #define TX_BD_LONG_INLINE_TYPE_SFT              0
1967         /*
1968          * This type of BD is 32B long and is used for inline L2 packet
1969          * transmission.
1970          */
1971         #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
1972         #define TX_BD_LONG_INLINE_TYPE_LAST \
1973                 TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
1974         /*
1975          * All bits in this field may be set on the first BD of a packet.
1976          * Only the packet_end bit may be set in non-first BDs.
1977          */
1978         #define TX_BD_LONG_INLINE_FLAGS_MASK            UINT32_C(0xffc0)
1979         #define TX_BD_LONG_INLINE_FLAGS_SFT             6
1980         /*
1981          * If set to 1, the packet ends with the data in the buffer
1982          * pointed to by this descriptor. This flag must be
1983          * valid on every BD.
1984          */
1985         #define TX_BD_LONG_INLINE_FLAGS_PACKET_END       UINT32_C(0x40)
1986         /*
1987          * If set to 1, the device will not generate a completion for
1988          * this transmit packet unless there is an error in its processing.
1989          * If this bit is set to 0, then the packet will be completed
1990          * normally.
1991          *
1992          * This bit may be set only on the first BD of a packet.
1993          */
1994         #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL          UINT32_C(0x80)
1995         /*
1996          * This value indicates how many 16B BD locations are consumed
1997          * in the ring by this packet, including the BD and inline
1998          * data.
1999          */
2000         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
2001         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT       8
2002         /* This field is deprecated. */
2003         #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK       UINT32_C(0x6000)
2004         #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT        13
2005         /*
2006          * If set to 1, the device immediately updates the Send Consumer
2007          * Index after the buffer associated with this descriptor has
2008          * been transferred via DMA to NIC memory from host memory. An
2009          * interrupt may or may not be generated according to the state
2010          * of the interrupt avoidance mechanisms. If this bit
2011          * is set to 0, then the Consumer Index is only updated as soon
2012          * as one of the host interrupt coalescing conditions has been met.
2013          *
2014          * This bit must be valid on the first BD of a packet.
2015          */
2016         #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW         UINT32_C(0x8000)
2017         /*
2018          * This is the length of the inline data, not including BD length, in
2019          * bytes.
2020          * The maximum value is 480.
2021          *
2022          * This field must be valid on all BDs of a packet.
2023          */
2024         uint16_t        len;
2025         /*
2026          * The opaque data field is passed through to the completion and can be
2027          * used for any data that the driver wants to associate with the transmit
2028          * BD.
2029          *
2030          * This field must be valid on the first BD of a packet.
2031          */
2032         uint32_t        opaque;
2033         uint64_t        unused1;
2034         /*
2035          * All bits in this field must be valid on the first BD of a packet.
2036          * Their value on other BDs of the packet is ignored.
2037          */
2038         uint16_t        lflags;
2039         /*
2040          * If set to 1, the controller replaces the TCP/UPD checksum
2041          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
2042          * checksum field of the encapsulated TCP/UDP packets with the
2043          * hardware calculated TCP/UDP checksum for the packet associated
2044          * with this descriptor. The flag is ignored if the LSO flag is set.
2045          */
2046         #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
2047         /*
2048          * If set to 1, the controller replaces the IP checksum of the
2049          * normal packets, or the inner IP checksum of the encapsulated
2050          * packets with the hardware calculated IP checksum for the
2051          * packet associated with this descriptor.
2052          */
2053         #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
2054         /*
2055          * If set to 1, the controller will not append an Ethernet CRC
2056          * to the end of the frame.
2057          *
2058          * Packet must be 64B or longer when this flag is set. It is not
2059          * useful to use this bit with any form of TX offload such as
2060          * CSO or LSO. The intent is that the packet from the host already
2061          * has a valid Ethernet CRC on the packet.
2062          */
2063         #define TX_BD_LONG_INLINE_LFLAGS_NOCRC              UINT32_C(0x4)
2064         /*
2065          * If set to 1, the device will record the time at which the packet
2066          * was actually transmitted at the TX MAC.
2067          */
2068         #define TX_BD_LONG_INLINE_LFLAGS_STAMP              UINT32_C(0x8)
2069         /*
2070          * If set to 1, the controller replaces the tunnel IP checksum
2071          * field with hardware calculated IP checksum for the IP header
2072          * of the packet associated with this descriptor. The hardware
2073          * updates an outer UDP checksum if it is non-zero.
2074          */
2075         #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
2076         /*
2077          * This bit must be 0 for BDs of this type. LSO is not supported with
2078          * inline BDs.
2079          */
2080         #define TX_BD_LONG_INLINE_LFLAGS_LSO                UINT32_C(0x20)
2081         /* Since LSO is not supported with inline BDs, this bit is not used. */
2082         #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT           UINT32_C(0x40)
2083         /* Since LSO is not supported with inline BDs, this bit is not used. */
2084         #define TX_BD_LONG_INLINE_LFLAGS_T_IPID             UINT32_C(0x80)
2085         /*
2086          * If set to '1', then the RoCE ICRC will be appended to the
2087          * packet. Packet must be a valid RoCE format packet.
2088          */
2089         #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC           UINT32_C(0x100)
2090         /*
2091          * If set to '1', then the FCoE CRC will be appended to the
2092          * packet. Packet must be a valid FCoE format packet.
2093          */
2094         #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC           UINT32_C(0x200)
2095         uint16_t        unused2;
2096         uint32_t        unused3;
2097         uint16_t        unused4;
2098         /*
2099          * This value selects a CFA action to perform on the packet.
2100          * Set this value to zero if no CFA action is desired.
2101          *
2102          * This value must be valid on the first BD of a packet.
2103          */
2104         uint16_t        cfa_action;
2105         /*
2106          * This value is action meta-data that defines CFA edit operations
2107          * that are done in addition to any action editing.
2108          */
2109         uint32_t        cfa_meta;
2110         /* When key = 1, this is the VLAN tag VID value. */
2111         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
2112         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT      0
2113         /* When key = 1, this is the VLAN tag DE value. */
2114         #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE           UINT32_C(0x1000)
2115         /* When key = 1, this is the VLAN tag PRI value. */
2116         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
2117         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT      13
2118         /* When key = 1, this is the VLAN tag TPID select value. */
2119         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
2120         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT     16
2121         /* 0x88a8 */
2122         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 \
2123                 (UINT32_C(0x0) << 16)
2124         /* 0x8100 */
2125         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 \
2126                 (UINT32_C(0x1) << 16)
2127         /* 0x9100 */
2128         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 \
2129                 (UINT32_C(0x2) << 16)
2130         /* 0x9200 */
2131         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 \
2132                 (UINT32_C(0x3) << 16)
2133         /* 0x9300 */
2134         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 \
2135                 (UINT32_C(0x4) << 16)
2136         /* Value programmed in CFA VLANTPID register. */
2137         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG \
2138                 (UINT32_C(0x5) << 16)
2139         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST \
2140                 TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
2141         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK \
2142                 UINT32_C(0xff80000)
2143         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT 19
2144         /*
2145          * This field identifies the type of edit to be performed
2146          * on the packet.
2147          *
2148          * This value must be valid on the first BD of a packet.
2149          */
2150         #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK \
2151                 UINT32_C(0xf0000000)
2152         #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT           28
2153         /* No editing */
2154         #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE \
2155                 (UINT32_C(0x0) << 28)
2156         /*
2157          * - meta[17:16] - TPID select value (0 = 0x8100).
2158          * - meta[15:12] - PRI/DE value.
2159          * - meta[11:0] - VID value.
2160          */
2161         #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG \
2162                 (UINT32_C(0x1) << 28)
2163         #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \
2164                 TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG
2165 } __rte_packed;
2166
2167 /* tx_bd_empty (size:128b/16B) */
2168 struct tx_bd_empty {
2169         /* This value identifies the type of buffer descriptor. */
2170         uint8_t type;
2171         #define TX_BD_EMPTY_TYPE_MASK       UINT32_C(0x3f)
2172         #define TX_BD_EMPTY_TYPE_SFT        0
2173         /*
2174          * Indicates that this BD is 1BB long and is an empty
2175          * TX BD. Not valid for use by the driver.
2176          */
2177         #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
2178         #define TX_BD_EMPTY_TYPE_LAST        TX_BD_EMPTY_TYPE_TX_BD_EMPTY
2179         uint8_t unused_1[3];
2180         uint8_t unused_2;
2181         uint8_t unused_3[3];
2182         uint8_t unused_4[8];
2183 } __rte_packed;
2184
2185 /* rx_prod_pkt_bd (size:128b/16B) */
2186 struct rx_prod_pkt_bd {
2187         /* This value identifies the type of buffer descriptor. */
2188         uint16_t        flags_type;
2189         /* This value identifies the type of buffer descriptor. */
2190         #define RX_PROD_PKT_BD_TYPE_MASK         UINT32_C(0x3f)
2191         #define RX_PROD_PKT_BD_TYPE_SFT          0
2192         /*
2193          * Indicates that this BD is 16B long and is an RX Producer
2194          * (i.e. empty) buffer descriptor.
2195          */
2196         #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT    UINT32_C(0x4)
2197         #define RX_PROD_PKT_BD_TYPE_LAST \
2198                 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
2199         #define RX_PROD_PKT_BD_FLAGS_MASK        UINT32_C(0xffc0)
2200         #define RX_PROD_PKT_BD_FLAGS_SFT         6
2201         /*
2202          * If set to 1, the packet will be placed at the address plus
2203          * 2B. The 2 Bytes of padding will be written as zero.
2204          */
2205         #define RX_PROD_PKT_BD_FLAGS_SOP_PAD      UINT32_C(0x40)
2206         /*
2207          * If set to 1, the packet write will be padded out to the
2208          * nearest cache-line with zero value padding.
2209          */
2210         #define RX_PROD_PKT_BD_FLAGS_EOP_PAD      UINT32_C(0x80)
2211         /*
2212          * This field has been deprecated. There can be no additional
2213          * BDs for this packet from this ring.
2214          *
2215          * Old definition:
2216          * This value is the number of additional buffers in the ring that
2217          * describe the buffer space to be consumed for this packet.
2218          * If the value is zero, then the packet must fit within the
2219          * space described by this BD. If this value is 1 or more, it
2220          * indicates how many additional "buffer" BDs are in the ring
2221          * immediately following this BD to be used for the same
2222          * network packet. Even if the packet to be placed does not need
2223          * all the additional buffers, they will be consumed anyway.
2224          */
2225         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
2226         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
2227         /*
2228          * This is the length in Bytes of the host physical buffer where
2229          * data for the packet may be placed in host memory.
2230          */
2231         uint16_t        len;
2232         /*
2233          * The opaque data field is pass through to the completion and can be
2234          * used for any data that the driver wants to associate with this
2235          * receive buffer set.
2236          */
2237         uint32_t        opaque;
2238         /*
2239          * This is the host physical address where data for the packet may
2240          * be placed in host memory.
2241          */
2242         uint64_t        address;
2243 } __rte_packed;
2244
2245 /* rx_prod_bfr_bd (size:128b/16B) */
2246 struct rx_prod_bfr_bd {
2247         /* This value identifies the type of buffer descriptor. */
2248         uint16_t        flags_type;
2249         /* This value identifies the type of buffer descriptor. */
2250         #define RX_PROD_BFR_BD_TYPE_MASK       UINT32_C(0x3f)
2251         #define RX_PROD_BFR_BD_TYPE_SFT        0
2252         /*
2253          * Indicates that this BD is 16B long and is an RX
2254          * Producer Buffer BD.
2255          */
2256         #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
2257         #define RX_PROD_BFR_BD_TYPE_LAST        RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
2258         #define RX_PROD_BFR_BD_FLAGS_MASK      UINT32_C(0xffc0)
2259         #define RX_PROD_BFR_BD_FLAGS_SFT       6
2260         /*
2261          * This is the length in Bytes of the host physical buffer where
2262          * data for the packet may be placed in host memory.
2263          */
2264         uint16_t        len;
2265         /* This field is not used. */
2266         uint32_t        opaque;
2267         /*
2268          * This is the host physical address where data for the packet may
2269          * be placed in host memory.
2270          */
2271         uint64_t        address;
2272 } __rte_packed;
2273
2274 /* rx_prod_agg_bd (size:128b/16B) */
2275 struct rx_prod_agg_bd {
2276         /* This value identifies the type of buffer descriptor. */
2277         uint16_t        flags_type;
2278         /* This value identifies the type of buffer descriptor. */
2279         #define RX_PROD_AGG_BD_TYPE_MASK         UINT32_C(0x3f)
2280         #define RX_PROD_AGG_BD_TYPE_SFT          0
2281         /*
2282          * Indicates that this BD is 16B long and is an
2283          * RX Producer Assembly Buffer Descriptor.
2284          */
2285         #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG    UINT32_C(0x6)
2286         #define RX_PROD_AGG_BD_TYPE_LAST \
2287                 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
2288         #define RX_PROD_AGG_BD_FLAGS_MASK        UINT32_C(0xffc0)
2289         #define RX_PROD_AGG_BD_FLAGS_SFT         6
2290         /*
2291          * If set to 1, the packet write will be padded out to the
2292          * nearest cache-line with zero value padding.
2293          */
2294         #define RX_PROD_AGG_BD_FLAGS_EOP_PAD      UINT32_C(0x40)
2295         /*
2296          * This is the length in Bytes of the host physical buffer where
2297          * data for the packet may be placed in host memory.
2298          */
2299         uint16_t        len;
2300         /*
2301          * The opaque data field is pass through to the completion and can be
2302          * used for any data that the driver wants to associate with this
2303          * receive assembly buffer.
2304          */
2305         uint32_t        opaque;
2306         /*
2307          * This is the host physical address where data for the packet may
2308          * be placed in host memory.
2309          */
2310         uint64_t        address;
2311 } __rte_packed;
2312
2313 /* cmpl_base (size:128b/16B) */
2314 struct cmpl_base {
2315         uint16_t        type;
2316         /*
2317          * This field indicates the exact type of the completion.
2318          * By convention, the LSB identifies the length of the
2319          * record in 16B units. Even values indicate 16B
2320          * records. Odd values indicate 32B
2321          * records.
2322          */
2323         #define CMPL_BASE_TYPE_MASK            UINT32_C(0x3f)
2324         #define CMPL_BASE_TYPE_SFT             0
2325         /*
2326          * TX L2 completion:
2327          * Completion of TX packet. Length = 16B
2328          */
2329         #define CMPL_BASE_TYPE_TX_L2             UINT32_C(0x0)
2330         /*
2331          * NO-OP completion:
2332          * Completion of NO-OP. Length = 16B
2333          */
2334         #define CMPL_BASE_TYPE_NO_OP             UINT32_C(0x1)
2335         /*
2336          * TX L2 coalesced completion:
2337          * Completion of coalesced TX packet. Length = 16B
2338          */
2339         #define CMPL_BASE_TYPE_TX_L2_COAL        UINT32_C(0x2)
2340         /*
2341          * TX L2 PTP completion:
2342          * Completion of PTP TX packet. Length = 32B
2343          */
2344         #define CMPL_BASE_TYPE_TX_L2_PTP         UINT32_C(0x3)
2345         /*
2346          * RX L2 TPA Start V2 Completion:
2347          * Completion of and L2 RX packet. Length = 32B
2348          * This is the new version of the RX_TPA_START completion used
2349          * in SR2 and later chips.
2350          */
2351         #define CMPL_BASE_TYPE_RX_TPA_START_V2   UINT32_C(0xd)
2352         /*
2353          * RX L2 V2 completion:
2354          * Completion of and L2 RX packet. Length = 32B
2355          * This is the new version of the RX_L2 completion used in SR2
2356          * and later chips.
2357          */
2358         #define CMPL_BASE_TYPE_RX_L2_V2          UINT32_C(0xf)
2359         /*
2360          * RX L2 completion:
2361          * Completion of and L2 RX packet. Length = 32B
2362          */
2363         #define CMPL_BASE_TYPE_RX_L2             UINT32_C(0x11)
2364         /*
2365          * RX Aggregation Buffer completion :
2366          * Completion of an L2 aggregation buffer in support of
2367          * TPA, HDS, or Jumbo packet completion. Length = 16B
2368          */
2369         #define CMPL_BASE_TYPE_RX_AGG            UINT32_C(0x12)
2370         /*
2371          * RX L2 TPA Start Completion:
2372          * Completion at the beginning of a TPA operation.
2373          * Length = 32B
2374          */
2375         #define CMPL_BASE_TYPE_RX_TPA_START      UINT32_C(0x13)
2376         /*
2377          * RX L2 TPA End Completion:
2378          * Completion at the end of a TPA operation.
2379          * Length = 32B
2380          */
2381         #define CMPL_BASE_TYPE_RX_TPA_END        UINT32_C(0x15)
2382         /*
2383          * Statistics Ejection Completion:
2384          * Completion of statistics data ejection buffer.
2385          * Length = 16B
2386          */
2387         #define CMPL_BASE_TYPE_STAT_EJECT        UINT32_C(0x1a)
2388         /*
2389          * VEE Flush Completion:
2390          * This completion is inserted manually by
2391          * the Primate and processed by the VEE hardware to ensure that
2392          * all completions on a VEE function have been processed by the
2393          * VEE hardware before FLR process is completed.
2394          */
2395         #define CMPL_BASE_TYPE_VEE_FLUSH         UINT32_C(0x1c)
2396         /*
2397          * Mid Path Short Completion :
2398          * Completion of a Mid Path Command. Length = 16B
2399          */
2400         #define CMPL_BASE_TYPE_MID_PATH_SHORT    UINT32_C(0x1e)
2401         /*
2402          * Mid Path Long Completion :
2403          * Completion of a Mid Path Command. Length = 32B
2404          */
2405         #define CMPL_BASE_TYPE_MID_PATH_LONG     UINT32_C(0x1f)
2406         /*
2407          * HWRM Command Completion:
2408          * Completion of an HWRM command.
2409          */
2410         #define CMPL_BASE_TYPE_HWRM_DONE         UINT32_C(0x20)
2411         /* Forwarded HWRM Request */
2412         #define CMPL_BASE_TYPE_HWRM_FWD_REQ      UINT32_C(0x22)
2413         /* Forwarded HWRM Response */
2414         #define CMPL_BASE_TYPE_HWRM_FWD_RESP     UINT32_C(0x24)
2415         /* HWRM Asynchronous Event Information */
2416         #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
2417         /* CQ Notification */
2418         #define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
2419         /* SRQ Threshold Event */
2420         #define CMPL_BASE_TYPE_SRQ_EVENT         UINT32_C(0x32)
2421         /* DBQ Threshold Event */
2422         #define CMPL_BASE_TYPE_DBQ_EVENT         UINT32_C(0x34)
2423         /* QP Async Notification */
2424         #define CMPL_BASE_TYPE_QP_EVENT          UINT32_C(0x38)
2425         /* Function Async Notification */
2426         #define CMPL_BASE_TYPE_FUNC_EVENT        UINT32_C(0x3a)
2427         #define CMPL_BASE_TYPE_LAST             CMPL_BASE_TYPE_FUNC_EVENT
2428         /* info1 is 16 b */
2429         uint16_t        info1;
2430         /* info2 is 32 b */
2431         uint32_t        info2;
2432         /*
2433          * This value is written by the NIC such that it will be different
2434          * for each pass through the completion queue. The even passes
2435          * will write 1. The odd passes will write 0.
2436          */
2437         uint32_t        info3_v;
2438         #define CMPL_BASE_V         UINT32_C(0x1)
2439         #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
2440         #define CMPL_BASE_INFO3_SFT 1
2441         /* info4 is 32 b */
2442         uint32_t        info4;
2443 } __rte_packed;
2444
2445 /* tx_cmpl (size:128b/16B) */
2446 struct tx_cmpl {
2447         uint16_t        flags_type;
2448         /*
2449          * This field indicates the exact type of the completion.
2450          * By convention, the LSB identifies the length of the
2451          * record in 16B units. Even values indicate 16B
2452          * records. Odd values indicate 32B
2453          * records.
2454          */
2455         #define TX_CMPL_TYPE_MASK       UINT32_C(0x3f)
2456         #define TX_CMPL_TYPE_SFT        0
2457         /*
2458          * TX L2 completion:
2459          * Completion of TX packet. Length = 16B
2460          */
2461         #define TX_CMPL_TYPE_TX_L2        UINT32_C(0x0)
2462         #define TX_CMPL_TYPE_LAST        TX_CMPL_TYPE_TX_L2
2463         #define TX_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
2464         #define TX_CMPL_FLAGS_SFT       6
2465         /*
2466          * When this bit is '1', it indicates a packet that has an
2467          * error of some type. Type of error is indicated in
2468          * error_flags.
2469          */
2470         #define TX_CMPL_FLAGS_ERROR      UINT32_C(0x40)
2471         /*
2472          * When this bit is '1', it indicates that the packet completed
2473          * was transmitted using the push acceleration data provided
2474          * by the driver. When this bit is '0', it indicates that the
2475          * packet had not push acceleration data written or was executed
2476          * as a normal packet even though push data was provided.
2477          */
2478         #define TX_CMPL_FLAGS_PUSH       UINT32_C(0x80)
2479         /* unused1 is 16 b */
2480         uint16_t        unused_0;
2481         /*
2482          * This is a copy of the opaque field from the first TX BD of this
2483          * transmitted packet. Note that, if the packet was described by a short
2484          * CSO or short CSO inline BD, then the 16-bit opaque field from the
2485          * short CSO BD will appear in the bottom 16 bits of this field.
2486          */
2487         uint32_t        opaque;
2488         uint16_t        errors_v;
2489         /*
2490          * This value is written by the NIC such that it will be different
2491          * for each pass through the completion queue. The even passes
2492          * will write 1. The odd passes will write 0.
2493          */
2494         #define TX_CMPL_V                                  UINT32_C(0x1)
2495         #define TX_CMPL_ERRORS_MASK                        UINT32_C(0xfffe)
2496         #define TX_CMPL_ERRORS_SFT                         1
2497         /*
2498          * This error indicates that there was some sort of problem
2499          * with the BDs for the packet.
2500          */
2501         #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
2502         #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT             1
2503         /* No error */
2504         #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR \
2505                 (UINT32_C(0x0) << 1)
2506         /*
2507          * Bad Format:
2508          * BDs were not formatted correctly.
2509          */
2510         #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT \
2511                 (UINT32_C(0x2) << 1)
2512         #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
2513                 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
2514         /*
2515          * When this bit is '1', it indicates that the length of
2516          * the packet was zero. No packet was transmitted.
2517          */
2518         #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
2519         /*
2520          * When this bit is '1', it indicates that the packet
2521          * was longer than the programmed limit in TDI. No
2522          * packet was transmitted.
2523          */
2524         #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
2525         /*
2526          * When this bit is '1', it indicates that one or more of the
2527          * BDs associated with this packet generated a PCI error.
2528          * This probably means the address was not valid.
2529          */
2530         #define TX_CMPL_ERRORS_DMA_ERROR                    UINT32_C(0x40)
2531         /*
2532          * When this bit is '1', it indicates that the packet was longer
2533          * than indicated by the hint. No packet was transmitted.
2534          */
2535         #define TX_CMPL_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
2536         /*
2537          * When this bit is '1', it indicates that the packet was
2538          * dropped due to Poison TLP error on one or more of the
2539          * TLPs in the PXP completion.
2540          */
2541         #define TX_CMPL_ERRORS_POISON_TLP_ERROR             UINT32_C(0x100)
2542         /*
2543          * When this bit is '1', it indicates that the packet was dropped
2544          * due to a transient internal error in TDC. The packet or LSO can
2545          * be retried and may transmit successfully on a subsequent attempt.
2546          */
2547         #define TX_CMPL_ERRORS_INTERNAL_ERROR               UINT32_C(0x200)
2548         /*
2549          * When this bit is '1', it was not possible to collect a a timestamp
2550          * for a PTP completion, in which case the timestamp_hi and
2551          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
2552          * completion, the timestamp_hi and timestamp_lo fields are valid.
2553          * RJRN will copy the value of this bit into the field of the same
2554          * name in all TX completions, regardless of whether such completions
2555          * are PTP completions or other TX completions.
2556          */
2557         #define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR      UINT32_C(0x400)
2558         /* unused2 is 16 b */
2559         uint16_t        unused_1;
2560         /* unused3 is 32 b */
2561         uint32_t        unused_2;
2562 } __rte_packed;
2563
2564 /* tx_cmpl_coal (size:128b/16B) */
2565 struct tx_cmpl_coal {
2566         uint16_t        flags_type;
2567         /*
2568          * This field indicates the exact type of the completion.
2569          * By convention, the LSB identifies the length of the
2570          * record in 16B units. Even values indicate 16B
2571          * records. Odd values indicate 32B
2572          * records.
2573          */
2574         #define TX_CMPL_COAL_TYPE_MASK       UINT32_C(0x3f)
2575         #define TX_CMPL_COAL_TYPE_SFT        0
2576         /*
2577          * TX L2 coalesced completion:
2578          * Completion of TX packet. Length = 16B
2579          */
2580         #define TX_CMPL_COAL_TYPE_TX_L2_COAL   UINT32_C(0x2)
2581         #define TX_CMPL_COAL_TYPE_LAST        TX_CMPL_COAL_TYPE_TX_L2_COAL
2582         #define TX_CMPL_COAL_FLAGS_MASK      UINT32_C(0xffc0)
2583         #define TX_CMPL_COAL_FLAGS_SFT       6
2584         /*
2585          * When this bit is '1', it indicates a packet that has an
2586          * error of some type. Type of error is indicated in
2587          * error_flags.
2588          */
2589         #define TX_CMPL_COAL_FLAGS_ERROR      UINT32_C(0x40)
2590         /*
2591          * When this bit is '1', it indicates that the packet completed
2592          * was transmitted using the push acceleration data provided
2593          * by the driver. When this bit is '0', it indicates that the
2594          * packet had not push acceleration data written or was executed
2595          * as a normal packet even though push data was provided.
2596          */
2597         #define TX_CMPL_COAL_FLAGS_PUSH       UINT32_C(0x80)
2598         /* unused1 is 16 b */
2599         uint16_t        unused_0;
2600         /*
2601          * This is a copy of the opaque field from the first TX BD of the packet
2602          * which corresponds with the reported sq_cons_idx. Note that, with
2603          * coalesced completions, completions are generated for only some of the
2604          * packets. The driver will see the opaque field for only those packets.
2605          * Note that, if the packet was described by a short CSO or short CSO
2606          * inline BD, then the 16-bit opaque field from the short CSO BD will
2607          * appear in the bottom 16 bits of this field. For TX rings with
2608          * completion coalescing enabled (which would use the coalesced
2609          * completion record), it is suggested that the driver populate the
2610          * opaque field to indicate the specific TX ring with which the
2611          * completion is associated, then utilize the opaque and sq_cons_idx
2612          * fields in the coalesced completion record to determine the specific
2613          * packets that are to be completed on that ring.
2614          */
2615         uint32_t        opaque;
2616         uint16_t        errors_v;
2617         /*
2618          * This value is written by the NIC such that it will be different
2619          * for each pass through the completion queue. The even passes
2620          * will write 1. The odd passes will write 0.
2621          */
2622         #define TX_CMPL_COAL_V                                  UINT32_C(0x1)
2623         #define TX_CMPL_COAL_ERRORS_MASK \
2624                 UINT32_C(0xfffe)
2625         #define TX_CMPL_COAL_ERRORS_SFT                         1
2626         /*
2627          * This error indicates that there was some sort of problem
2628          * with the BDs for the packet.
2629          */
2630         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
2631         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT             1
2632         /* No error */
2633         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR \
2634                 (UINT32_C(0x0) << 1)
2635         /*
2636          * Bad Format:
2637          * BDs were not formatted correctly.
2638          */
2639         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT \
2640                 (UINT32_C(0x2) << 1)
2641         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST \
2642                 TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT
2643         /*
2644          * When this bit is '1', it indicates that the length of
2645          * the packet was zero. No packet was transmitted.
2646          */
2647         #define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
2648         /*
2649          * When this bit is '1', it indicates that the packet
2650          * was longer than the programmed limit in TDI. No
2651          * packet was transmitted.
2652          */
2653         #define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
2654         /*
2655          * When this bit is '1', it indicates that one or more of the
2656          * BDs associated with this packet generated a PCI error.
2657          * This probably means the address was not valid.
2658          */
2659         #define TX_CMPL_COAL_ERRORS_DMA_ERROR                    UINT32_C(0x40)
2660         /*
2661          * When this bit is '1', it indicates that the packet was longer
2662          * than indicated by the hint. No packet was transmitted.
2663          */
2664         #define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
2665         /*
2666          * When this bit is '1', it indicates that the packet was
2667          * dropped due to Poison TLP error on one or more of the
2668          * TLPs in the PXP completion.
2669          */
2670         #define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR \
2671                 UINT32_C(0x100)
2672         /*
2673          * When this bit is '1', it indicates that the packet was dropped
2674          * due to a transient internal error in TDC. The packet or LSO can
2675          * be retried and may transmit successfully on a subsequent attempt.
2676          */
2677         #define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR \
2678                 UINT32_C(0x200)
2679         /*
2680          * When this bit is '1', it was not possible to collect a a timestamp
2681          * for a PTP completion, in which case the timestamp_hi and
2682          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
2683          * completion, the timestamp_hi and timestamp_lo fields are valid.
2684          * RJRN will copy the value of this bit into the field of the same
2685          * name in all TX completions, regardless of whether such
2686          * completions are PTP completions or other TX completions.
2687          */
2688         #define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR \
2689                 UINT32_C(0x400)
2690         /* unused2 is 16 b */
2691         uint16_t        unused_1;
2692         uint32_t        sq_cons_idx;
2693         /*
2694          * This value is SQ index for the start of the packet following the
2695          * last completed packet.
2696          */
2697         #define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff)
2698         #define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0
2699 } __rte_packed;
2700
2701 /* tx_cmpl_ptp (size:128b/16B) */
2702 struct tx_cmpl_ptp {
2703         uint16_t        flags_type;
2704         /*
2705          * This field indicates the exact type of the completion.
2706          * By convention, the LSB identifies the length of the
2707          * record in 16B units. Even values indicate 16B
2708          * records. Odd values indicate 32B
2709          * records.
2710          */
2711         #define TX_CMPL_PTP_TYPE_MASK       UINT32_C(0x3f)
2712         #define TX_CMPL_PTP_TYPE_SFT        0
2713         /*
2714          * TX L2 PTP completion:
2715          * Completion of TX packet. Length = 32B
2716          */
2717         #define TX_CMPL_PTP_TYPE_TX_L2_PTP    UINT32_C(0x2)
2718         #define TX_CMPL_PTP_TYPE_LAST        TX_CMPL_PTP_TYPE_TX_L2_PTP
2719         #define TX_CMPL_PTP_FLAGS_MASK      UINT32_C(0xffc0)
2720         #define TX_CMPL_PTP_FLAGS_SFT       6
2721         /*
2722          * When this bit is '1', it indicates a packet that has an
2723          * error of some type. Type of error is indicated in
2724          * error_flags.
2725          */
2726         #define TX_CMPL_PTP_FLAGS_ERROR      UINT32_C(0x40)
2727         /*
2728          * When this bit is '1', it indicates that the packet completed
2729          * was transmitted using the push acceleration data provided
2730          * by the driver. When this bit is '0', it indicates that the
2731          * packet had not push acceleration data written or was executed
2732          * as a normal packet even though push data was provided.
2733          */
2734         #define TX_CMPL_PTP_FLAGS_PUSH       UINT32_C(0x80)
2735         /* unused1 is 16 b */
2736         uint16_t        unused_0;
2737         /*
2738          * This is a copy of the opaque field from the first TX BD of this
2739          * transmitted packet. Note that, if the packet was described by a short
2740          * CSO or short CSO inline BD, then the 16-bit opaque field from the
2741          * short CSO BD will appear in the bottom 16 bits of this field.
2742          */
2743         uint32_t        opaque;
2744         uint16_t        errors_v;
2745         /*
2746          * This value is written by the NIC such that it will be different
2747          * for each pass through the completion queue. The even passes
2748          * will write 1. The odd passes will write 0.
2749          */
2750         #define TX_CMPL_PTP_V                                  UINT32_C(0x1)
2751         #define TX_CMPL_PTP_ERRORS_MASK                        UINT32_C(0xfffe)
2752         #define TX_CMPL_PTP_ERRORS_SFT                         1
2753         /*
2754          * This error indicates that there was some sort of problem
2755          * with the BDs for the packet.
2756          */
2757         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
2758         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_SFT             1
2759         /* No error */
2760         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_NO_ERROR \
2761                 (UINT32_C(0x0) << 1)
2762         /*
2763          * Bad Format:
2764          * BDs were not formatted correctly.
2765          */
2766         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT \
2767                 (UINT32_C(0x2) << 1)
2768         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_LAST \
2769                 TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT
2770         /*
2771          * When this bit is '1', it indicates that the length of
2772          * the packet was zero. No packet was transmitted.
2773          */
2774         #define TX_CMPL_PTP_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
2775         /*
2776          * When this bit is '1', it indicates that the packet
2777          * was longer than the programmed limit in TDI. No
2778          * packet was transmitted.
2779          */
2780         #define TX_CMPL_PTP_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
2781         /*
2782          * When this bit is '1', it indicates that one or more of the
2783          * BDs associated with this packet generated a PCI error.
2784          * This probably means the address was not valid.
2785          */
2786         #define TX_CMPL_PTP_ERRORS_DMA_ERROR                    UINT32_C(0x40)
2787         /*
2788          * When this bit is '1', it indicates that the packet was longer
2789          * than indicated by the hint. No packet was transmitted.
2790          */
2791         #define TX_CMPL_PTP_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
2792         /*
2793          * When this bit is '1', it indicates that the packet was
2794          * dropped due to Poison TLP error on one or more of the
2795          * TLPs in the PXP completion.
2796          */
2797         #define TX_CMPL_PTP_ERRORS_POISON_TLP_ERROR             UINT32_C(0x100)
2798         /*
2799          * When this bit is '1', it indicates that the packet was dropped due
2800          * to a transient internal error in TDC. The packet or LSO can be
2801          * retried and may transmit successfully on a subsequent attempt.
2802          */
2803         #define TX_CMPL_PTP_ERRORS_INTERNAL_ERROR               UINT32_C(0x200)
2804         /*
2805          * When this bit is '1', it was not possible to collect a a timestamp
2806          * for a PTP completion, in which case the timestamp_hi and
2807          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
2808          * completion, the timestamp_hi and timestamp_lo fields are valid.
2809          * RJRN will copy the value of this bit into the field of the same
2810          * name in all TX completions, regardless of whether such
2811          * completions are PTP completions or other TX completions.
2812          */
2813         #define TX_CMPL_PTP_ERRORS_TIMESTAMP_INVALID_ERROR      UINT32_C(0x400)
2814         /* unused2 is 16 b */
2815         uint16_t        unused_1;
2816         /*
2817          * This is timestamp value (lower 32bits) read from PM for the PTP
2818          * timestamp enabled packet.
2819          */
2820         uint32_t        timestamp_lo;
2821 } __rte_packed;
2822
2823 /* tx_cmpl_ptp_hi (size:128b/16B) */
2824 struct tx_cmpl_ptp_hi {
2825         /*
2826          * This is timestamp value (lower 32bits) read from PM for the PTP
2827          * timestamp enabled packet.
2828          */
2829         uint16_t        timestamp_hi[3];
2830         uint16_t        reserved16;
2831         uint64_t        v2;
2832         /*
2833          * This value is written by the NIC such that it will be different for
2834          * each pass through the completion queue.The even passes will write 1.
2835          * The odd passes will write 0
2836          */
2837         #define TX_CMPL_PTP_HI_V2     UINT32_C(0x1)
2838 } __rte_packed;
2839
2840 /* rx_pkt_cmpl (size:128b/16B) */
2841 struct rx_pkt_cmpl {
2842         uint16_t        flags_type;
2843         /*
2844          * This field indicates the exact type of the completion.
2845          * By convention, the LSB identifies the length of the
2846          * record in 16B units. Even values indicate 16B
2847          * records. Odd values indicate 32B
2848          * records.
2849          */
2850         #define RX_PKT_CMPL_TYPE_MASK                   UINT32_C(0x3f)
2851         #define RX_PKT_CMPL_TYPE_SFT                    0
2852         /*
2853          * RX L2 completion:
2854          * Completion of and L2 RX packet. Length = 32B
2855          */
2856         #define RX_PKT_CMPL_TYPE_RX_L2                    UINT32_C(0x11)
2857         #define RX_PKT_CMPL_TYPE_LAST                    RX_PKT_CMPL_TYPE_RX_L2
2858         #define RX_PKT_CMPL_FLAGS_MASK                  UINT32_C(0xffc0)
2859         #define RX_PKT_CMPL_FLAGS_SFT                   6
2860         /*
2861          * When this bit is '1', it indicates a packet that has an
2862          * error of some type. Type of error is indicated in
2863          * error_flags.
2864          */
2865         #define RX_PKT_CMPL_FLAGS_ERROR                  UINT32_C(0x40)
2866         /* This field indicates how the packet was placed in the buffer. */
2867         #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK         UINT32_C(0x380)
2868         #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT          7
2869         /*
2870          * Normal:
2871          * Packet was placed using normal algorithm.
2872          */
2873         #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL         (UINT32_C(0x0) << 7)
2874         /*
2875          * Jumbo:
2876          * Packet was placed using jumbo algorithm.
2877          */
2878         #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO          (UINT32_C(0x1) << 7)
2879         /*
2880          * Header/Data Separation:
2881          * Packet was placed using Header/Data separation algorithm.
2882          * The separation location is indicated by the itype field.
2883          */
2884         #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS            (UINT32_C(0x2) << 7)
2885         #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
2886                 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
2887         /* This bit is '1' if the RSS field in this completion is valid. */
2888         #define RX_PKT_CMPL_FLAGS_RSS_VALID              UINT32_C(0x400)
2889         /* unused is 1 b */
2890         #define RX_PKT_CMPL_FLAGS_UNUSED                 UINT32_C(0x800)
2891         /*
2892          * This value indicates what the inner packet determined for the
2893          * packet was.
2894          */
2895         #define RX_PKT_CMPL_FLAGS_ITYPE_MASK             UINT32_C(0xf000)
2896         #define RX_PKT_CMPL_FLAGS_ITYPE_SFT              12
2897         /*
2898          * Not Known:
2899          * Indicates that the packet type was not known.
2900          */
2901         #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \
2902                 (UINT32_C(0x0) << 12)
2903         /*
2904          * IP Packet:
2905          * Indicates that the packet was an IP packet, but further
2906          * classification was not possible.
2907          */
2908         #define RX_PKT_CMPL_FLAGS_ITYPE_IP \
2909                 (UINT32_C(0x1) << 12)
2910         /*
2911          * TCP Packet:
2912          * Indicates that the packet was IP and TCP.
2913          * This indicates that the payload_offset field is valid.
2914          */
2915         #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \
2916                 (UINT32_C(0x2) << 12)
2917         /*
2918          * UDP Packet:
2919          * Indicates that the packet was IP and UDP.
2920          * This indicates that the payload_offset field is valid.
2921          */
2922         #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \
2923                 (UINT32_C(0x3) << 12)
2924         /*
2925          * FCoE Packet:
2926          * Indicates that the packet was recognized as a FCoE.
2927          * This also indicates that the payload_offset field is valid.
2928          */
2929         #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \
2930                 (UINT32_C(0x4) << 12)
2931         /*
2932          * RoCE Packet:
2933          * Indicates that the packet was recognized as a RoCE.
2934          * This also indicates that the payload_offset field is valid.
2935          */
2936         #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \
2937                 (UINT32_C(0x5) << 12)
2938         /*
2939          * ICMP Packet:
2940          * Indicates that the packet was recognized as ICMP.
2941          * This indicates that the payload_offset field is valid.
2942          */
2943         #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \
2944                 (UINT32_C(0x7) << 12)
2945         /*
2946          * PtP packet wo/timestamp:
2947          * Indicates that the packet was recognized as a PtP
2948          * packet.
2949          */
2950         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
2951                 (UINT32_C(0x8) << 12)
2952         /*
2953          * PtP packet w/timestamp:
2954          * Indicates that the packet was recognized as a PtP
2955          * packet and that a timestamp was taken for the packet.
2956          */
2957         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
2958                 (UINT32_C(0x9) << 12)
2959         #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
2960                 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
2961         /*
2962          * This is the length of the data for the packet stored in the
2963          * buffer(s) identified by the opaque value. This includes
2964          * the packet BD and any associated buffer BDs. This does not include
2965          * the length of any data places in aggregation BDs.
2966          */
2967         uint16_t        len;
2968         /*
2969          * This is a copy of the opaque field from the RX BD this completion
2970          * corresponds to.
2971          */
2972         uint32_t        opaque;
2973         uint8_t agg_bufs_v1;
2974         /*
2975          * This value is written by the NIC such that it will be different
2976          * for each pass through the completion queue. The even passes
2977          * will write 1. The odd passes will write 0.
2978          */
2979         #define RX_PKT_CMPL_V1           UINT32_C(0x1)
2980         /*
2981          * This value is the number of aggregation buffers that follow this
2982          * entry in the completion ring that are a part of this packet.
2983          * If the value is zero, then the packet is completely contained
2984          * in the buffer space provided for the packet in the RX ring.
2985          */
2986         #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
2987         #define RX_PKT_CMPL_AGG_BUFS_SFT 1
2988         /* unused1 is 2 b */
2989         #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
2990         #define RX_PKT_CMPL_UNUSED1_SFT  6
2991         /*
2992          * This is the RSS hash type for the packet. The value is packed
2993          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
2994          *
2995          * The value of tuple_extrac_op provides the information about
2996          * what fields the hash was computed on.
2997          * * 0: The RSS hash was computed over source IP address,
2998          * destination IP address, source port, and destination port of inner
2999          * IP and TCP or UDP headers. Note: For non-tunneled packets,
3000          * the packet headers are considered inner packet headers for the RSS
3001          * hash computation purpose.
3002          * * 1: The RSS hash was computed over source IP address and destination
3003          * IP address of inner IP header. Note: For non-tunneled packets,
3004          * the packet headers are considered inner packet headers for the RSS
3005          * hash computation purpose.
3006          * * 2: The RSS hash was computed over source IP address,
3007          * destination IP address, source port, and destination port of
3008          * IP and TCP or UDP headers of outer tunnel headers.
3009          * Note: For non-tunneled packets, this value is not applicable.
3010          * * 3: The RSS hash was computed over source IP address and
3011          * destination IP address of IP header of outer tunnel headers.
3012          * Note: For non-tunneled packets, this value is not applicable.
3013          *
3014          * Note that 4-tuples values listed above are applicable
3015          * for layer 4 protocols supported and enabled for RSS in the hardware,
3016          * HWRM firmware, and drivers. For example, if RSS hash is supported and
3017          * enabled for TCP traffic only, then the values of tuple_extract_op
3018          * corresponding to 4-tuples are only valid for TCP traffic.
3019          */
3020         uint8_t rss_hash_type;
3021         /*
3022          * This value indicates the offset in bytes from the beginning of the packet
3023          * where the inner payload starts. This value is valid for TCP, UDP,
3024          * FCoE, and RoCE packets.
3025          *
3026          * A value of zero indicates that header is 256B into the packet.
3027          */
3028         uint8_t payload_offset;
3029         /* unused2 is 8 b */
3030         uint8_t unused1;
3031         /*
3032          * This value is the RSS hash value calculated for the packet
3033          * based on the mode bits and key value in the VNIC.
3034          */
3035         uint32_t        rss_hash;
3036 } __rte_packed;
3037
3038 /* Last 16 bytes of rx_pkt_cmpl. */
3039 /* rx_pkt_cmpl_hi (size:128b/16B) */
3040 struct rx_pkt_cmpl_hi {
3041         uint32_t        flags2;
3042         /*
3043          * This indicates that the ip checksum was calculated for the
3044          * inner packet and that the ip_cs_error field indicates if there
3045          * was an error.
3046          */
3047         #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC                 UINT32_C(0x1)
3048         /*
3049          * This indicates that the TCP, UDP or ICMP checksum was
3050          * calculated for the inner packet and that the l4_cs_error field
3051          * indicates if there was an error.
3052          */
3053         #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC                 UINT32_C(0x2)
3054         /*
3055          * This indicates that the ip checksum was calculated for the
3056          * tunnel header and that the t_ip_cs_error field indicates if there
3057          * was an error.
3058          */
3059         #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC               UINT32_C(0x4)
3060         /*
3061          * This indicates that the UDP checksum was
3062          * calculated for the tunnel packet and that the t_l4_cs_error field
3063          * indicates if there was an error.
3064          */
3065         #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC               UINT32_C(0x8)
3066         /* This value indicates what format the metadata field is. */
3067         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK           UINT32_C(0xf0)
3068         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT            4
3069         /* No metadata information. Value is zero. */
3070         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE \
3071                 (UINT32_C(0x0) << 4)
3072         /*
3073          * The metadata field contains the VLAN tag and TPID value.
3074          * - metadata[11:0] contains the vlan VID value.
3075          * - metadata[12] contains the vlan DE value.
3076          * - metadata[15:13] contains the vlan PRI value.
3077          * - metadata[31:16] contains the vlan TPID value.
3078          */
3079         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN \
3080                 (UINT32_C(0x1) << 4)
3081         /*
3082          * If ext_meta_format is equal to 1, the metadata field
3083          * contains the lower 16b of the tunnel ID value, justified
3084          * to LSB
3085          * - VXLAN = VNI[23:0] -> VXLAN Network ID
3086          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
3087          * - NVGRE = TNI[23:0] -> Tenant Network ID
3088          * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
3089          * - IPV4 = 0 (not populated)
3090          * - IPV6 = Flow Label[19:0]
3091          * - PPPoE = sessionID[15:0]
3092          * - MPLs = Outer label[19:0]
3093          * - UPAR = Selected[31:0] with bit mask
3094          */
3095         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
3096                 (UINT32_C(0x2) << 4)
3097         /*
3098          * if ext_meta_format is equal to 1, metadata field contains
3099          * 16b metadata from the prepended header (chdr_data).
3100          */
3101         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
3102                 (UINT32_C(0x3) << 4)
3103         /*
3104          * If ext_meta_format is equal to 1, the metadata field contains
3105          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
3106          * inner_l4_size.
3107          * - metadata[8:0] contains the outer_l3_offset.
3108          * - metadata[17:9] contains the inner_l2_offset.
3109          * - metadata[26:18] contains the inner_l3_offset.
3110          * - metadata[31:27] contains the inner_l4_size.
3111          */
3112         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
3113                 (UINT32_C(0x4) << 4)
3114         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
3115                 RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
3116         /*
3117          * This field indicates the IP type for the inner-most IP header.
3118          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
3119          * This value is only valid if itype indicates a packet
3120          * with an IP header.
3121          */
3122         #define RX_PKT_CMPL_FLAGS2_IP_TYPE                    UINT32_C(0x100)
3123         /*
3124          * This indicates that the complete 1's complement checksum was
3125          * calculated for the packet.
3126          */
3127         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC     UINT32_C(0x200)
3128         /*
3129          * The combination of this value and meta_format indicated what
3130          * format the metadata field is.
3131          */
3132         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK       UINT32_C(0xc00)
3133         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
3134         /*
3135          * This value is the complete 1's complement checksum calculated from
3136          * the start of the outer L3 header to the end of the packet (not
3137          * including the ethernet crc). It is valid when the
3138          * 'complete_checksum_calc' flag is set.
3139          */
3140         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
3141                 UINT32_C(0xffff0000)
3142         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
3143         /*
3144          * This is data from the CFA block as indicated by the meta_format
3145          * field.
3146          */
3147         uint32_t        metadata;
3148         /* When meta_format=1, this value is the VLAN VID. */
3149         #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
3150         #define RX_PKT_CMPL_METADATA_VID_SFT  0
3151         /* When meta_format=1, this value is the VLAN DE. */
3152         #define RX_PKT_CMPL_METADATA_DE       UINT32_C(0x1000)
3153         /* When meta_format=1, this value is the VLAN PRI. */
3154         #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
3155         #define RX_PKT_CMPL_METADATA_PRI_SFT  13
3156         /* When meta_format=1, this value is the VLAN TPID. */
3157         #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
3158         #define RX_PKT_CMPL_METADATA_TPID_SFT 16
3159         uint16_t        errors_v2;
3160         /*
3161          * This value is written by the NIC such that it will be different
3162          * for each pass through the completion queue. The even passes
3163          * will write 1. The odd passes will write 0.
3164          */
3165         #define RX_PKT_CMPL_V2 \
3166                 UINT32_C(0x1)
3167         #define RX_PKT_CMPL_ERRORS_MASK \
3168                 UINT32_C(0xfffe)
3169         #define RX_PKT_CMPL_ERRORS_SFT                               1
3170         /*
3171          * This error indicates that there was some sort of problem with
3172          * the BDs for the packet that was found after part of the
3173          * packet was already placed. The packet should be treated as
3174          * invalid.
3175          */
3176         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \
3177                 UINT32_C(0xe)
3178         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT                   1
3179         /* No buffer error */
3180         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
3181                 (UINT32_C(0x0) << 1)
3182         /*
3183          * Did Not Fit:
3184          * Packet did not fit into packet buffer provided.
3185          * For regular placement, this means the packet did not fit
3186          * in the buffer provided. For HDS and jumbo placement, this
3187          * means that the packet could not be placed into 7 physical
3188          * buffers or less.
3189          */
3190         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
3191                 (UINT32_C(0x1) << 1)
3192         /*
3193          * Not On Chip:
3194          * All BDs needed for the packet were not on-chip when
3195          * the packet arrived.
3196          */
3197         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
3198                 (UINT32_C(0x2) << 1)
3199         /*
3200          * Bad Format:
3201          * BDs were not formatted correctly.
3202          */
3203         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
3204                 (UINT32_C(0x3) << 1)
3205         /*
3206          * Flush:
3207          * There was a bad_format error on the previous operation
3208          */
3209         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
3210                 (UINT32_C(0x5) << 1)
3211         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
3212                 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
3213         /*
3214          * This indicates that there was an error in the IP header
3215          * checksum.
3216          */
3217         #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \
3218                 UINT32_C(0x10)
3219         /*
3220          * This indicates that there was an error in the TCP, UDP
3221          * or ICMP checksum.
3222          */
3223         #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \
3224                 UINT32_C(0x20)
3225         /*
3226          * This indicates that there was an error in the tunnel
3227          * IP header checksum.
3228          */
3229         #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \
3230                 UINT32_C(0x40)
3231         /*
3232          * This indicates that there was an error in the tunnel
3233          * UDP checksum.
3234          */
3235         #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \
3236                 UINT32_C(0x80)
3237         /*
3238          * This indicates that there was a CRC error on either an FCoE
3239          * or RoCE packet. The itype indicates the packet type.
3240          */
3241         #define RX_PKT_CMPL_ERRORS_CRC_ERROR \
3242                 UINT32_C(0x100)
3243         /*
3244          * This indicates that there was an error in the tunnel
3245          * portion of the packet when this
3246          * field is non-zero.
3247          */
3248         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \
3249                 UINT32_C(0xe00)
3250         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT                    9
3251         /*
3252          * No additional error occurred on the tunnel portion
3253          * or the packet of the packet does not have a tunnel.
3254          */
3255         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \
3256                 (UINT32_C(0x0) << 9)
3257         /*
3258          * Indicates that IP header version does not match
3259          * expectation from L2 Ethertype for IPv4 and IPv6
3260          * in the tunnel header.
3261          */
3262         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
3263                 (UINT32_C(0x1) << 9)
3264         /*
3265          * Indicates that header length is out of range in the
3266          * tunnel header. Valid for
3267          * IPv4.
3268          */
3269         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
3270                 (UINT32_C(0x2) << 9)
3271         /*
3272          * Indicates that the physical packet is shorter than that
3273          * claimed by the PPPoE header length for a tunnel PPPoE
3274          * packet.
3275          */
3276         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
3277                 (UINT32_C(0x3) << 9)
3278         /*
3279          * Indicates that physical packet is shorter than that claimed
3280          * by the tunnel l3 header length. Valid for IPv4, or IPv6
3281          * tunnel packet packets.
3282          */
3283         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
3284                 (UINT32_C(0x4) << 9)
3285         /*
3286          * Indicates that the physical packet is shorter than that
3287          * claimed by the tunnel UDP header length for a tunnel
3288          * UDP packet that is not fragmented.
3289          */
3290         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
3291                 (UINT32_C(0x5) << 9)
3292         /*
3293          * indicates that the IPv4 TTL or IPv6 hop limit check
3294          * have failed (e.g. TTL = 0) in the tunnel header. Valid
3295          * for IPv4, and IPv6.
3296          */
3297         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
3298                 (UINT32_C(0x6) << 9)
3299         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
3300                 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
3301         /*
3302          * This indicates that there was an error in the inner
3303          * portion of the packet when this
3304          * field is non-zero.
3305          */
3306         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \
3307                 UINT32_C(0xf000)
3308         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT                      12
3309         /*
3310          * No additional error occurred on the tunnel portion
3311          * or the packet of the packet does not have a tunnel.
3312          */
3313         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \
3314                 (UINT32_C(0x0) << 12)
3315         /*
3316          * Indicates that IP header version does not match
3317          * expectation from L2 Ethertype for IPv4 and IPv6 or that
3318          * option other than VFT was parsed on
3319          * FCoE packet.
3320          */
3321         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
3322                 (UINT32_C(0x1) << 12)
3323         /*
3324          * indicates that header length is out of range. Valid for
3325          * IPv4 and RoCE
3326          */
3327         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
3328                 (UINT32_C(0x2) << 12)
3329         /*
3330          * indicates that the IPv4 TTL or IPv6 hop limit check
3331          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
3332          */
3333         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \
3334                 (UINT32_C(0x3) << 12)
3335         /*
3336          * Indicates that physical packet is shorter than that
3337          * claimed by the l3 header length. Valid for IPv4,
3338          * IPv6 packet or RoCE packets.
3339          */
3340         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
3341                 (UINT32_C(0x4) << 12)
3342         /*
3343          * Indicates that the physical packet is shorter than that
3344          * claimed by the UDP header length for a UDP packet that is
3345          * not fragmented.
3346          */
3347         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
3348                 (UINT32_C(0x5) << 12)
3349         /*
3350          * Indicates that TCP header length > IP payload. Valid for
3351          * TCP packets only.
3352          */
3353         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
3354                 (UINT32_C(0x6) << 12)
3355         /* Indicates that TCP header length < 5. Valid for TCP. */
3356         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
3357                 (UINT32_C(0x7) << 12)
3358         /*
3359          * Indicates that TCP option headers result in a TCP header
3360          * size that does not match data offset in TCP header. Valid
3361          * for TCP.
3362          */
3363         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
3364                 (UINT32_C(0x8) << 12)
3365         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
3366                 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
3367         /*
3368          * This field identifies the CFA action rule that was used for this
3369          * packet.
3370          */
3371         uint16_t        cfa_code;
3372         uint32_t        reorder;
3373         /*
3374          * This value holds the reordering sequence number for the packet.
3375          * If the reordering sequence is not valid, then this value is zero.
3376          * The reordering domain for the packet is in the bottom 8 to 10b of
3377          * the rss_hash value. The bottom 20b of this value contain the
3378          * ordering domain value for the packet.
3379          */
3380         #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
3381         #define RX_PKT_CMPL_REORDER_SFT 0
3382 } __rte_packed;
3383
3384 /* rx_pkt_v2_cmpl (size:128b/16B) */
3385 struct rx_pkt_v2_cmpl {
3386         uint16_t        flags_type;
3387         /*
3388          * This field indicates the exact type of the completion.
3389          * By convention, the LSB identifies the length of the
3390          * record in 16B units. Even values indicate 16B
3391          * records. Odd values indicate 32B
3392          * records.
3393          */
3394         #define RX_PKT_V2_CMPL_TYPE_MASK                      UINT32_C(0x3f)
3395         #define RX_PKT_V2_CMPL_TYPE_SFT                       0
3396         /*
3397          * RX L2 V2 completion:
3398          * Completion of and L2 RX packet. Length = 32B
3399          * This is the new version of the RX_L2 completion used in SR2
3400          * and later chips.
3401          */
3402         #define RX_PKT_V2_CMPL_TYPE_RX_L2_V2                    UINT32_C(0xf)
3403         #define RX_PKT_V2_CMPL_TYPE_LAST \
3404                 RX_PKT_V2_CMPL_TYPE_RX_L2_V2
3405         #define RX_PKT_V2_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
3406         #define RX_PKT_V2_CMPL_FLAGS_SFT                      6
3407         /*
3408          * When this bit is '1', it indicates a packet that has an
3409          * error of some type. Type of error is indicated in
3410          * error_flags.
3411          */
3412         #define RX_PKT_V2_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
3413         /* This field indicates how the packet was placed in the buffer. */
3414         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
3415         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT             7
3416         /*
3417          * Normal:
3418          * Packet was placed using normal algorithm.
3419          */
3420         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL \
3421                 (UINT32_C(0x0) << 7)
3422         /*
3423          * Jumbo:
3424          * Packet was placed using jumbo algorithm.
3425          */
3426         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO \
3427                 (UINT32_C(0x1) << 7)
3428         /*
3429          * Header/Data Separation:
3430          * Packet was placed using Header/Data separation algorithm.
3431          * The separation location is indicated by the itype field.
3432          */
3433         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS \
3434                 (UINT32_C(0x2) << 7)
3435         /*
3436          * Truncation:
3437          * Packet was placed using truncation algorithm. The
3438          * placed (truncated) length is indicated in the payload_offset
3439          * field. The original length is indicated in the len field.
3440          */
3441         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION \
3442                 (UINT32_C(0x3) << 7)
3443         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST \
3444                 RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION
3445         /* This bit is '1' if the RSS field in this completion is valid. */
3446         #define RX_PKT_V2_CMPL_FLAGS_RSS_VALID                 UINT32_C(0x400)
3447         /*
3448          * This bit is '1' if metadata has been added to the end of the
3449          * packet in host memory. Metadata starts at the first 32B boundary
3450          * after the end of the packet for regular and jumbo placement.
3451          * It starts at the first 32B boundary after the end of the header
3452          * for HDS placement. The length of the metadata is indicated in the
3453          * metadata itself.
3454          */
3455         #define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
3456         /*
3457          * This value indicates what the inner packet determined for the
3458          * packet was.
3459          */
3460         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK                UINT32_C(0xf000)
3461         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT                 12
3462         /*
3463          * Not Known:
3464          * Indicates that the packet type was not known.
3465          */
3466         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN \
3467                 (UINT32_C(0x0) << 12)
3468         /*
3469          * IP Packet:
3470          * Indicates that the packet was an IP packet, but further
3471          * classification was not possible.
3472          */
3473         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP \
3474                 (UINT32_C(0x1) << 12)
3475         /*
3476          * TCP Packet:
3477          * Indicates that the packet was IP and TCP.
3478          * This indicates that the payload_offset field is valid.
3479          */
3480         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP \
3481                 (UINT32_C(0x2) << 12)
3482         /*
3483          * UDP Packet:
3484          * Indicates that the packet was IP and UDP.
3485          * This indicates that the payload_offset field is valid.
3486          */
3487         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP \
3488                 (UINT32_C(0x3) << 12)
3489         /*
3490          * FCoE Packet:
3491          * Indicates that the packet was recognized as a FCoE.
3492          * This also indicates that the payload_offset field is valid.
3493          */
3494         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE \
3495                 (UINT32_C(0x4) << 12)
3496         /*
3497          * RoCE Packet:
3498          * Indicates that the packet was recognized as a RoCE.
3499          * This also indicates that the payload_offset field is valid.
3500          */
3501         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE \
3502                 (UINT32_C(0x5) << 12)
3503         /*
3504          * ICMP Packet:
3505          * Indicates that the packet was recognized as ICMP.
3506          * This indicates that the payload_offset field is valid.
3507          */
3508         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP \
3509                 (UINT32_C(0x7) << 12)
3510         /*
3511          * PtP packet wo/timestamp:
3512          * Indicates that the packet was recognized as a PtP
3513          * packet.
3514          */
3515         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
3516                 (UINT32_C(0x8) << 12)
3517         /*
3518          * PtP packet w/timestamp:
3519          * Indicates that the packet was recognized as a PtP
3520          * packet and that a timestamp was taken for the packet.
3521          */
3522         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
3523                 (UINT32_C(0x9) << 12)
3524         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST \
3525                 RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
3526         /*
3527          * This is the length of the data for the packet stored in the
3528          * buffer(s) identified by the opaque value. This includes
3529          * the packet BD and any associated buffer BDs. This does not include
3530          * the length of any data places in aggregation BDs.
3531          */
3532         uint16_t        len;
3533         /*
3534          * This is a copy of the opaque field from the RX BD this completion
3535          * corresponds to.
3536          */
3537         uint32_t        opaque;
3538         uint8_t agg_bufs_v1;
3539         /*
3540          * This value is written by the NIC such that it will be different
3541          * for each pass through the completion queue. The even passes
3542          * will write 1. The odd passes will write 0.
3543          */
3544         #define RX_PKT_V2_CMPL_V1           UINT32_C(0x1)
3545         /*
3546          * This value is the number of aggregation buffers that follow this
3547          * entry in the completion ring that are a part of this packet.
3548          * If the value is zero, then the packet is completely contained
3549          * in the buffer space provided for the packet in the RX ring.
3550          */
3551         #define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
3552         #define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1
3553         /* unused1 is 2 b */
3554         #define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0)
3555         #define RX_PKT_V2_CMPL_UNUSED1_SFT  6
3556         /*
3557          * This is the RSS hash type for the packet. The value is packed
3558          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
3559          *
3560          * The value of tuple_extrac_op provides the information about
3561          * what fields the hash was computed on.
3562          * * 0: The RSS hash was computed over source IP address,
3563          * destination IP address, source port, and destination port of inner
3564          * IP and TCP or UDP headers. Note: For non-tunneled packets,
3565          * the packet headers are considered inner packet headers for the RSS
3566          * hash computation purpose.
3567          * * 1: The RSS hash was computed over source IP address and destination
3568          * IP address of inner IP header. Note: For non-tunneled packets,
3569          * the packet headers are considered inner packet headers for the RSS
3570          * hash computation purpose.
3571          * * 2: The RSS hash was computed over source IP address,
3572          * destination IP address, source port, and destination port of
3573          * IP and TCP or UDP headers of outer tunnel headers.
3574          * Note: For non-tunneled packets, this value is not applicable.
3575          * * 3: The RSS hash was computed over source IP address and
3576          * destination IP address of IP header of outer tunnel headers.
3577          * Note: For non-tunneled packets, this value is not applicable.
3578          *
3579          * Note that 4-tuples values listed above are applicable
3580          * for layer 4 protocols supported and enabled for RSS in the hardware,
3581          * HWRM firmware, and drivers. For example, if RSS hash is supported and
3582          * enabled for TCP traffic only, then the values of tuple_extract_op
3583          * corresponding to 4-tuples are only valid for TCP traffic.
3584          */
3585         uint8_t rss_hash_type;
3586         uint16_t        metadata1_payload_offset;
3587         /*
3588          * This is data from the CFA as indicated by the meta_format field.
3589          * If truncation placement is not used, this value indicates the offset
3590          * in bytes from the beginning of the packet where the inner payload
3591          * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If
3592          * truncation placement is used, this value represents the placed
3593          * (truncated) length of the packet.
3594          */
3595         #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK        UINT32_C(0x1ff)
3596         #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT         0
3597         /* This is data from the CFA as indicated by the meta_format field. */
3598         #define RX_PKT_V2_CMPL_METADATA1_MASK             UINT32_C(0xf000)
3599         #define RX_PKT_V2_CMPL_METADATA1_SFT              12
3600         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
3601         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK     UINT32_C(0x7000)
3602         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT      12
3603         /* 0x88a8 */
3604         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 \
3605                 (UINT32_C(0x0) << 12)
3606         /* 0x8100 */
3607         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID8100 \
3608                 (UINT32_C(0x1) << 12)
3609         /* 0x9100 */
3610         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9100 \
3611                 (UINT32_C(0x2) << 12)
3612         /* 0x9200 */
3613         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9200 \
3614                 (UINT32_C(0x3) << 12)
3615         /* 0x9300 */
3616         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9300 \
3617                 (UINT32_C(0x4) << 12)
3618         /* Value programmed in CFA VLANTPID register. */
3619         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG \
3620                 (UINT32_C(0x5) << 12)
3621         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_LAST \
3622                 RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
3623         /* When meta_format != 0, this value is the VLAN valid. */
3624         #define RX_PKT_V2_CMPL_METADATA1_VALID             UINT32_C(0x8000)
3625         /*
3626          * This value is the RSS hash value calculated for the packet
3627          * based on the mode bits and key value in the VNIC. When vee_cmpl_mode
3628          * is set in VNIC context, this is the lower 32b of the host address
3629          * from the first BD used to place the packet.
3630          */
3631         uint32_t        rss_hash;
3632 } __rte_packed;
3633
3634 /* Last 16 bytes of RX Packet V2 Completion Record */
3635 /* rx_pkt_v2_cmpl_hi (size:128b/16B) */
3636 struct rx_pkt_v2_cmpl_hi {
3637         uint32_t        flags2;
3638         /*
3639          * When this bit is '0', the cs_ok field has the following definition:-
3640          * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
3641          * in the delivered packet, counted from the outer-most header group to
3642          * the inner-most header group, stopping at the first error. -
3643          * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
3644          * in the delivered packet, counted from the outer-most header group to
3645          * the inner-most header group, stopping at the first error. When this
3646          * bit is '1', the cs_ok field has the following definition: -
3647          * hdr_cnt[2:0] = The number of header groups that were parsed by the
3648          * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
3649          * will be '1' if all the parsed header groups with an IP checksum are
3650          * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
3651          * header groups with an L4 checksum are valid.
3652          */
3653         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE \
3654                 UINT32_C(0x8)
3655         /* This value indicates what format the metadata field is. */
3656         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK \
3657                 UINT32_C(0xf0)
3658         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT            4
3659         /* There is no metadata information. Values are zero. */
3660         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE \
3661                 (UINT32_C(0x0) << 4)
3662         /*
3663          * The {metadata1, metadata0} fields contain the vtag
3664          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
3665          * de, vid[11:0]} The metadata2 field contains the table scope
3666          * and action record pointer. - metadata2[25:0] contains the
3667          * action record pointer. - metadata2[31:26] contains the table
3668          * scope.
3669          */
3670         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR \
3671                 (UINT32_C(0x1) << 4)
3672         /*
3673          * The {metadata1, metadata0} fields contain the vtag
3674          * information:
3675          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
3676          * The metadata2 field contains the Tunnel ID
3677          * value, justified to LSB. i
3678          * - VXLAN = VNI[23:0] -> VXLAN Network ID
3679          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
3680          * - NVGRE = TNI[23:0] -> Tenant Network ID
3681          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
3682          * - IPv4 = 0 (not populated)
3683          * - IPv6 = Flow Label[19:0]
3684          * - PPPoE = sessionID[15:0]
3685          * - MPLs = Outer label[19:0]
3686          * - UPAR = Selected[31:0] with bit mask
3687          */
3688         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID \
3689                 (UINT32_C(0x2) << 4)
3690         /*
3691          * The {metadata1, metadata0} fields contain the vtag
3692          * information:
3693          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
3694          * The metadata2 field contains the 32b metadata from the prepended
3695          * header (chdr_data).
3696          */
3697         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA \
3698                 (UINT32_C(0x3) << 4)
3699         /*
3700          * The {metadata1, metadata0} fields contain the vtag
3701          * information:
3702          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
3703          * The metadata2 field contains the outer_l3_offset,
3704          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
3705          * - metadata2[8:0] contains the outer_l3_offset.
3706          * - metadata2[17:9] contains the inner_l2_offset.
3707          * - metadata2[26:18] contains the inner_l3_offset.
3708          * - metadata2[31:27] contains the inner_l4_size.
3709          */
3710         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET \
3711                 (UINT32_C(0x4) << 4)
3712         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST \
3713                 RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
3714         /*
3715          * This field indicates the IP type for the inner-most IP header.
3716          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
3717          * This value is only valid if itype indicates a packet
3718          * with an IP header.
3719          */
3720         #define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE \
3721                 UINT32_C(0x100)
3722         /*
3723          * This indicates that the complete 1's complement checksum was
3724          * calculated for the packet.
3725          */
3726         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC \
3727                 UINT32_C(0x200)
3728         /*
3729          * This field indicates the status of IP and L4 CS calculations done
3730          * by the chip. The format of this field is indicated by the
3731          * cs_all_ok_mode bit.
3732          */
3733         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK \
3734                 UINT32_C(0xfc00)
3735         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT                  10
3736         /*
3737          * This value is the complete 1's complement checksum calculated from
3738          * the start of the outer L3 header to the end of the packet (not
3739          * including the ethernet crc). It is valid when the
3740          * 'complete_checksum_calc' flag is set.
3741          */
3742         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK \
3743                 UINT32_C(0xffff0000)
3744         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT      16
3745         /*
3746          * This is data from the CFA block as indicated by the meta_format
3747          * field.
3748          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
3749          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
3750          *   act_rec_ptr[25:0]}
3751          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
3752          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
3753          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
3754          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
3755          * of the host address from the first BD used to place the packet.
3756          */
3757         uint32_t        metadata2;
3758         uint16_t        errors_v2;
3759         /*
3760          * This value is written by the NIC such that it will be different
3761          * for each pass through the completion queue. The even passes
3762          * will write 1. The odd passes will write 0.
3763          */
3764         #define RX_PKT_V2_CMPL_HI_V2 \
3765                 UINT32_C(0x1)
3766         #define RX_PKT_V2_CMPL_HI_ERRORS_MASK \
3767                 UINT32_C(0xfffe)
3768         #define RX_PKT_V2_CMPL_HI_ERRORS_SFT                               1
3769         /*
3770          * This error indicates that there was some sort of problem with
3771          * the BDs for the packet that was found after part of the
3772          * packet was already placed. The packet should be treated as
3773          * invalid.
3774          */
3775         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK \
3776                 UINT32_C(0xe)
3777         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT                   1
3778         /* No buffer error */
3779         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER \
3780                 (UINT32_C(0x0) << 1)
3781         /*
3782          * Did Not Fit: Packet did not fit into packet buffer provided.
3783          * For regular placement, this means the packet did not fit in
3784          * the buffer provided. For HDS and jumbo placement, this means
3785          * that the packet could not be placed into 8 physical buffers
3786          * (if fixed-size buffers are used), or that the packet could
3787          * not be placed in the number of physical buffers configured
3788          * for the VNIC (if variable-size buffers are used)
3789          */
3790         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
3791                 (UINT32_C(0x1) << 1)
3792         /*
3793          * Not On Chip: All BDs needed for the packet were not on-chip
3794          * when the packet arrived. For regular placement, this error is
3795          * not valid. For HDS and jumbo placement, this means that not
3796          * enough agg BDs were posted to place the packet.
3797          */
3798         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
3799                 (UINT32_C(0x2) << 1)
3800         /*
3801          * Bad Format:
3802          * BDs were not formatted correctly.
3803          */
3804         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT \
3805                 (UINT32_C(0x3) << 1)
3806         /*
3807          * Flush:
3808          * There was a bad_format error on the previous operation
3809          */
3810         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH \
3811                 (UINT32_C(0x5) << 1)
3812         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST \
3813                 RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
3814         /*
3815          * This indicates that there was an error in the outer tunnel
3816          * portion of the packet when this field is non-zero.
3817          */
3818         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK \
3819                 UINT32_C(0x70)
3820         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT                   4
3821         /*
3822          * No additional error occurred on the outer tunnel portion
3823          * of the packet or the packet does not have a outer tunnel.
3824          */
3825         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR \
3826                 (UINT32_C(0x0) << 4)
3827         /*
3828          * Indicates that IP header version does not match expectation
3829          * from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header.
3830          */
3831         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION \
3832                 (UINT32_C(0x1) << 4)
3833         /*
3834          * Indicates that header length is out of range in the outer
3835          * tunnel header. Valid for IPv4.
3836          */
3837         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN \
3838                 (UINT32_C(0x2) << 4)
3839         /*
3840          * Indicates that physical packet is shorter than that claimed
3841          * by the outer tunnel l3 header length. Valid for IPv4, or
3842          * IPv6 outer tunnel packets.
3843          */
3844         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR \
3845                 (UINT32_C(0x3) << 4)
3846         /*
3847          * Indicates that the physical packet is shorter than that
3848          * claimed by the outer tunnel UDP header length for a outer
3849          * tunnel UDP packet that is not fragmented.
3850          */
3851         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR \
3852                 (UINT32_C(0x4) << 4)
3853         /*
3854          * Indicates that the IPv4 TTL or IPv6 hop limit check have
3855          * failed (e.g. TTL = 0) in the outer tunnel header. Valid for
3856          * IPv4, and IPv6.
3857          */
3858         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL \
3859                 (UINT32_C(0x5) << 4)
3860         /*
3861          * Indicates that the IP checksum failed its check in the outer
3862          * tunnel header.
3863          */
3864         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR \
3865                 (UINT32_C(0x6) << 4)
3866         /*
3867          * Indicates that the L4 checksum failed its check in the outer
3868          * tunnel header.
3869          */
3870         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR \
3871                 (UINT32_C(0x7) << 4)
3872         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST \
3873                 RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR
3874         /*
3875          * This indicates that there was a CRC error on either an FCoE
3876          * or RoCE packet. The itype indicates the packet type.
3877          */
3878         #define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR \
3879                 UINT32_C(0x100)
3880         /*
3881          * This indicates that there was an error in the tunnel portion
3882          * of the packet when this field is non-zero.
3883          */
3884         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK \
3885                 UINT32_C(0xe00)
3886         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT                    9
3887         /*
3888          * No additional error occurred on the tunnel portion
3889          * of the packet or the packet does not have a tunnel.
3890          */
3891         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR \
3892                 (UINT32_C(0x0) << 9)
3893         /*
3894          * Indicates that IP header version does not match expectation
3895          * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
3896          */
3897         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
3898                 (UINT32_C(0x1) << 9)
3899         /*
3900          * Indicates that header length is out of range in the tunnel
3901          * header. Valid for IPv4.
3902          */
3903         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
3904                 (UINT32_C(0x2) << 9)
3905         /*
3906          * Indicates that physical packet is shorter than that claimed
3907          * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
3908          * packet packets.
3909          */
3910         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
3911                 (UINT32_C(0x3) << 9)
3912         /*
3913          * Indicates that the physical packet is shorter than that claimed
3914          * by the tunnel UDP header length for a tunnel UDP packet that is
3915          * not fragmented.
3916          */
3917         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
3918                 (UINT32_C(0x4) << 9)
3919         /*
3920          * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
3921          * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
3922          */
3923         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
3924                 (UINT32_C(0x5) << 9)
3925         /*
3926          * Indicates that the IP checksum failed its check in the tunnel
3927          * header.
3928          */
3929         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR \
3930                 (UINT32_C(0x6) << 9)
3931         /*
3932          * Indicates that the L4 checksum failed its check in the tunnel
3933          * header.
3934          */
3935         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR \
3936                 (UINT32_C(0x7) << 9)
3937         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST \
3938                 RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
3939         /*
3940          * This indicates that there was an error in the inner
3941          * portion of the packet when this
3942          * field is non-zero.
3943          */
3944         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK \
3945                 UINT32_C(0xf000)
3946         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT                      12
3947         /*
3948          * No additional error occurred on the tunnel portion
3949          * or the packet of the packet does not have a tunnel.
3950          */
3951         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR \
3952                 (UINT32_C(0x0) << 12)
3953         /*
3954          * Indicates that IP header version does not match
3955          * expectation from L2 Ethertype for IPv4 and IPv6 or that
3956          * option other than VFT was parsed on
3957          * FCoE packet.
3958          */
3959         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION \
3960                 (UINT32_C(0x1) << 12)
3961         /*
3962          * indicates that header length is out of range. Valid for
3963          * IPv4 and RoCE
3964          */
3965         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
3966                 (UINT32_C(0x2) << 12)
3967         /*
3968          * indicates that the IPv4 TTL or IPv6 hop limit check
3969          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
3970          */
3971         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL \
3972                 (UINT32_C(0x3) << 12)
3973         /*
3974          * Indicates that physical packet is shorter than that
3975          * claimed by the l3 header length. Valid for IPv4,
3976          * IPv6 packet or RoCE packets.
3977          */
3978         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
3979                 (UINT32_C(0x4) << 12)
3980         /*
3981          * Indicates that the physical packet is shorter than that
3982          * claimed by the UDP header length for a UDP packet that is
3983          * not fragmented.
3984          */
3985         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
3986                 (UINT32_C(0x5) << 12)
3987         /*
3988          * Indicates that TCP header length > IP payload. Valid for
3989          * TCP packets only.
3990          */
3991         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
3992                 (UINT32_C(0x6) << 12)
3993         /* Indicates that TCP header length < 5. Valid for TCP. */
3994         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
3995                 (UINT32_C(0x7) << 12)
3996         /*
3997          * Indicates that TCP option headers result in a TCP header
3998          * size that does not match data offset in TCP header. Valid
3999          * for TCP.
4000          */
4001         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
4002                 (UINT32_C(0x8) << 12)
4003         /*
4004          * Indicates that the IP checksum failed its check in the
4005          * inner header.
4006          */
4007         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR \
4008                 (UINT32_C(0x9) << 12)
4009         /*
4010          * Indicates that the L4 checksum failed its check in the
4011          * inner header.
4012          */
4013         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR \
4014                 (UINT32_C(0xa) << 12)
4015         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST \
4016                 RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
4017         /*
4018          * This is data from the CFA block as indicated by the meta_format
4019          * field.
4020          */
4021         uint16_t        metadata0;
4022         /* When meta_format=1, this value is the VLAN VID. */
4023         #define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
4024         #define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0
4025         /* When meta_format=1, this value is the VLAN DE. */
4026         #define RX_PKT_V2_CMPL_HI_METADATA0_DE      UINT32_C(0x1000)
4027         /* When meta_format=1, this value is the VLAN PRI. */
4028         #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
4029         #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13
4030         /*
4031          * The timestamp field contains the 32b timestamp for the packet from
4032          * the MAC.
4033          */
4034         uint32_t        timestamp;
4035 } __rte_packed;
4036
4037 /*
4038  * This TPA completion structure is used on devices where the
4039  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
4040  */
4041 /* rx_tpa_start_cmpl (size:128b/16B) */
4042 struct rx_tpa_start_cmpl {
4043         uint16_t        flags_type;
4044         /*
4045          * This field indicates the exact type of the completion.
4046          * By convention, the LSB identifies the length of the
4047          * record in 16B units. Even values indicate 16B
4048          * records. Odd values indicate 32B
4049          * records.
4050          */
4051         #define RX_TPA_START_CMPL_TYPE_MASK                UINT32_C(0x3f)
4052         #define RX_TPA_START_CMPL_TYPE_SFT                 0
4053         /*
4054          * RX L2 TPA Start Completion:
4055          * Completion at the beginning of a TPA operation.
4056          * Length = 32B
4057          */
4058         #define RX_TPA_START_CMPL_TYPE_RX_TPA_START          UINT32_C(0x13)
4059         #define RX_TPA_START_CMPL_TYPE_LAST \
4060                 RX_TPA_START_CMPL_TYPE_RX_TPA_START
4061         #define RX_TPA_START_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
4062         #define RX_TPA_START_CMPL_FLAGS_SFT                6
4063         /* This bit will always be '0' for TPA start completions. */
4064         #define RX_TPA_START_CMPL_FLAGS_ERROR               UINT32_C(0x40)
4065         /* This field indicates how the packet was placed in the buffer. */
4066         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
4067         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT       7
4068         /*
4069          * Jumbo:
4070          * TPA Packet was placed using jumbo algorithm. This means
4071          * that the first buffer will be filled with data before
4072          * moving to aggregation buffers. Each aggregation buffer
4073          * will be filled before moving to the next aggregation
4074          * buffer.
4075          */
4076         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \
4077                 (UINT32_C(0x1) << 7)
4078         /*
4079          * Header/Data Separation:
4080          * Packet was placed using Header/Data separation algorithm.
4081          * The separation location is indicated by the itype field.
4082          */
4083         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \
4084                 (UINT32_C(0x2) << 7)
4085         /*
4086          * GRO/Jumbo:
4087          * Packet will be placed using GRO/Jumbo where the first
4088          * packet is filled with data. Subsequent packets will be
4089          * placed such that any one packet does not span two
4090          * aggregation buffers unless it starts at the beginning of
4091          * an aggregation buffer.
4092          */
4093         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
4094                 (UINT32_C(0x5) << 7)
4095         /*
4096          * GRO/Header-Data Separation:
4097          * Packet will be placed using GRO/HDS where the header
4098          * is in the first packet.
4099          * Payload of each packet will be
4100          * placed such that any one packet does not span two
4101          * aggregation buffers unless it starts at the beginning of
4102          * an aggregation buffer.
4103          */
4104         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
4105                 (UINT32_C(0x6) << 7)
4106         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
4107                 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
4108         /* This bit is '1' if the RSS field in this completion is valid. */
4109         #define RX_TPA_START_CMPL_FLAGS_RSS_VALID           UINT32_C(0x400)
4110         /* unused is 1 b */
4111         #define RX_TPA_START_CMPL_FLAGS_UNUSED              UINT32_C(0x800)
4112         /*
4113          * This value indicates what the inner packet determined for the
4114          * packet was.
4115          */
4116         #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
4117         #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT           12
4118         /*
4119          * TCP Packet:
4120          * Indicates that the packet was IP and TCP.
4121          */
4122         #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \
4123                 (UINT32_C(0x2) << 12)
4124         #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
4125                 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
4126         /*
4127          * This value indicates the amount of packet data written to the
4128          * buffer the opaque field in this completion corresponds to.
4129          */
4130         uint16_t        len;
4131         /*
4132          * This is a copy of the opaque field from the RX BD this completion
4133          * corresponds to.
4134          */
4135         uint32_t        opaque;
4136         /*
4137          * This value is written by the NIC such that it will be different
4138          * for each pass through the completion queue. The even passes
4139          * will write 1. The odd passes will write 0.
4140          */
4141         uint8_t v1;
4142         /*
4143          * This value is written by the NIC such that it will be different
4144          * for each pass through the completion queue. The even passes
4145          * will write 1. The odd passes will write 0.
4146          */
4147         #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
4148         #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
4149         /*
4150          * This is the RSS hash type for the packet. The value is packed
4151          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
4152          *
4153          * The value of tuple_extrac_op provides the information about
4154          * what fields the hash was computed on.
4155          * * 0: The RSS hash was computed over source IP address,
4156          * destination IP address, source port, and destination port of inner
4157          * IP and TCP or UDP headers. Note: For non-tunneled packets,
4158          * the packet headers are considered inner packet headers for the RSS
4159          * hash computation purpose.
4160          * * 1: The RSS hash was computed over source IP address and destination
4161          * IP address of inner IP header. Note: For non-tunneled packets,
4162          * the packet headers are considered inner packet headers for the RSS
4163          * hash computation purpose.
4164          * * 2: The RSS hash was computed over source IP address,
4165          * destination IP address, source port, and destination port of
4166          * IP and TCP or UDP headers of outer tunnel headers.
4167          * Note: For non-tunneled packets, this value is not applicable.
4168          * * 3: The RSS hash was computed over source IP address and
4169          * destination IP address of IP header of outer tunnel headers.
4170          * Note: For non-tunneled packets, this value is not applicable.
4171          *
4172          * Note that 4-tuples values listed above are applicable
4173          * for layer 4 protocols supported and enabled for RSS in the hardware,
4174          * HWRM firmware, and drivers. For example, if RSS hash is supported and
4175          * enabled for TCP traffic only, then the values of tuple_extract_op
4176          * corresponding to 4-tuples are only valid for TCP traffic.
4177          */
4178         uint8_t rss_hash_type;
4179         /*
4180          * This is the aggregation ID that the completion is associated
4181          * with. Use this number to correlate the TPA start completion
4182          * with the TPA end completion.
4183          */
4184         uint16_t        agg_id;
4185         /* unused2 is 9 b */
4186         #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
4187         #define RX_TPA_START_CMPL_UNUSED2_SFT 0
4188         /*
4189          * This is the aggregation ID that the completion is associated
4190          * with. Use this number to correlate the TPA start completion
4191          * with the TPA end completion.
4192          */
4193         #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
4194         #define RX_TPA_START_CMPL_AGG_ID_SFT  9
4195         /*
4196          * This value is the RSS hash value calculated for the packet
4197          * based on the mode bits and key value in the VNIC.
4198          */
4199         uint32_t        rss_hash;
4200 } __rte_packed;
4201
4202 /*
4203  * Last 16 bytes of rx_tpa_start_cmpl.
4204  *
4205  * This TPA completion structure is used on devices where the
4206  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
4207  */
4208 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
4209 struct rx_tpa_start_cmpl_hi {
4210         uint32_t        flags2;
4211         /*
4212          * This indicates that the ip checksum was calculated for the
4213          * inner packet and that the sum passed for all segments
4214          * included in the aggregation.
4215          */
4216         #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC       UINT32_C(0x1)
4217         /*
4218          * This indicates that the TCP, UDP or ICMP checksum was
4219          * calculated for the inner packet and that the sum passed
4220          * for all segments included in the aggregation.
4221          */
4222         #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC       UINT32_C(0x2)
4223         /*
4224          * This indicates that the ip checksum was calculated for the
4225          * tunnel header and that the sum passed for all segments
4226          * included in the aggregation.
4227          */
4228         #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC     UINT32_C(0x4)
4229         /*
4230          * This indicates that the UDP checksum was
4231          * calculated for the tunnel packet and that the sum passed for
4232          * all segments included in the aggregation.
4233          */
4234         #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC     UINT32_C(0x8)
4235         /* This value indicates what format the metadata field is. */
4236         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
4237         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
4238         /* No metadata information. Value is zero. */
4239         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \
4240                 (UINT32_C(0x0) << 4)
4241         /*
4242          * The metadata field contains the VLAN tag and TPID value.
4243          * - metadata[11:0] contains the vlan VID value.
4244          * - metadata[12] contains the vlan DE value.
4245          * - metadata[15:13] contains the vlan PRI value.
4246          * - metadata[31:16] contains the vlan TPID value.
4247          */
4248         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \
4249                 (UINT32_C(0x1) << 4)
4250         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
4251                 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
4252         /*
4253          * This field indicates the IP type for the inner-most IP header.
4254          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
4255          */
4256         #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE          UINT32_C(0x100)
4257         /*
4258          * This is data from the CFA block as indicated by the meta_format
4259          * field.
4260          */
4261         uint32_t        metadata;
4262         /* When meta_format=1, this value is the VLAN VID. */
4263         #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
4264         #define RX_TPA_START_CMPL_METADATA_VID_SFT  0
4265         /* When meta_format=1, this value is the VLAN DE. */
4266         #define RX_TPA_START_CMPL_METADATA_DE       UINT32_C(0x1000)
4267         /* When meta_format=1, this value is the VLAN PRI. */
4268         #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
4269         #define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
4270         /* When meta_format=1, this value is the VLAN TPID. */
4271         #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
4272         #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
4273         uint16_t        v2;
4274         /*
4275          * This value is written by the NIC such that it will be different
4276          * for each pass through the completion queue. The even passes
4277          * will write 1. The odd passes will write 0.
4278          */
4279         #define RX_TPA_START_CMPL_V2     UINT32_C(0x1)
4280         /*
4281          * This field identifies the CFA action rule that was used for this
4282          * packet.
4283          */
4284         uint16_t        cfa_code;
4285         /*
4286          * This is the size in bytes of the inner most L4 header.
4287          * This can be subtracted from the payload_offset to determine
4288          * the start of the inner most L4 header.
4289          */
4290         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
4291         /*
4292          * This is the offset from the beginning of the packet in bytes for
4293          * the outer L3 header. If there is no outer L3 header, then this
4294          * value is zero.
4295          */
4296         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
4297         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
4298         /*
4299          * This is the offset from the beginning of the packet in bytes for
4300          * the inner most L2 header.
4301          */
4302         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
4303         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
4304         /*
4305          * This is the offset from the beginning of the packet in bytes for
4306          * the inner most L3 header.
4307          */
4308         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
4309         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
4310         /*
4311          * This is the size in bytes of the inner most L4 header.
4312          * This can be subtracted from the payload_offset to determine
4313          * the start of the inner most L4 header.
4314          */
4315         #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
4316         #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
4317 } __rte_packed;
4318
4319 /*
4320  * This TPA completion structure is used on devices where the
4321  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
4322  * RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte
4323  * struct)
4324  */
4325 /* rx_tpa_start_v2_cmpl (size:128b/16B) */
4326 struct rx_tpa_start_v2_cmpl {
4327         uint16_t        flags_type;
4328         /*
4329          * This field indicates the exact type of the completion.
4330          * By convention, the LSB identifies the length of the
4331          * record in 16B units. Even values indicate 16B
4332          * records. Odd values indicate 32B
4333          * records.
4334          */
4335         #define RX_TPA_START_V2_CMPL_TYPE_MASK \
4336                 UINT32_C(0x3f)
4337         #define RX_TPA_START_V2_CMPL_TYPE_SFT                       0
4338         /*
4339          * RX L2 TPA Start V2 Completion:
4340          * Completion at the beginning of a TPA operation.
4341          * Length = 32B
4342          * This is the new version of the RX_TPA_START completion used
4343          * in SR2 and later chips.
4344          */
4345         #define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2 \
4346                 UINT32_C(0xd)
4347         #define RX_TPA_START_V2_CMPL_TYPE_LAST \
4348                 RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2
4349         #define RX_TPA_START_V2_CMPL_FLAGS_MASK \
4350                 UINT32_C(0xffc0)
4351         #define RX_TPA_START_V2_CMPL_FLAGS_SFT                      6
4352         /*
4353          * When this bit is '1', it indicates a packet that has an error
4354          * of some type. Type of error is indicated in error_flags.
4355          */
4356         #define RX_TPA_START_V2_CMPL_FLAGS_ERROR \
4357                 UINT32_C(0x40)
4358         /* This field indicates how the packet was placed in the buffer. */
4359         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK \
4360                 UINT32_C(0x380)
4361         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT             7
4362         /*
4363          * Jumbo:
4364          * TPA Packet was placed using jumbo algorithm. This means
4365          * that the first buffer will be filled with data before
4366          * moving to aggregation buffers. Each aggregation buffer
4367          * will be filled before moving to the next aggregation
4368          * buffer.
4369          */
4370         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO \
4371                 (UINT32_C(0x1) << 7)
4372         /*
4373          * Header/Data Separation:
4374          * Packet was placed using Header/Data separation algorithm.
4375          * The separation location is indicated by the itype field.
4376          */
4377         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS \
4378                 (UINT32_C(0x2) << 7)
4379         /*
4380          * IOC/Jumbo:
4381          * Packet will be placed using In-Order Completion/Jumbo where
4382          * the first packet of the aggregation is placed using Jumbo
4383          * Placement. Subsequent packets will be placed such that each
4384          * packet starts at the beginning of an aggregation buffer.
4385          */
4386         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
4387                 (UINT32_C(0x4) << 7)
4388         /*
4389          * GRO/Jumbo:
4390          * Packet will be placed using GRO/Jumbo where the first
4391          * packet is filled with data. Subsequent packets will be
4392          * placed such that any one packet does not span two
4393          * aggregation buffers unless it starts at the beginning of
4394          * an aggregation buffer.
4395          */
4396         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
4397                 (UINT32_C(0x5) << 7)
4398         /*
4399          * GRO/Header-Data Separation:
4400          * Packet will be placed using GRO/HDS where the header
4401          * is in the first packet.
4402          * Payload of each packet will be
4403          * placed such that any one packet does not span two
4404          * aggregation buffers unless it starts at the beginning of
4405          * an aggregation buffer.
4406          */
4407         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS \
4408                 (UINT32_C(0x6) << 7)
4409         /*
4410          * IOC/Header-Data Separation:
4411          * Packet will be placed using In-Order Completion/HDS where
4412          * the header is in the first packet buffer. Payload of each
4413          * packet will be placed such that each packet starts at the
4414          * beginning of an aggregation buffer.
4415          */
4416         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS \
4417                 (UINT32_C(0x7) << 7)
4418         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST \
4419                 RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS
4420         /* This bit is '1' if the RSS field in this completion is valid. */
4421         #define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID \
4422                 UINT32_C(0x400)
4423         /*
4424          * This bit is '1' if metadata has been added to the end of the
4425          * packet in host memory. Metadata starts at the first 32B boundary
4426          * after the end of the packet for regular and jumbo placement. It
4427          * starts at the first 32B boundary after the end of the header for
4428          * HDS placement. The length of the metadata is indicated in the
4429          * metadata itself.
4430          */
4431         #define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT \
4432                 UINT32_C(0x800)
4433         /*
4434          * This value indicates what the inner packet determined for the
4435          * packet was.
4436          */
4437         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK \
4438                 UINT32_C(0xf000)
4439         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT                 12
4440         /*
4441          * TCP Packet:
4442          * Indicates that the packet was IP and TCP.
4443          */
4444         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP \
4445                 (UINT32_C(0x2) << 12)
4446         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST \
4447                 RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP
4448         /*
4449          * This value indicates the amount of packet data written to the
4450          * buffer the opaque field in this completion corresponds to.
4451          */
4452         uint16_t        len;
4453         /*
4454          * This is a copy of the opaque field from the RX BD this completion
4455          * corresponds to. If the VNIC is configured to not use an Rx BD for
4456          * the TPA Start completion, then this is a copy of the opaque field
4457          * from the first BD used to place the TPA Start packet.
4458          */
4459         uint32_t        opaque;
4460         /*
4461          * This value is written by the NIC such that it will be different
4462          * for each pass through the completion queue. The even passes
4463          * will write 1. The odd passes will write 0.
4464          */
4465         uint8_t v1;
4466         /*
4467          * This value is written by the NIC such that it will be different
4468          * for each pass through the completion queue. The even passes
4469          * will write 1. The odd passes will write 0.
4470          */
4471         #define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1)
4472         #define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1
4473         /*
4474          * This is the RSS hash type for the packet. The value is packed
4475          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
4476          *
4477          * The value of tuple_extrac_op provides the information about
4478          * what fields the hash was computed on.
4479          * * 0: The RSS hash was computed over source IP address,
4480          * destination IP address, source port, and destination port of inner
4481          * IP and TCP or UDP headers. Note: For non-tunneled packets,
4482          * the packet headers are considered inner packet headers for the RSS
4483          * hash computation purpose.
4484          * * 1: The RSS hash was computed over source IP address and destination
4485          * IP address of inner IP header. Note: For non-tunneled packets,
4486          * the packet headers are considered inner packet headers for the RSS
4487          * hash computation purpose.
4488          * * 2: The RSS hash was computed over source IP address,
4489          * destination IP address, source port, and destination port of
4490          * IP and TCP or UDP headers of outer tunnel headers.
4491          * Note: For non-tunneled packets, this value is not applicable.
4492          * * 3: The RSS hash was computed over source IP address and
4493          * destination IP address of IP header of outer tunnel headers.
4494          * Note: For non-tunneled packets, this value is not applicable.
4495          *
4496          * Note that 4-tuples values listed above are applicable
4497          * for layer 4 protocols supported and enabled for RSS in the hardware,
4498          * HWRM firmware, and drivers. For example, if RSS hash is supported and
4499          * enabled for TCP traffic only, then the values of tuple_extract_op
4500          * corresponding to 4-tuples are only valid for TCP traffic.
4501          */
4502         uint8_t rss_hash_type;
4503         /*
4504          * This is the aggregation ID that the completion is associated
4505          * with. Use this number to correlate the TPA start completion
4506          * with the TPA end completion.
4507          */
4508         uint16_t        agg_id;
4509         /*
4510          * This is the aggregation ID that the completion is associated
4511          * with. Use this number to correlate the TPA start completion
4512          * with the TPA end completion.
4513          */
4514         #define RX_TPA_START_V2_CMPL_AGG_ID_MASK                UINT32_C(0xfff)
4515         #define RX_TPA_START_V2_CMPL_AGG_ID_SFT                 0
4516         #define RX_TPA_START_V2_CMPL_METADATA1_MASK \
4517                 UINT32_C(0xf000)
4518         #define RX_TPA_START_V2_CMPL_METADATA1_SFT              12
4519         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
4520         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK \
4521                 UINT32_C(0x7000)
4522         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT      12
4523         /* 0x88a8 */
4524         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 \
4525                 (UINT32_C(0x0) << 12)
4526         /* 0x8100 */
4527         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID8100 \
4528                 (UINT32_C(0x1) << 12)
4529         /* 0x9100 */
4530         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9100 \
4531                 (UINT32_C(0x2) << 12)
4532         /* 0x9200 */
4533         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9200 \
4534                 (UINT32_C(0x3) << 12)
4535         /* 0x9300 */
4536         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9300 \
4537                 (UINT32_C(0x4) << 12)
4538         /* Value programmed in CFA VLANTPID register. */
4539         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG \
4540                 (UINT32_C(0x5) << 12)
4541         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_LAST \
4542                 RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
4543         /* When meta_format != 0, this value is the VLAN valid. */
4544         #define RX_TPA_START_V2_CMPL_METADATA1_VALID \
4545                 UINT32_C(0x8000)
4546         /*
4547          * This value is the RSS hash value calculated for the packet
4548          * based on the mode bits and key value in the VNIC.
4549          * When vee_cmpl_mode is set in VNIC context, this is the lower
4550          * 32b of the host address from the first BD used to place the packet.
4551          */
4552         uint32_t        rss_hash;
4553 } __rte_packed;
4554
4555 /*
4556  * Last 16 bytes of RX L2 TPA Start V2 Completion Record
4557  *
4558  * This TPA completion structure is used on devices where the
4559  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
4560  */
4561 /* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */
4562 struct rx_tpa_start_v2_cmpl_hi {
4563         uint32_t        flags2;
4564         /* This indicates that the aggregation was done using GRO rules. */
4565         #define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO \
4566                 UINT32_C(0x4)
4567         /*
4568          * When this bit is '0', the cs_ok field has the following definition:-
4569          * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
4570          * in the delivered packet, counted from the outer-most header group to
4571          * the inner-most header group, stopping at the first error. -
4572          * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
4573          * in the delivered packet, counted from the outer-most header group to
4574          * the inner-most header group, stopping at the first error. When this
4575          * bit is '1', the cs_ok field has the following definition: -
4576          * hdr_cnt[2:0] = The number of header groups that were parsed by the
4577          * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
4578          * will be '1' if all the parsed header groups with an IP checksum are
4579          * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
4580          * header groups with an L4 checksum are valid.
4581          */
4582         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE \
4583                 UINT32_C(0x8)
4584         /* This value indicates what format the metadata field is. */
4585         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK \
4586                 UINT32_C(0xf0)
4587         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT            4
4588         /* There is no metadata information. Values are zero. */
4589         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE \
4590                 (UINT32_C(0x0) << 4)
4591         /*
4592          * The {metadata1, metadata0} fields contain the vtag
4593          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
4594          * de, vid[11:0]} The metadata2 field contains the table scope
4595          * and action record pointer. - metadata2[25:0] contains the
4596          * action record pointer. - metadata2[31:26] contains the table
4597          * scope.
4598          */
4599         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR \
4600                 (UINT32_C(0x1) << 4)
4601         /*
4602          * The {metadata1, metadata0} fields contain the vtag
4603          * information:
4604          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
4605          * The metadata2 field contains the Tunnel ID
4606          * value, justified to LSB. i
4607          * - VXLAN = VNI[23:0] -> VXLAN Network ID
4608          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
4609          * - NVGRE = TNI[23:0] -> Tenant Network ID
4610          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
4611          * - IPv4 = 0 (not populated)
4612          * - IPv6 = Flow Label[19:0]
4613          * - PPPoE = sessionID[15:0]
4614          * - MPLs = Outer label[19:0]
4615          * - UPAR = Selected[31:0] with bit mask
4616          */
4617         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
4618                 (UINT32_C(0x2) << 4)
4619         /*
4620          * The {metadata1, metadata0} fields contain the vtag
4621          * information:
4622          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
4623          * The metadata2 field contains the 32b metadata from the prepended
4624          * header (chdr_data).
4625          */
4626         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
4627                 (UINT32_C(0x3) << 4)
4628         /*
4629          * The {metadata1, metadata0} fields contain the vtag
4630          * information:
4631          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
4632          * The metadata2 field contains the outer_l3_offset,
4633          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
4634          * - metadata2[8:0] contains the outer_l3_offset.
4635          * - metadata2[17:9] contains the inner_l2_offset.
4636          * - metadata2[26:18] contains the inner_l3_offset.
4637          * - metadata2[31:27] contains the inner_l4_size.
4638          */
4639         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
4640                 (UINT32_C(0x4) << 4)
4641         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST \
4642                 RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
4643         /*
4644          * This field indicates the IP type for the inner-most IP header.
4645          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
4646          * This value is only valid if itype indicates a packet
4647          * with an IP header.
4648          */
4649         #define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE \
4650                 UINT32_C(0x100)
4651         /*
4652          * This indicates that the complete 1's complement checksum was
4653          * calculated for the packet in the affregation.
4654          */
4655         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
4656                 UINT32_C(0x200)
4657         /*
4658          * This field indicates the status of IP and L4 CS calculations done
4659          * by the chip. The format of this field is indicated by the
4660          * cs_all_ok_mode bit.
4661          * CS status for TPA packets is always valid. This means that "all_ok"
4662          * status will always be set. The ok count status will be set
4663          * appropriately for the packet header, such that all existing CS
4664          * values are ok.
4665          */
4666         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK \
4667                 UINT32_C(0xfc00)
4668         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT                  10
4669         /*
4670          * This value is the complete 1's complement checksum calculated from
4671          * the start of the outer L3 header to the end of the packet (not
4672          * including the ethernet crc). It is valid when the
4673          * 'complete_checksum_calc' flag is set. For TPA Start completions,
4674          * the complete checksum is calculated for the first packet in the
4675          * aggregation only.
4676          */
4677         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
4678                 UINT32_C(0xffff0000)
4679         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
4680         /*
4681          * This is data from the CFA block as indicated by the meta_format
4682          * field.
4683          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
4684          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
4685          *   act_rec_ptr[25:0]}
4686          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
4687          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
4688          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
4689          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
4690          * of the host address from the first BD used to place the packet.
4691          */
4692         uint32_t        metadata2;
4693         uint16_t        errors_v2;
4694         /*
4695          * This value is written by the NIC such that it will be different
4696          * for each pass through the completion queue. The even passes
4697          * will write 1. The odd passes will write 0.
4698          */
4699         #define RX_TPA_START_V2_CMPL_V2 \
4700                 UINT32_C(0x1)
4701         #define RX_TPA_START_V2_CMPL_ERRORS_MASK \
4702                 UINT32_C(0xfffe)
4703         #define RX_TPA_START_V2_CMPL_ERRORS_SFT                     1
4704         /*
4705          * This error indicates that there was some sort of problem with
4706          * the BDs for the packetThe packet should be treated as
4707          * invalid.
4708          */
4709         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK \
4710                 UINT32_C(0xe)
4711         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT         1
4712         /* No buffer error */
4713         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
4714                 (UINT32_C(0x0) << 1)
4715         /*
4716          * Did Not Fit:
4717          * Packet did not fit into packet buffer provided. This means
4718          * that the TPA Start packet was too big to be placed into the
4719          * per-packet maximum number of physical buffers configured for
4720          * the VNIC, or that it was too big to be placed into the
4721          * per-aggregation maximum number of physical buffers configured
4722          * for the VNIC. This error only occurs when the VNIC is
4723          * configured for variable size receive buffers.
4724          */
4725         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
4726                 (UINT32_C(0x1) << 1)
4727         /*
4728          * Bad Format:
4729          * BDs were not formatted correctly.
4730          */
4731         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
4732                 (UINT32_C(0x3) << 1)
4733         /*
4734          * Flush:
4735          * There was a bad_format error on the previous operation
4736          */
4737         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
4738                 (UINT32_C(0x5) << 1)
4739         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST \
4740                 RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH
4741         /*
4742          * This is data from the CFA block as indicated by the meta_format
4743          * field.
4744          */
4745         uint16_t        metadata0;
4746         /* When meta_format != 0, this value is the VLAN VID. */
4747         #define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
4748         #define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0
4749         /* When meta_format != 0, this value is the VLAN DE. */
4750         #define RX_TPA_START_V2_CMPL_METADATA0_DE      UINT32_C(0x1000)
4751         /* When meta_format != 0, this value is the VLAN PRI. */
4752         #define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
4753         #define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13
4754         /*
4755          * This field contains the outer_l3_offset, inner_l2_offset,
4756          * inner_l3_offset, and inner_l4_size.
4757          *
4758          * hdr_offsets[8:0] contains the outer_l3_offset.
4759          * hdr_offsets[17:9] contains the inner_l2_offset.
4760          * hdr_offsets[26:18] contains the inner_l3_offset.
4761          * hdr_offsets[31:27] contains the inner_l4_size.
4762          */
4763         uint32_t        hdr_offsets;
4764 } __rte_packed;
4765
4766 /*
4767  * This TPA completion structure is used on devices where the
4768  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
4769  */
4770 /* rx_tpa_end_cmpl (size:128b/16B) */
4771 struct rx_tpa_end_cmpl {
4772         uint16_t        flags_type;
4773         /*
4774          * This field indicates the exact type of the completion.
4775          * By convention, the LSB identifies the length of the
4776          * record in 16B units. Even values indicate 16B
4777          * records. Odd values indicate 32B
4778          * records.
4779          */
4780         #define RX_TPA_END_CMPL_TYPE_MASK                      UINT32_C(0x3f)
4781         #define RX_TPA_END_CMPL_TYPE_SFT                       0
4782         /*
4783          * RX L2 TPA End Completion:
4784          * Completion at the end of a TPA operation.
4785          * Length = 32B
4786          */
4787         #define RX_TPA_END_CMPL_TYPE_RX_TPA_END                  UINT32_C(0x15)
4788         #define RX_TPA_END_CMPL_TYPE_LAST \
4789                 RX_TPA_END_CMPL_TYPE_RX_TPA_END
4790         #define RX_TPA_END_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
4791         #define RX_TPA_END_CMPL_FLAGS_SFT                      6
4792         /*
4793          * When this bit is '1', it indicates a packet that has an
4794          * error of some type. Type of error is indicated in
4795          * error_flags.
4796          */
4797         #define RX_TPA_END_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
4798         /* This field indicates how the packet was placed in the buffer. */
4799         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
4800         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT             7
4801         /*
4802          * Jumbo:
4803          * TPA Packet was placed using jumbo algorithm. This means
4804          * that the first buffer will be filled with data before
4805          * moving to aggregation buffers. Each aggregation buffer
4806          * will be filled before moving to the next aggregation
4807          * buffer.
4808          */
4809         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \
4810                 (UINT32_C(0x1) << 7)
4811         /*
4812          * Header/Data Separation:
4813          * Packet was placed using Header/Data separation algorithm.
4814          * The separation location is indicated by the itype field.
4815          */
4816         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \
4817                 (UINT32_C(0x2) << 7)
4818         /*
4819          * IOC/Jumbo:
4820          * Packet will be placed using In-Order Completion/Jumbo where
4821          * the first packet of the aggregation is placed using Jumbo
4822          * Placement. Subsequent packets will be placed such that each
4823          * packet starts at the beginning of an aggregation buffer.
4824          */
4825         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
4826                 (UINT32_C(0x4) << 7)
4827         /*
4828          * GRO/Jumbo:
4829          * Packet will be placed using GRO/Jumbo where the first
4830          * packet is filled with data. Subsequent packets will be
4831          * placed such that any one packet does not span two
4832          * aggregation buffers unless it starts at the beginning of
4833          * an aggregation buffer.
4834          */
4835         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
4836                 (UINT32_C(0x5) << 7)
4837         /*
4838          * GRO/Header-Data Separation:
4839          * Packet will be placed using GRO/HDS where the header
4840          * is in the first packet.
4841          * Payload of each packet will be
4842          * placed such that any one packet does not span two
4843          * aggregation buffers unless it starts at the beginning of
4844          * an aggregation buffer.
4845          */
4846         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
4847                 (UINT32_C(0x6) << 7)
4848         /*
4849          * IOC/Header-Data Separation:
4850          * Packet will be placed using In-Order Completion/HDS where
4851          * the header is in the first packet buffer. Payload of each
4852          * packet will be placed such that each packet starts at the
4853          * beginning of an aggregation buffer.
4854          */
4855         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS \
4856                 (UINT32_C(0x7) << 7)
4857         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
4858                 RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
4859         /* unused is 1 b */
4860         #define RX_TPA_END_CMPL_FLAGS_UNUSED                    UINT32_C(0x400)
4861         /*
4862          * This bit is '1' if metadata has been added to the end of the
4863          * packet in host memory. Metadata starts at the first 32B boundary
4864          * after the end of the packet for regular and jumbo placement.
4865          * It starts at the first 32B boundary after the end of the header
4866          * for HDS placement. The length of the metadata is indicated in the
4867          * metadata itself.
4868          */
4869         #define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
4870         /*
4871          * This value indicates what the inner packet determined for the
4872          * packet was.
4873          * - 2 TCP Packet
4874          *     Indicates that the packet was IP and TCP. This indicates
4875          *     that the ip_cs field is valid and that the tcp_udp_cs
4876          *     field is valid and contains the TCP checksum.
4877          *     This also indicates that the payload_offset field is valid.
4878          */
4879         #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK \
4880                 UINT32_C(0xf000)
4881         #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT                 12
4882         /*
4883          * This value is zero for TPA End completions.
4884          * There is no data in the buffer that corresponds to the opaque
4885          * value in this completion.
4886          */
4887         uint16_t        len;
4888         /*
4889          * This is a copy of the opaque field from the RX BD this completion
4890          * corresponds to.
4891          */
4892         uint32_t        opaque;
4893         /*
4894          * This value is written by the NIC such that it will be different
4895          * for each pass through the completion queue. The even passes
4896          * will write 1. The odd passes will write 0.
4897          */
4898         uint8_t agg_bufs_v1;
4899         /*
4900          * This value is written by the NIC such that it will be different
4901          * for each pass through the completion queue. The even passes
4902          * will write 1. The odd passes will write 0.
4903          */
4904         #define RX_TPA_END_CMPL_V1           UINT32_C(0x1)
4905         /*
4906          * This value is the number of aggregation buffers that follow this
4907          * entry in the completion ring that are a part of this aggregation
4908          * packet.
4909          * If the value is zero, then the packet is completely contained
4910          * in the buffer space provided in the aggregation start completion.
4911          */
4912         #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
4913         #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
4914         /* This value is the number of segments in the TPA operation. */
4915         uint8_t tpa_segs;
4916         /*
4917          * This value indicates the offset in bytes from the beginning of the packet
4918          * where the inner payload starts. This value is valid for TCP, UDP,
4919          * FCoE, and RoCE packets.
4920          *
4921          * A value of zero indicates an offset of 256 bytes.
4922          */
4923         uint8_t payload_offset;
4924         uint8_t agg_id;
4925         /* unused2 is 1 b */
4926         #define RX_TPA_END_CMPL_UNUSED2     UINT32_C(0x1)
4927         /*
4928          * This is the aggregation ID that the completion is associated
4929          * with. Use this number to correlate the TPA start completion
4930          * with the TPA end completion.
4931          */
4932         #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
4933         #define RX_TPA_END_CMPL_AGG_ID_SFT  1
4934         /*
4935          * For non-GRO packets, this value is the
4936          * timestamp delta between earliest and latest timestamp values for
4937          * TPA packet. If packets were not time stamped, then delta will be
4938          * zero.
4939          *
4940          * For GRO packets, this field is zero except for the following
4941          * sub-fields.
4942          * - tsdelta[31]
4943          *     Timestamp present indication. When '0', no Timestamp
4944          *     option is in the packet. When '1', then a Timestamp
4945          *     option is present in the packet.
4946          */
4947         uint32_t        tsdelta;
4948 } __rte_packed;
4949
4950 /*
4951  * Last 16 bytes of rx_tpa_end_cmpl.
4952  *
4953  * This TPA completion structure is used on devices where the
4954  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
4955  */
4956 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
4957 struct rx_tpa_end_cmpl_hi {
4958         uint32_t        tpa_dup_acks;
4959         /*
4960          * This value is the number of duplicate ACKs that have been
4961          * received as part of the TPA operation.
4962          */
4963         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
4964         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
4965         /*
4966          * This value is the valid when TPA completion is active. It
4967          * indicates the length of the longest segment of the TPA operation
4968          * for LRO mode and the length of the first segment in GRO mode.
4969          *
4970          * This value may be used by GRO software to re-construct the original
4971          * packet stream from the TPA packet. This is the length of all
4972          * but the last segment for GRO. In LRO mode this value may be used
4973          * to indicate MSS size to the stack.
4974          */
4975         uint16_t        tpa_seg_len;
4976         /* unused4 is 16 b */
4977         uint16_t        unused3;
4978         uint16_t        errors_v2;
4979         /*
4980          * This value is written by the NIC such that it will be different
4981          * for each pass through the completion queue. The even passes
4982          * will write 1. The odd passes will write 0.
4983          */
4984         #define RX_TPA_END_CMPL_V2                             UINT32_C(0x1)
4985         #define RX_TPA_END_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
4986         #define RX_TPA_END_CMPL_ERRORS_SFT                     1
4987         /*
4988          * This error indicates that there was some sort of problem with
4989          * the BDs for the packet that was found after part of the
4990          * packet was already placed. The packet should be treated as
4991          * invalid.
4992          */
4993         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
4994         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
4995         /*
4996          * This error occurs when there is a fatal HW problem in
4997          * the chip only. It indicates that there were not
4998          * BDs on chip but that there was adequate reservation.
4999          * provided by the TPA block.
5000          */
5001         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
5002                 (UINT32_C(0x2) << 1)
5003         /*
5004          * This error occurs when TPA block was not configured to
5005          * reserve adequate BDs for TPA operations on this RX
5006          * ring. All data for the TPA operation was not placed.
5007          *
5008          * This error can also be generated when the number of
5009          * segments is not programmed correctly in TPA and the
5010          * 33 total aggregation buffers allowed for the TPA
5011          * operation has been exceeded.
5012          */
5013         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
5014                 (UINT32_C(0x4) << 1)
5015         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
5016                 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
5017         /* unused5 is 16 b */
5018         uint16_t        unused_4;
5019         /*
5020          * This is the opaque value that was completed for the TPA start
5021          * completion that corresponds to this TPA end completion.
5022          */
5023         uint32_t        start_opaque;
5024 } __rte_packed;
5025
5026 /*
5027  * This TPA completion structure is used on devices where the
5028  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
5029  */
5030 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
5031 struct rx_tpa_v2_start_cmpl {
5032         uint16_t        flags_type;
5033         /*
5034          * This field indicates the exact type of the completion.
5035          * By convention, the LSB identifies the length of the
5036          * record in 16B units. Even values indicate 16B
5037          * records. Odd values indicate 32B
5038          * records.
5039          */
5040         #define RX_TPA_V2_START_CMPL_TYPE_MASK \
5041                 UINT32_C(0x3f)
5042         #define RX_TPA_V2_START_CMPL_TYPE_SFT                       0
5043         /*
5044          * RX L2 TPA Start Completion:
5045          * Completion at the beginning of a TPA operation.
5046          * Length = 32B
5047          */
5048         #define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START \
5049                 UINT32_C(0x13)
5050         #define RX_TPA_V2_START_CMPL_TYPE_LAST \
5051                 RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
5052         #define RX_TPA_V2_START_CMPL_FLAGS_MASK \
5053                 UINT32_C(0xffc0)
5054         #define RX_TPA_V2_START_CMPL_FLAGS_SFT                      6
5055         /* This bit will always be '0' for TPA start completions. */
5056         #define RX_TPA_V2_START_CMPL_FLAGS_ERROR \
5057                 UINT32_C(0x40)
5058         /* This field indicates how the packet was placed in the buffer. */
5059         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK \
5060                 UINT32_C(0x380)
5061         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT             7
5062         /*
5063          * Jumbo:
5064          * TPA Packet was placed using jumbo algorithm. This means
5065          * that the first buffer will be filled with data before
5066          * moving to aggregation buffers. Each aggregation buffer
5067          * will be filled before moving to the next aggregation
5068          * buffer.
5069          */
5070         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO \
5071                 (UINT32_C(0x1) << 7)
5072         /*
5073          * Header/Data Separation:
5074          * Packet was placed using Header/Data separation algorithm.
5075          * The separation location is indicated by the itype field.
5076          */
5077         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS \
5078                 (UINT32_C(0x2) << 7)
5079         /*
5080          * GRO/Jumbo:
5081          * Packet will be placed using GRO/Jumbo where the first
5082          * packet is filled with data. Subsequent packets will be
5083          * placed such that any one packet does not span two
5084          * aggregation buffers unless it starts at the beginning of
5085          * an aggregation buffer.
5086          */
5087         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
5088                 (UINT32_C(0x5) << 7)
5089         /*
5090          * GRO/Header-Data Separation:
5091          * Packet will be placed using GRO/HDS where the header
5092          * is in the first packet.
5093          * Payload of each packet will be
5094          * placed such that any one packet does not span two
5095          * aggregation buffers unless it starts at the beginning of
5096          * an aggregation buffer.
5097          */
5098         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
5099                 (UINT32_C(0x6) << 7)
5100         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST \
5101                 RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
5102         /* This bit is '1' if the RSS field in this completion is valid. */
5103         #define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID \
5104                 UINT32_C(0x400)
5105         /*
5106          * For devices that support timestamps, when this bit is cleared the
5107          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
5108          * field contains the 32b timestamp for
5109          * the packet from the MAC. When this bit is set, the
5110          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
5111          * field contains the outer_l3_offset, inner_l2_offset,
5112          * inner_l3_offset, and inner_l4_size.
5113          */
5114         #define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT \
5115                 UINT32_C(0x800)
5116         /*
5117          * This value indicates what the inner packet determined for the
5118          * packet was.
5119          */
5120         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK \
5121                 UINT32_C(0xf000)
5122         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT                 12
5123         /*
5124          * TCP Packet:
5125          * Indicates that the packet was IP and TCP.
5126          */
5127         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP \
5128                 (UINT32_C(0x2) << 12)
5129         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST \
5130                 RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
5131         /*
5132          * This value indicates the amount of packet data written to the
5133          * buffer the opaque field in this completion corresponds to.
5134          */
5135         uint16_t        len;
5136         /*
5137          * This is a copy of the opaque field from the RX BD this completion
5138          * corresponds to.
5139          */
5140         uint32_t        opaque;
5141         /*
5142          * This value is written by the NIC such that it will be different
5143          * for each pass through the completion queue. The even passes
5144          * will write 1. The odd passes will write 0.
5145          */
5146         uint8_t v1;
5147         /*
5148          * This value is written by the NIC such that it will be different
5149          * for each pass through the completion queue. The even passes
5150          * will write 1. The odd passes will write 0.
5151          */
5152         #define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
5153         #define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
5154         /*
5155          * This is the RSS hash type for the packet. The value is packed
5156          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5157          *
5158          * The value of tuple_extrac_op provides the information about
5159          * what fields the hash was computed on.
5160          * * 0: The RSS hash was computed over source IP address,
5161          * destination IP address, source port, and destination port of inner
5162          * IP and TCP or UDP headers. Note: For non-tunneled packets,
5163          * the packet headers are considered inner packet headers for the RSS
5164          * hash computation purpose.
5165          * * 1: The RSS hash was computed over source IP address and destination
5166          * IP address of inner IP header. Note: For non-tunneled packets,
5167          * the packet headers are considered inner packet headers for the RSS
5168          * hash computation purpose.
5169          * * 2: The RSS hash was computed over source IP address,
5170          * destination IP address, source port, and destination port of
5171          * IP and TCP or UDP headers of outer tunnel headers.
5172          * Note: For non-tunneled packets, this value is not applicable.
5173          * * 3: The RSS hash was computed over source IP address and
5174          * destination IP address of IP header of outer tunnel headers.
5175          * Note: For non-tunneled packets, this value is not applicable.
5176          *
5177          * Note that 4-tuples values listed above are applicable
5178          * for layer 4 protocols supported and enabled for RSS in the hardware,
5179          * HWRM firmware, and drivers. For example, if RSS hash is supported and
5180          * enabled for TCP traffic only, then the values of tuple_extract_op
5181          * corresponding to 4-tuples are only valid for TCP traffic.
5182          */
5183         uint8_t rss_hash_type;
5184         /*
5185          * This is the aggregation ID that the completion is associated
5186          * with. Use this number to correlate the TPA start completion
5187          * with the TPA end completion.
5188          */
5189         uint16_t        agg_id;
5190         /*
5191          * This value is the RSS hash value calculated for the packet
5192          * based on the mode bits and key value in the VNIC.
5193          */
5194         uint32_t        rss_hash;
5195 } __rte_packed;
5196
5197 /*
5198  * Last 16 bytes of rx_tpa_v2_start_cmpl.
5199  *
5200  * This TPA completion structure is used on devices where the
5201  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
5202  */
5203 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
5204 struct rx_tpa_v2_start_cmpl_hi {
5205         uint32_t        flags2;
5206         /*
5207          * This indicates that the ip checksum was calculated for the
5208          * inner packet and that the sum passed for all segments
5209          * included in the aggregation.
5210          */
5211         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC \
5212                 UINT32_C(0x1)
5213         /*
5214          * This indicates that the TCP, UDP or ICMP checksum was
5215          * calculated for the inner packet and that the sum passed
5216          * for all segments included in the aggregation.
5217          */
5218         #define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC \
5219                 UINT32_C(0x2)
5220         /*
5221          * This indicates that the ip checksum was calculated for the
5222          * tunnel header and that the sum passed for all segments
5223          * included in the aggregation.
5224          */
5225         #define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC \
5226                 UINT32_C(0x4)
5227         /*
5228          * This indicates that the UDP checksum was
5229          * calculated for the tunnel packet and that the sum passed for
5230          * all segments included in the aggregation.
5231          */
5232         #define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC \
5233                 UINT32_C(0x8)
5234         /* This value indicates what format the metadata field is. */
5235         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK \
5236                 UINT32_C(0xf0)
5237         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT            4
5238         /* No metadata informtaion. Value is zero. */
5239         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE \
5240                 (UINT32_C(0x0) << 4)
5241         /*
5242          * The metadata field contains the VLAN tag and TPID value.
5243          * - metadata[11:0] contains the vlan VID value.
5244          * - metadata[12] contains the vlan DE value.
5245          * - metadata[15:13] contains the vlan PRI value.
5246          * - metadata[31:16] contains the vlan TPID value.
5247          */
5248         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN \
5249                 (UINT32_C(0x1) << 4)
5250         /*
5251          * If ext_meta_format is equal to 1, the metadata field
5252          * contains the lower 16b of the tunnel ID value, justified
5253          * to LSB
5254          * - VXLAN = VNI[23:0] -> VXLAN Network ID
5255          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
5256          * - NVGRE = TNI[23:0] -> Tenant Network ID
5257          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
5258          * - IPV4 = 0 (not populated)
5259          * - IPV6 = Flow Label[19:0]
5260          * - PPPoE = sessionID[15:0]
5261          * - MPLs = Outer label[19:0]
5262          * - UPAR = Selected[31:0] with bit mask
5263          */
5264         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
5265                 (UINT32_C(0x2) << 4)
5266         /*
5267          * if ext_meta_format is equal to 1, metadata field contains
5268          * 16b metadata from the prepended header (chdr_data).
5269          */
5270         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
5271                 (UINT32_C(0x3) << 4)
5272         /*
5273          * If ext_meta_format is equal to 1, the metadata field contains
5274          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
5275          * inner_l4_size.
5276          * - metadata[8:0] contains the outer_l3_offset.
5277          * - metadata[17:9] contains the inner_l2_offset.
5278          * - metadata[26:18] contains the inner_l3_offset.
5279          * - metadata[31:27] contains the inner_l4_size.
5280          */
5281         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
5282                 (UINT32_C(0x4) << 4)
5283         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST \
5284                 RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
5285         /*
5286          * This field indicates the IP type for the inner-most IP header.
5287          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5288          */
5289         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE \
5290                 UINT32_C(0x100)
5291         /*
5292          * This indicates that the complete 1's complement checksum was
5293          * calculated for the packet.
5294          */
5295         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
5296                 UINT32_C(0x200)
5297         /*
5298          * The combination of this value and meta_format indicated what
5299          * format the metadata field is.
5300          */
5301         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK \
5302                 UINT32_C(0xc00)
5303         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
5304         /*
5305          * This value is the complete 1's complement checksum calculated from
5306          * the start of the outer L3 header to the end of the packet (not
5307          * including the ethernet crc). It is valid when the
5308          * 'complete_checksum_calc' flag is set. For TPA Start completions,
5309          * the complete checksum is calculated for the first packet in the
5310          * aggregation only.
5311          */
5312         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
5313                 UINT32_C(0xffff0000)
5314         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
5315         /*
5316          * This is data from the CFA block as indicated by the meta_format
5317          * field.
5318          */
5319         uint32_t        metadata;
5320         /* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
5321         #define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
5322         #define RX_TPA_V2_START_CMPL_METADATA_VID_SFT  0
5323         /* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
5324         #define RX_TPA_V2_START_CMPL_METADATA_DE       UINT32_C(0x1000)
5325         /* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
5326         #define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
5327         #define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT  13
5328         /* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
5329         #define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
5330         #define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
5331         uint16_t        errors_v2;
5332         /*
5333          * This value is written by the NIC such that it will be different
5334          * for each pass through the completion queue. The even passes
5335          * will write 1. The odd passes will write 0.
5336          */
5337         #define RX_TPA_V2_START_CMPL_V2 \
5338                 UINT32_C(0x1)
5339         #define RX_TPA_V2_START_CMPL_ERRORS_MASK \
5340                 UINT32_C(0xfffe)
5341         #define RX_TPA_V2_START_CMPL_ERRORS_SFT                    1
5342         /*
5343          * This error indicates that there was some sort of problem with
5344          * the BDs for the packet that was found after part of the
5345          * packet was already placed. The packet should be treated as
5346          * invalid.
5347          */
5348         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK \
5349                 UINT32_C(0xe)
5350         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT        1
5351         /* No buffer error */
5352         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
5353                 (UINT32_C(0x0) << 1)
5354         /*
5355          * Bad Format:
5356          * BDs were not formatted correctly.
5357          */
5358         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
5359                 (UINT32_C(0x3) << 1)
5360         /*
5361          * Flush:
5362          * There was a bad_format error on the previous operation
5363          */
5364         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
5365                 (UINT32_C(0x5) << 1)
5366         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST \
5367                 RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
5368         /*
5369          * This field identifies the CFA action rule that was used for this
5370          * packet.
5371          */
5372         uint16_t        cfa_code;
5373         /*
5374          * For devices that support timestamps this field is overridden
5375          * with the timestamp value. When `flags.timestamp_fld_format` is
5376          * cleared, this field contains the 32b timestamp for the packet from the
5377          * MAC.
5378          *
5379          * When `flags.timestamp_fld_format` is set, this field contains the
5380          * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
5381          * as defined below.
5382          */
5383         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
5384         /*
5385          * This is the offset from the beginning of the packet in bytes for
5386          * the outer L3 header. If there is no outer L3 header, then this
5387          * value is zero.
5388          */
5389         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
5390         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
5391         /*
5392          * This is the offset from the beginning of the packet in bytes for
5393          * the inner most L2 header.
5394          */
5395         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
5396         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
5397         /*
5398          * This is the offset from the beginning of the packet in bytes for
5399          * the inner most L3 header.
5400          */
5401         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
5402         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
5403         /*
5404          * This is the size in bytes of the inner most L4 header.
5405          * This can be subtracted from the payload_offset to determine
5406          * the start of the inner most L4 header.
5407          */
5408         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
5409         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
5410 } __rte_packed;
5411
5412 /*
5413  * This TPA completion structure is used on devices where the
5414  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
5415  */
5416 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
5417 struct rx_tpa_v2_end_cmpl {
5418         uint16_t        flags_type;
5419         /*
5420          * This field indicates the exact type of the completion.
5421          * By convention, the LSB identifies the length of the
5422          * record in 16B units. Even values indicate 16B
5423          * records. Odd values indicate 32B
5424          * records.
5425          */
5426         #define RX_TPA_V2_END_CMPL_TYPE_MASK                UINT32_C(0x3f)
5427         #define RX_TPA_V2_END_CMPL_TYPE_SFT                 0
5428         /*
5429          * RX L2 TPA End Completion:
5430          * Completion at the end of a TPA operation.
5431          * Length = 32B
5432          */
5433         #define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END            UINT32_C(0x15)
5434         #define RX_TPA_V2_END_CMPL_TYPE_LAST \
5435                 RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
5436         #define RX_TPA_V2_END_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
5437         #define RX_TPA_V2_END_CMPL_FLAGS_SFT                6
5438         /*
5439          * When this bit is '1', it indicates a packet that has an
5440          * error of some type. Type of error is indicated in
5441          * error_flags.
5442          */
5443         #define RX_TPA_V2_END_CMPL_FLAGS_ERROR               UINT32_C(0x40)
5444         /* This field indicates how the packet was placed in the buffer. */
5445         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
5446         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT       7
5447         /*
5448          * Jumbo:
5449          * TPA Packet was placed using jumbo algorithm. This means
5450          * that the first buffer will be filled with data before
5451          * moving to aggregation buffers. Each aggregation buffer
5452          * will be filled before moving to the next aggregation
5453          * buffer.
5454          */
5455         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO \
5456                 (UINT32_C(0x1) << 7)
5457         /*
5458          * Header/Data Separation:
5459          * Packet was placed using Header/Data separation algorithm.
5460          * The separation location is indicated by the itype field.
5461          */
5462         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS \
5463                 (UINT32_C(0x2) << 7)
5464         /*
5465          * GRO/Jumbo:
5466          * Packet will be placed using GRO/Jumbo where the first
5467          * packet is filled with data. Subsequent packets will be
5468          * placed such that any one packet does not span two
5469          * aggregation buffers unless it starts at the beginning of
5470          * an aggregation buffer.
5471          */
5472         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
5473                 (UINT32_C(0x5) << 7)
5474         /*
5475          * GRO/Header-Data Separation:
5476          * Packet will be placed using GRO/HDS where the header
5477          * is in the first packet.
5478          * Payload of each packet will be
5479          * placed such that any one packet does not span two
5480          * aggregation buffers unless it starts at the beginning of
5481          * an aggregation buffer.
5482          */
5483         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
5484                 (UINT32_C(0x6) << 7)
5485         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST \
5486                 RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
5487         /* unused is 2 b */
5488         #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED_MASK         UINT32_C(0xc00)
5489         #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED_SFT          10
5490         /*
5491          * This value indicates what the inner packet determined for the
5492          * packet was.
5493          * - 2 TCP Packet
5494          *     Indicates that the packet was IP and TCP. This indicates
5495          *     that the ip_cs field is valid and that the tcp_udp_cs
5496          *     field is valid and contains the TCP checksum.
5497          *     This also indicates that the payload_offset field is valid.
5498          */
5499         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
5500         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT           12
5501         /*
5502          * This value is zero for TPA End completions.
5503          * There is no data in the buffer that corresponds to the opaque
5504          * value in this completion.
5505          */
5506         uint16_t        len;
5507         /*
5508          * This is a copy of the opaque field from the RX BD this completion
5509          * corresponds to.
5510          */
5511         uint32_t        opaque;
5512         uint8_t v1;
5513         /*
5514          * This value is written by the NIC such that it will be different
5515          * for each pass through the completion queue. The even passes
5516          * will write 1. The odd passes will write 0.
5517          */
5518         #define RX_TPA_V2_END_CMPL_V1     UINT32_C(0x1)
5519         /* This value is the number of segments in the TPA operation. */
5520         uint8_t tpa_segs;
5521         /*
5522          * This is the aggregation ID that the completion is associated
5523          * with. Use this number to correlate the TPA start completion
5524          * with the TPA end completion.
5525          */
5526         uint16_t        agg_id;
5527         /*
5528          * For non-GRO packets, this value is the
5529          * timestamp delta between earliest and latest timestamp values for
5530          * TPA packet. If packets were not time stamped, then delta will be
5531          * zero.
5532          *
5533          * For GRO packets, this field is zero except for the following
5534          * sub-fields.
5535          * - tsdelta[31]
5536          *     Timestamp present indication. When '0', no Timestamp
5537          *     option is in the packet. When '1', then a Timestamp
5538          *     option is present in the packet.
5539          */
5540         uint32_t        tsdelta;
5541 } __rte_packed;
5542
5543 /*
5544  * Last 16 bytes of rx_tpa_v2_end_cmpl.
5545  *
5546  * This TPA completion structure is used on devices where the
5547  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
5548  */
5549 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
5550 struct rx_tpa_v2_end_cmpl_hi {
5551         /*
5552          * This value is the number of duplicate ACKs that have been
5553          * received as part of the TPA operation.
5554          */
5555         uint16_t        tpa_dup_acks;
5556         /*
5557          * This value is the number of duplicate ACKs that have been
5558          * received as part of the TPA operation.
5559          */
5560         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
5561         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
5562         /*
5563          * This value indicated the offset in bytes from the beginning of
5564          * the packet where the inner payload starts. This value is valid
5565          * for TCP, UDP, FCoE and RoCE packets
5566          */
5567         uint8_t payload_offset;
5568         /*
5569          * The value is the total number of aggregation buffers that were
5570          * used in the TPA operation. All TPA aggregation buffer completions
5571          * precede the TPA End completion. If the value is zero, then the
5572          * aggregation is completely contained in the buffer space provided
5573          * in the aggregation start completion.
5574          * Note that the field is simply provided as a cross check.
5575          */
5576         uint8_t tpa_agg_bufs;
5577         /*
5578          * This value is the valid when TPA completion is active. It
5579          * indicates the length of the longest segment of the TPA operation
5580          * for LRO mode and the length of the first segment in GRO mode.
5581          *
5582          * This value may be used by GRO software to re-construct the original
5583          * packet stream from the TPA packet. This is the length of all
5584          * but the last segment for GRO. In LRO mode this value may be used
5585          * to indicate MSS size to the stack.
5586          */
5587         uint16_t        tpa_seg_len;
5588         uint16_t        unused_1;
5589         uint16_t        errors_v2;
5590         /*
5591          * This value is written by the NIC such that it will be different
5592          * for each pass through the completion queue. The even passes
5593          * will write 1. The odd passes will write 0.
5594          */
5595         #define RX_TPA_V2_END_CMPL_V2                             UINT32_C(0x1)
5596         #define RX_TPA_V2_END_CMPL_ERRORS_MASK \
5597                 UINT32_C(0xfffe)
5598         #define RX_TPA_V2_END_CMPL_ERRORS_SFT                     1
5599         /*
5600          * This error indicates that there was some sort of problem with
5601          * the BDs for the packet that was found after part of the
5602          * packet was already placed. The packet should be treated as
5603          * invalid.
5604          */
5605         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK \
5606                 UINT32_C(0xe)
5607         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
5608         /* No buffer error */
5609         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
5610                 (UINT32_C(0x0) << 1)
5611         /*
5612          * This error occurs when there is a fatal HW problem in
5613          * the chip only. It indicates that there were not
5614          * BDs on chip but that there was adequate reservation.
5615          * provided by the TPA block.
5616          */
5617         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
5618                 (UINT32_C(0x2) << 1)
5619         /*
5620          * Bad Format:
5621          * BDs were not formatted correctly.
5622          */
5623         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
5624                 (UINT32_C(0x3) << 1)
5625         /*
5626          * This error occurs when TPA block was not configured to
5627          * reserve adequate BDs for TPA operations on this RX
5628          * ring. All data for the TPA operation was not placed.
5629          *
5630          * This error can also be generated when the number of
5631          * segments is not programmed correctly in TPA and the
5632          * 33 total aggregation buffers allowed for the TPA
5633          * operation has been exceeded.
5634          */
5635         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
5636                 (UINT32_C(0x4) << 1)
5637         /*
5638          * Flush:
5639          * There was a bad_format error on the previous operation
5640          */
5641         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
5642                 (UINT32_C(0x5) << 1)
5643         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
5644                 RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
5645         uint16_t        unused_2;
5646         /*
5647          * This is the opaque value that was completed for the TPA start
5648          * completion that corresponds to this TPA end completion.
5649          */
5650         uint32_t        start_opaque;
5651 } __rte_packed;
5652
5653 /*
5654  * This TPA completion structure is used on devices where the
5655  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
5656  */
5657 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
5658 struct rx_tpa_v2_abuf_cmpl {
5659         uint16_t        type;
5660         /*
5661          * This field indicates the exact type of the completion.
5662          * By convention, the LSB identifies the length of the
5663          * record in 16B units. Even values indicate 16B
5664          * records. Odd values indicate 32B
5665          * records.
5666          */
5667         #define RX_TPA_V2_ABUF_CMPL_TYPE_MASK      UINT32_C(0x3f)
5668         #define RX_TPA_V2_ABUF_CMPL_TYPE_SFT       0
5669         /*
5670          * RX TPA Aggregation Buffer completion :
5671          * Completion of an L2 aggregation buffer in support of
5672          * TPA packet completion. Length = 16B
5673          */
5674         #define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG  UINT32_C(0x16)
5675         #define RX_TPA_V2_ABUF_CMPL_TYPE_LAST \
5676                 RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
5677         /*
5678          * This is the length of the data for the packet stored in this
5679          * aggregation buffer identified by the opaque value. This does not
5680          * include the length of any
5681          * data placed in other aggregation BDs or in the packet or buffer
5682          * BDs. This length does not include any space added due to
5683          * hdr_offset register during HDS placement mode.
5684          */
5685         uint16_t        len;
5686         /*
5687          * This is a copy of the opaque field from the RX BD this aggregation
5688          * buffer corresponds to.
5689          */
5690         uint32_t        opaque;
5691         uint16_t        v;
5692         /*
5693          * This value is written by the NIC such that it will be different
5694          * for each pass through the completion queue. The even passes
5695          * will write 1. The odd passes will write 0.
5696          */
5697         #define RX_TPA_V2_ABUF_CMPL_V     UINT32_C(0x1)
5698         /*
5699          * This is the aggregation ID that the completion is associated with. Use
5700          * this number to correlate the TPA agg completion with the TPA start
5701          * completion and the TPA end completion.
5702          */
5703         uint16_t        agg_id;
5704         uint32_t        unused_1;
5705 } __rte_packed;
5706
5707 /* rx_abuf_cmpl (size:128b/16B) */
5708 struct rx_abuf_cmpl {
5709         uint16_t        type;
5710         /*
5711          * This field indicates the exact type of the completion.
5712          * By convention, the LSB identifies the length of the
5713          * record in 16B units. Even values indicate 16B
5714          * records. Odd values indicate 32B
5715          * records.
5716          */
5717         #define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
5718         #define RX_ABUF_CMPL_TYPE_SFT   0
5719         /*
5720          * RX Aggregation Buffer completion :
5721          * Completion of an L2 aggregation buffer in support of
5722          * TPA, HDS, or Jumbo packet completion. Length = 16B
5723          */
5724         #define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
5725         #define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
5726         /*
5727          * This is the length of the data for the packet stored in this
5728          * aggregation buffer identified by the opaque value. This does not
5729          * include the length of any
5730          * data placed in other aggregation BDs or in the packet or buffer
5731          * BDs. This length does not include any space added due to
5732          * hdr_offset register during HDS placement mode.
5733          */
5734         uint16_t        len;
5735         /*
5736          * This is a copy of the opaque field from the RX BD this aggregation
5737          * buffer corresponds to.
5738          */
5739         uint32_t        opaque;
5740         uint32_t        v;
5741         /*
5742          * This value is written by the NIC such that it will be different
5743          * for each pass through the completion queue. The even passes
5744          * will write 1. The odd passes will write 0.
5745          */
5746         #define RX_ABUF_CMPL_V     UINT32_C(0x1)
5747         /* unused3 is 32 b */
5748         uint32_t        unused_2;
5749 } __rte_packed;
5750
5751 /* VEE FLUSH Completion Record (16 bytes) */
5752 /* vee_flush (size:128b/16B) */
5753 struct vee_flush {
5754         uint32_t        downstream_path_type;
5755         /*
5756          * This field indicates the exact type of the completion.
5757          * By convention, the LSB identifies the length of the
5758          * record in 16B units. Even values indicate 16B
5759          * records. Odd values indicate 32B
5760          * records.
5761          */
5762         #define VEE_FLUSH_TYPE_MASK           UINT32_C(0x3f)
5763         #define VEE_FLUSH_TYPE_SFT            0
5764         /*
5765          * VEE Flush Completion:
5766          * This completion is inserted manually by the Primate and processed
5767          * by the VEE hardware to ensure that all completions on a VEE
5768          * function have been processed by the VEE hardware before FLR
5769          * process is completed.
5770          */
5771         #define VEE_FLUSH_TYPE_VEE_FLUSH        UINT32_C(0x1c)
5772         #define VEE_FLUSH_TYPE_LAST            VEE_FLUSH_TYPE_VEE_FLUSH
5773         /* downstream_path is 1 b */
5774         #define VEE_FLUSH_DOWNSTREAM_PATH     UINT32_C(0x40)
5775         /* This completion is associated with VEE Transmit */
5776         #define VEE_FLUSH_DOWNSTREAM_PATH_TX    (UINT32_C(0x0) << 6)
5777         /* This completion is associated with VEE Receive */
5778         #define VEE_FLUSH_DOWNSTREAM_PATH_RX    (UINT32_C(0x1) << 6)
5779         #define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX
5780         /*
5781          * This is an opaque value that is passed through the completion
5782          * to the VEE handler SW and is used to indicate what VEE VQ or
5783          * function has completed FLR processing.
5784          */
5785         uint32_t        opaque;
5786         uint32_t        v;
5787         /*
5788          * This value is written by the NIC such that it will be different
5789          * for each pass through the completion queue. The even passes will
5790          * write 1. The odd passes will write 0.
5791          */
5792         #define VEE_FLUSH_V     UINT32_C(0x1)
5793         /* unused3 is 32 b */
5794         uint32_t        unused_3;
5795 } __rte_packed;
5796
5797 /* eject_cmpl (size:128b/16B) */
5798 struct eject_cmpl {
5799         uint16_t        type;
5800         /*
5801          * This field indicates the exact type of the completion.
5802          * By convention, the LSB identifies the length of the
5803          * record in 16B units. Even values indicate 16B
5804          * records. Odd values indicate 32B
5805          * records.
5806          */
5807         #define EJECT_CMPL_TYPE_MASK       UINT32_C(0x3f)
5808         #define EJECT_CMPL_TYPE_SFT        0
5809         /*
5810          * Statistics Ejection Completion:
5811          * Completion of statistics data ejection buffer.
5812          * Length = 16B
5813          */
5814         #define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
5815         #define EJECT_CMPL_TYPE_LAST        EJECT_CMPL_TYPE_STAT_EJECT
5816         #define EJECT_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
5817         #define EJECT_CMPL_FLAGS_SFT       6
5818         /*
5819          * When this bit is '1', it indicates a packet that has an
5820          * error of some type. Type of error is indicated in
5821          * error_flags.
5822          */
5823         #define EJECT_CMPL_FLAGS_ERROR      UINT32_C(0x40)
5824         /*
5825          * This is the length of the statistics data stored in this
5826          * buffer.
5827          */
5828         uint16_t        len;
5829         /*
5830          * This is a copy of the opaque field from the RX BD this ejection
5831          * buffer corresponds to.
5832          */
5833         uint32_t        opaque;
5834         uint16_t        v;
5835         /*
5836          * This value is written by the NIC such that it will be different
5837          * for each pass through the completion queue. The even passes
5838          * will write 1. The odd passes will write 0.
5839          */
5840         #define EJECT_CMPL_V                              UINT32_C(0x1)
5841         #define EJECT_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
5842         #define EJECT_CMPL_ERRORS_SFT                     1
5843         /*
5844          * This error indicates that there was some sort of problem with
5845          * the BDs for statistics ejection. The statistics ejection should
5846          * be treated as invalid
5847          */
5848         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
5849         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT         1
5850         /* No buffer error */
5851         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
5852                 (UINT32_C(0x0) << 1)
5853         /*
5854          * Did Not Fit:
5855          * Statistics did not fit into aggregation buffer provided.
5856          */
5857         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
5858                 (UINT32_C(0x1) << 1)
5859         /*
5860          * Bad Format:
5861          * BDs were not formatted correctly.
5862          */
5863         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
5864                 (UINT32_C(0x3) << 1)
5865         /*
5866          * Flush:
5867          * There was a bad_format error on the previous operation
5868          */
5869         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
5870                 (UINT32_C(0x5) << 1)
5871         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST \
5872                 EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
5873         /* reserved16 is 16 b */
5874         uint16_t        reserved16;
5875         /* unused3 is 32 b */
5876         uint32_t        unused_2;
5877 } __rte_packed;
5878
5879 /* hwrm_cmpl (size:128b/16B) */
5880 struct hwrm_cmpl {
5881         uint16_t        type;
5882         /*
5883          * This field indicates the exact type of the completion.
5884          * By convention, the LSB identifies the length of the
5885          * record in 16B units. Even values indicate 16B
5886          * records. Odd values indicate 32B
5887          * records.
5888          */
5889         #define HWRM_CMPL_TYPE_MASK     UINT32_C(0x3f)
5890         #define HWRM_CMPL_TYPE_SFT      0
5891         /*
5892          * HWRM Command Completion:
5893          * Completion of an HWRM command.
5894          */
5895         #define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
5896         #define HWRM_CMPL_TYPE_LAST      HWRM_CMPL_TYPE_HWRM_DONE
5897         /* This is the sequence_id of the HWRM command that has completed. */
5898         uint16_t        sequence_id;
5899         /* unused2 is 32 b */
5900         uint32_t        unused_1;
5901         uint32_t        v;
5902         /*
5903          * This value is written by the NIC such that it will be different
5904          * for each pass through the completion queue. The even passes
5905          * will write 1. The odd passes will write 0.
5906          */
5907         #define HWRM_CMPL_V     UINT32_C(0x1)
5908         /* unused4 is 32 b */
5909         uint32_t        unused_3;
5910 } __rte_packed;
5911
5912 /* hwrm_fwd_req_cmpl (size:128b/16B) */
5913 struct hwrm_fwd_req_cmpl {
5914         /*
5915          * This field indicates the exact type of the completion.
5916          * By convention, the LSB identifies the length of the
5917          * record in 16B units. Even values indicate 16B
5918          * records. Odd values indicate 32B
5919          * records.
5920          */
5921         uint16_t        req_len_type;
5922         /*
5923          * This field indicates the exact type of the completion.
5924          * By convention, the LSB identifies the length of the
5925          * record in 16B units. Even values indicate 16B
5926          * records. Odd values indicate 32B
5927          * records.
5928          */
5929         #define HWRM_FWD_REQ_CMPL_TYPE_MASK        UINT32_C(0x3f)
5930         #define HWRM_FWD_REQ_CMPL_TYPE_SFT         0
5931         /* Forwarded HWRM Request */
5932         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
5933         #define HWRM_FWD_REQ_CMPL_TYPE_LAST \
5934                 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
5935         /* Length of forwarded request in bytes. */
5936         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK     UINT32_C(0xffc0)
5937         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT      6
5938         /*
5939          * Source ID of this request.
5940          * Typically used in forwarding requests and responses.
5941          * 0x0 - 0xFFF8 - Used for function ids
5942          * 0xFFF8 - 0xFFFE - Reserved for internal processors
5943          * 0xFFFF - HWRM
5944          */
5945         uint16_t        source_id;
5946         /* unused1 is 32 b */
5947         uint32_t        unused0;
5948         /* Address of forwarded request. */
5949         uint32_t        req_buf_addr_v[2];
5950         /*
5951          * This value is written by the NIC such that it will be different
5952          * for each pass through the completion queue. The even passes
5953          * will write 1. The odd passes will write 0.
5954          */
5955         #define HWRM_FWD_REQ_CMPL_V                UINT32_C(0x1)
5956         /* Address of forwarded request. */
5957         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
5958         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
5959 } __rte_packed;
5960
5961 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
5962 struct hwrm_fwd_resp_cmpl {
5963         uint16_t        type;
5964         /*
5965          * This field indicates the exact type of the completion.
5966          * By convention, the LSB identifies the length of the
5967          * record in 16B units. Even values indicate 16B
5968          * records. Odd values indicate 32B
5969          * records.
5970          */
5971         #define HWRM_FWD_RESP_CMPL_TYPE_MASK         UINT32_C(0x3f)
5972         #define HWRM_FWD_RESP_CMPL_TYPE_SFT          0
5973         /* Forwarded HWRM Response */
5974         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
5975         #define HWRM_FWD_RESP_CMPL_TYPE_LAST \
5976                 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
5977         /*
5978          * Source ID of this response.
5979          * Typically used in forwarding requests and responses.
5980          * 0x0 - 0xFFF8 - Used for function ids
5981          * 0xFFF8 - 0xFFFE - Reserved for internal processors
5982          * 0xFFFF - HWRM
5983          */
5984         uint16_t        source_id;
5985         /* Length of forwarded response in bytes. */
5986         uint16_t        resp_len;
5987         /* unused2 is 16 b */
5988         uint16_t        unused_1;
5989         /* Address of forwarded request. */
5990         uint32_t        resp_buf_addr_v[2];
5991         /*
5992          * This value is written by the NIC such that it will be different
5993          * for each pass through the completion queue. The even passes
5994          * will write 1. The odd passes will write 0.
5995          */
5996         #define HWRM_FWD_RESP_CMPL_V                 UINT32_C(0x1)
5997         /* Address of forwarded request. */
5998         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
5999         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
6000 } __rte_packed;
6001
6002 /* hwrm_async_event_cmpl (size:128b/16B) */
6003 struct hwrm_async_event_cmpl {
6004         uint16_t        type;
6005         /*
6006          * This field indicates the exact type of the completion.
6007          * By convention, the LSB identifies the length of the
6008          * record in 16B units. Even values indicate 16B
6009          * records. Odd values indicate 32B
6010          * records.
6011          */
6012         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK            UINT32_C(0x3f)
6013         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT             0
6014         /* HWRM Asynchronous Event Information */
6015         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
6016         #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \
6017                 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
6018         /* Identifiers of events. */
6019         uint16_t        event_id;
6020         /* Link status changed */
6021         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
6022                 UINT32_C(0x0)
6023         /* Link MTU changed */
6024         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
6025                 UINT32_C(0x1)
6026         /* Link speed changed */
6027         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
6028                 UINT32_C(0x2)
6029         /* DCB Configuration changed */
6030         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
6031                 UINT32_C(0x3)
6032         /* Port connection not allowed */
6033         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
6034                 UINT32_C(0x4)
6035         /* Link speed configuration was not allowed */
6036         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
6037                 UINT32_C(0x5)
6038         /* Link speed configuration change */
6039         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \
6040                 UINT32_C(0x6)
6041         /* Port PHY configuration change */
6042         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \
6043                 UINT32_C(0x7)
6044         /* Reset notification to clients */
6045         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY \
6046                 UINT32_C(0x8)
6047         /* Master function selection event */
6048         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY \
6049                 UINT32_C(0x9)
6050         /* Function driver unloaded */
6051         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
6052                 UINT32_C(0x10)
6053         /* Function driver loaded */
6054         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
6055                 UINT32_C(0x11)
6056         /* Function FLR related processing has completed */
6057         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \
6058                 UINT32_C(0x12)
6059         /* PF driver unloaded */
6060         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
6061                 UINT32_C(0x20)
6062         /* PF driver loaded */
6063         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
6064                 UINT32_C(0x21)
6065         /* VF Function Level Reset (FLR) */
6066         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \
6067                 UINT32_C(0x30)
6068         /* VF MAC Address Change */
6069         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
6070                 UINT32_C(0x31)
6071         /* PF-VF communication channel status change. */
6072         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
6073                 UINT32_C(0x32)
6074         /* VF Configuration Change */
6075         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \
6076                 UINT32_C(0x33)
6077         /* LLFC/PFC Configuration Change */
6078         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \
6079                 UINT32_C(0x34)
6080         /* Default VNIC Configuration Change */
6081         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE \
6082                 UINT32_C(0x35)
6083         /* HW flow aged */
6084         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED \
6085                 UINT32_C(0x36)
6086         /*
6087          * A debug notification being posted to the driver. These
6088          * notifications are purely for diagnostic purpose and should not be
6089          * used for functional purpose. The driver is not supposed to act
6090          * on these messages except to log/record it.
6091          */
6092         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION \
6093                 UINT32_C(0x37)
6094         /*
6095          * An EEM flow cached memory flush for all flows request event being
6096          * posted to the PF driver.
6097          */
6098         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ \
6099                 UINT32_C(0x38)
6100         /*
6101          * An EEM flow cache memory flush completion event being posted to the
6102          * firmware by the PF driver. This is indication that host EEM flush
6103          * has completed by the PF.
6104          */
6105         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE \
6106                 UINT32_C(0x39)
6107         /*
6108          * A tcp flag action change event being posted to the PF or trusted VF
6109          * driver by the firmware. The PF or trusted VF driver should query
6110          * the firmware for the new TCP flag action update after receiving
6111          * this async event.
6112          */
6113         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
6114                 UINT32_C(0x3a)
6115         /*
6116          * An EEM flow active event being posted to the PF or trusted VF driver
6117          * by the firmware. The PF or trusted VF driver should update the
6118          * flow's aging timer after receiving this async event.
6119          */
6120         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE \
6121                 UINT32_C(0x3b)
6122         /*
6123          * A eem cfg change event being posted to the trusted VF driver by the
6124          * firmware if the parent PF EEM configuration changed.
6125          */
6126         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE \
6127                 UINT32_C(0x3c)
6128         /*
6129          * Deprecated.
6130          * TFLIB unique default VNIC Configuration Change
6131          */
6132         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE \
6133                 UINT32_C(0x3d)
6134         /*
6135          * Deprecated.
6136          * TFLIB unique link status changed
6137          */
6138         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE \
6139                 UINT32_C(0x3e)
6140         /*
6141          * An event signifying completion for HWRM_FW_STATE_QUIESCE
6142          * (completion, timeout, or error)
6143          */
6144         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE \
6145                 UINT32_C(0x3f)
6146         /*
6147          * An event signifying a HWRM command is in progress and its
6148          * response will be deferred. This event is used on crypto controllers
6149          * only.
6150          */
6151         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE \
6152                 UINT32_C(0x40)
6153         /*
6154          * An event signifying that a PFC WatchDog configuration
6155          * has changed on any port / cos.
6156          */
6157         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE \
6158                 UINT32_C(0x41)
6159         /*
6160          * A trace log message. This contains firmware trace logs string
6161          * embedded in the asynchronous message. This is an experimental
6162          * event, not meant for production use at this time.
6163          */
6164         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG \
6165                 UINT32_C(0xfe)
6166         /* HWRM Error */
6167         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
6168                 UINT32_C(0xff)
6169         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \
6170                 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
6171         /* Event specific data */
6172         uint32_t        event_data2;
6173         uint8_t opaque_v;
6174         /*
6175          * This value is written by the NIC such that it will be different
6176          * for each pass through the completion queue. The even passes
6177          * will write 1. The odd passes will write 0.
6178          */
6179         #define HWRM_ASYNC_EVENT_CMPL_V          UINT32_C(0x1)
6180         /* opaque is 7 b */
6181         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
6182         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
6183         /* 8-lsb timestamp from POR (100-msec resolution) */
6184         uint8_t timestamp_lo;
6185         /* 16-lsb timestamp from POR (100-msec resolution) */
6186         uint16_t        timestamp_hi;
6187         /* Event specific data */
6188         uint32_t        event_data1;
6189 } __rte_packed;
6190
6191 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
6192 struct hwrm_async_event_cmpl_link_status_change {
6193         uint16_t        type;
6194         /*
6195          * This field indicates the exact type of the completion.
6196          * By convention, the LSB identifies the length of the
6197          * record in 16B units. Even values indicate 16B
6198          * records. Odd values indicate 32B
6199          * records.
6200          */
6201         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \
6202                 UINT32_C(0x3f)
6203         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT             0
6204         /* HWRM Asynchronous Event Information */
6205         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6206                 UINT32_C(0x2e)
6207         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \
6208                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
6209         /* Identifiers of events. */
6210         uint16_t        event_id;
6211         /* Link status changed */
6212         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \
6213                 UINT32_C(0x0)
6214         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \
6215                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
6216         /* Event specific data */
6217         uint32_t        event_data2;
6218         uint8_t opaque_v;
6219         /*
6220          * This value is written by the NIC such that it will be different
6221          * for each pass through the completion queue. The even passes
6222          * will write 1. The odd passes will write 0.
6223          */
6224         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \
6225                 UINT32_C(0x1)
6226         /* opaque is 7 b */
6227         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \
6228                 UINT32_C(0xfe)
6229         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
6230         /* 8-lsb timestamp from POR (100-msec resolution) */
6231         uint8_t timestamp_lo;
6232         /* 16-lsb timestamp from POR (100-msec resolution) */
6233         uint16_t        timestamp_hi;
6234         /* Event specific data */
6235         uint32_t        event_data1;
6236         /* Indicates link status change */
6237         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \
6238                 UINT32_C(0x1)
6239         /*
6240          * If this bit set to 0, then it indicates that the link
6241          * was up and it went down.
6242          */
6243         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \
6244                 UINT32_C(0x0)
6245         /*
6246          * If this bit is set to 1, then it indicates that the link
6247          * was down and it went up.
6248          */
6249         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \
6250                 UINT32_C(0x1)
6251         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \
6252                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
6253         /* Indicates the physical port this link status change occur */
6254         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \
6255                 UINT32_C(0xe)
6256         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \
6257                 1
6258         /* PORT ID */
6259         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \
6260                 UINT32_C(0xffff0)
6261         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \
6262                 4
6263         /* Indicates the physical function this event occurred on. */
6264         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK \
6265                 UINT32_C(0xff00000)
6266         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \
6267                 20
6268 } __rte_packed;
6269
6270 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
6271 struct hwrm_async_event_cmpl_link_mtu_change {
6272         uint16_t        type;
6273         /*
6274          * This field indicates the exact type of the completion.
6275          * By convention, the LSB identifies the length of the
6276          * record in 16B units. Even values indicate 16B
6277          * records. Odd values indicate 32B
6278          * records.
6279          */
6280         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK \
6281                 UINT32_C(0x3f)
6282         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT             0
6283         /* HWRM Asynchronous Event Information */
6284         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6285                 UINT32_C(0x2e)
6286         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST \
6287                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
6288         /* Identifiers of events. */
6289         uint16_t        event_id;
6290         /* Link MTU changed */
6291         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE \
6292                 UINT32_C(0x1)
6293         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST \
6294                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
6295         /* Event specific data */
6296         uint32_t        event_data2;
6297         uint8_t opaque_v;
6298         /*
6299          * This value is written by the NIC such that it will be different
6300          * for each pass through the completion queue. The even passes
6301          * will write 1. The odd passes will write 0.
6302          */
6303         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V          UINT32_C(0x1)
6304         /* opaque is 7 b */
6305         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK \
6306                 UINT32_C(0xfe)
6307         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
6308         /* 8-lsb timestamp from POR (100-msec resolution) */
6309         uint8_t timestamp_lo;
6310         /* 16-lsb timestamp from POR (100-msec resolution) */
6311         uint16_t        timestamp_hi;
6312         /* Event specific data */
6313         uint32_t        event_data1;
6314         /* The new MTU of the link in bytes. */
6315         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \
6316                 UINT32_C(0xffff)
6317         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
6318 } __rte_packed;
6319
6320 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
6321 struct hwrm_async_event_cmpl_link_speed_change {
6322         uint16_t        type;
6323         /*
6324          * This field indicates the exact type of the completion.
6325          * By convention, the LSB identifies the length of the
6326          * record in 16B units. Even values indicate 16B
6327          * records. Odd values indicate 32B
6328          * records.
6329          */
6330         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK \
6331                 UINT32_C(0x3f)
6332         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT             0
6333         /* HWRM Asynchronous Event Information */
6334         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6335                 UINT32_C(0x2e)
6336         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST \
6337                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
6338         /* Identifiers of events. */
6339         uint16_t        event_id;
6340         /* Link speed changed */
6341         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE \
6342                 UINT32_C(0x2)
6343         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST \
6344                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
6345         /* Event specific data */
6346         uint32_t        event_data2;
6347         uint8_t opaque_v;
6348         /*
6349          * This value is written by the NIC such that it will be different
6350          * for each pass through the completion queue. The even passes
6351          * will write 1. The odd passes will write 0.
6352          */
6353         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V \
6354                 UINT32_C(0x1)
6355         /* opaque is 7 b */
6356         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK \
6357                 UINT32_C(0xfe)
6358         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
6359         /* 8-lsb timestamp from POR (100-msec resolution) */
6360         uint8_t timestamp_lo;
6361         /* 16-lsb timestamp from POR (100-msec resolution) */
6362         uint16_t        timestamp_hi;
6363         /* Event specific data */
6364         uint32_t        event_data1;
6365         /*
6366          * When this bit is '1', the link was forced to the
6367          * force_link_speed value.
6368          */
6369         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE \
6370                 UINT32_C(0x1)
6371         /* The new link speed in 100 Mbps units. */
6372         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK \
6373                 UINT32_C(0xfffe)
6374         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT \
6375                 1
6376         /* 100Mb link speed */
6377         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB \
6378                 (UINT32_C(0x1) << 1)
6379         /* 1Gb link speed */
6380         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB \
6381                 (UINT32_C(0xa) << 1)
6382         /* 2Gb link speed */
6383         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB \
6384                 (UINT32_C(0x14) << 1)
6385         /* 25Gb link speed */
6386         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB \
6387                 (UINT32_C(0x19) << 1)
6388         /* 10Gb link speed */
6389         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB \
6390                 (UINT32_C(0x64) << 1)
6391         /* 20Mb link speed */
6392         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB \
6393                 (UINT32_C(0xc8) << 1)
6394         /* 25Gb link speed */
6395         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB \
6396                 (UINT32_C(0xfa) << 1)
6397         /* 40Gb link speed */
6398         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB \
6399                 (UINT32_C(0x190) << 1)
6400         /* 50Gb link speed */
6401         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB \
6402                 (UINT32_C(0x1f4) << 1)
6403         /* 100Gb link speed */
6404         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB \
6405                 (UINT32_C(0x3e8) << 1)
6406         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST \
6407                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
6408         /* PORT ID */
6409         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK \
6410                 UINT32_C(0xffff0000)
6411         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \
6412                 16
6413 } __rte_packed;
6414
6415 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
6416 struct hwrm_async_event_cmpl_dcb_config_change {
6417         uint16_t        type;
6418         /*
6419          * This field indicates the exact type of the completion.
6420          * By convention, the LSB identifies the length of the
6421          * record in 16B units. Even values indicate 16B
6422          * records. Odd values indicate 32B
6423          * records.
6424          */
6425         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK \
6426                 UINT32_C(0x3f)
6427         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT             0
6428         /* HWRM Asynchronous Event Information */
6429         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6430                 UINT32_C(0x2e)
6431         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST \
6432                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
6433         /* Identifiers of events. */
6434         uint16_t        event_id;
6435         /* DCB Configuration changed */
6436         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE \
6437                 UINT32_C(0x3)
6438         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST \
6439                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
6440         /* Event specific data */
6441         uint32_t        event_data2;
6442         /* ETS configuration change */
6443         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS \
6444                 UINT32_C(0x1)
6445         /* PFC configuration change */
6446         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC \
6447                 UINT32_C(0x2)
6448         /* APP configuration change */
6449         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP \
6450                 UINT32_C(0x4)
6451         uint8_t opaque_v;
6452         /*
6453          * This value is written by the NIC such that it will be different
6454          * for each pass through the completion queue. The even passes
6455          * will write 1. The odd passes will write 0.
6456          */
6457         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V \
6458                 UINT32_C(0x1)
6459         /* opaque is 7 b */
6460         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK \
6461                 UINT32_C(0xfe)
6462         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
6463         /* 8-lsb timestamp from POR (100-msec resolution) */
6464         uint8_t timestamp_lo;
6465         /* 16-lsb timestamp from POR (100-msec resolution) */
6466         uint16_t        timestamp_hi;
6467         /* Event specific data */
6468         uint32_t        event_data1;
6469         /* PORT ID */
6470         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
6471                 UINT32_C(0xffff)
6472         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
6473                 0
6474         /* Priority recommended for RoCE traffic */
6475         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK \
6476                 UINT32_C(0xff0000)
6477         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT \
6478                 16
6479         /* none is 255 */
6480         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE \
6481                 (UINT32_C(0xff) << 16)
6482         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST \
6483                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
6484         /* Priority recommended for L2 traffic */
6485         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK \
6486                 UINT32_C(0xff000000)
6487         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT \
6488                 24
6489         /* none is 255 */
6490         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE \
6491                 (UINT32_C(0xff) << 24)
6492         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \
6493                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
6494 } __rte_packed;
6495
6496 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
6497 struct hwrm_async_event_cmpl_port_conn_not_allowed {
6498         uint16_t        type;
6499         /*
6500          * This field indicates the exact type of the completion.
6501          * By convention, the LSB identifies the length of the
6502          * record in 16B units. Even values indicate 16B
6503          * records. Odd values indicate 32B
6504          * records.
6505          */
6506         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK \
6507                 UINT32_C(0x3f)
6508         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT \
6509                 0
6510         /* HWRM Asynchronous Event Information */
6511         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
6512                 UINT32_C(0x2e)
6513         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST \
6514                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
6515         /* Identifiers of events. */
6516         uint16_t        event_id;
6517         /* Port connection not allowed */
6518         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED \
6519                 UINT32_C(0x4)
6520         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST \
6521                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
6522         /* Event specific data */
6523         uint32_t        event_data2;
6524         uint8_t opaque_v;
6525         /*
6526          * This value is written by the NIC such that it will be different
6527          * for each pass through the completion queue. The even passes
6528          * will write 1. The odd passes will write 0.
6529          */
6530         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V \
6531                 UINT32_C(0x1)
6532         /* opaque is 7 b */
6533         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK \
6534                 UINT32_C(0xfe)
6535         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
6536         /* 8-lsb timestamp from POR (100-msec resolution) */
6537         uint8_t timestamp_lo;
6538         /* 16-lsb timestamp from POR (100-msec resolution) */
6539         uint16_t        timestamp_hi;
6540         /* Event specific data */
6541         uint32_t        event_data1;
6542         /* PORT ID */
6543         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
6544                 UINT32_C(0xffff)
6545         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
6546                 0
6547         /*
6548          * This value indicates the current port level enforcement policy
6549          * for the optics module when there is an optical module mismatch
6550          * and port is not connected.
6551          */
6552         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK \
6553                 UINT32_C(0xff0000)
6554         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT \
6555                 16
6556         /* No enforcement */
6557         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE \
6558                 (UINT32_C(0x0) << 16)
6559         /* Disable Transmit side Laser. */
6560         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX \
6561                 (UINT32_C(0x1) << 16)
6562         /* Raise a warning message. */
6563         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG \
6564                 (UINT32_C(0x2) << 16)
6565         /* Power down the module. */
6566         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN \
6567                 (UINT32_C(0x3) << 16)
6568         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \
6569                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
6570 } __rte_packed;
6571
6572 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
6573 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
6574         uint16_t        type;
6575         /*
6576          * This field indicates the exact type of the completion.
6577          * By convention, the LSB identifies the length of the
6578          * record in 16B units. Even values indicate 16B
6579          * records. Odd values indicate 32B
6580          * records.
6581          */
6582         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK \
6583                 UINT32_C(0x3f)
6584         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT \
6585                 0
6586         /* HWRM Asynchronous Event Information */
6587         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
6588                 UINT32_C(0x2e)
6589         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST \
6590                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
6591         /* Identifiers of events. */
6592         uint16_t        event_id;
6593         /* Link speed configuration was not allowed */
6594         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
6595                 UINT32_C(0x5)
6596         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST \
6597                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
6598         /* Event specific data */
6599         uint32_t        event_data2;
6600         uint8_t opaque_v;
6601         /*
6602          * This value is written by the NIC such that it will be different
6603          * for each pass through the completion queue. The even passes
6604          * will write 1. The odd passes will write 0.
6605          */
6606         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V \
6607                 UINT32_C(0x1)
6608         /* opaque is 7 b */
6609         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK \
6610                 UINT32_C(0xfe)
6611         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
6612         /* 8-lsb timestamp from POR (100-msec resolution) */
6613         uint8_t timestamp_lo;
6614         /* 16-lsb timestamp from POR (100-msec resolution) */
6615         uint16_t        timestamp_hi;
6616         /* Event specific data */
6617         uint32_t        event_data1;
6618         /* PORT ID */
6619         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
6620                 UINT32_C(0xffff)
6621         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
6622                 0
6623 } __rte_packed;
6624
6625 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
6626 struct hwrm_async_event_cmpl_link_speed_cfg_change {
6627         uint16_t        type;
6628         /*
6629          * This field indicates the exact type of the completion.
6630          * By convention, the LSB identifies the length of the
6631          * record in 16B units. Even values indicate 16B
6632          * records. Odd values indicate 32B
6633          * records.
6634          */
6635         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK \
6636                 UINT32_C(0x3f)
6637         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT \
6638                 0
6639         /* HWRM Asynchronous Event Information */
6640         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6641                 UINT32_C(0x2e)
6642         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST \
6643                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
6644         /* Identifiers of events. */
6645         uint16_t        event_id;
6646         /* Link speed configuration change */
6647         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE \
6648                 UINT32_C(0x6)
6649         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST \
6650                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
6651         /* Event specific data */
6652         uint32_t        event_data2;
6653         uint8_t opaque_v;
6654         /*
6655          * This value is written by the NIC such that it will be different
6656          * for each pass through the completion queue. The even passes
6657          * will write 1. The odd passes will write 0.
6658          */
6659         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V \
6660                 UINT32_C(0x1)
6661         /* opaque is 7 b */
6662         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK \
6663                 UINT32_C(0xfe)
6664         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
6665         /* 8-lsb timestamp from POR (100-msec resolution) */
6666         uint8_t timestamp_lo;
6667         /* 16-lsb timestamp from POR (100-msec resolution) */
6668         uint16_t        timestamp_hi;
6669         /* Event specific data */
6670         uint32_t        event_data1;
6671         /* PORT ID */
6672         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
6673                 UINT32_C(0xffff)
6674         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
6675                 0
6676         /*
6677          * If set to 1, it indicates that the supported link speeds
6678          * configuration on the port has changed.
6679          * If set to 0, then there is no change in supported link speeds
6680          * configuration.
6681          */
6682         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE \
6683                 UINT32_C(0x10000)
6684         /*
6685          * If set to 1, it indicates that the link speed configuration
6686          * on the port has become illegal or invalid.
6687          * If set to 0, then the link speed configuration on the port is
6688          * legal or valid.
6689          */
6690         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \
6691                 UINT32_C(0x20000)
6692 } __rte_packed;
6693
6694 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
6695 struct hwrm_async_event_cmpl_port_phy_cfg_change {
6696         uint16_t        type;
6697         /*
6698          * This field indicates the exact type of the completion.
6699          * By convention, the LSB identifies the length of the
6700          * record in 16B units. Even values indicate 16B
6701          * records. Odd values indicate 32B
6702          * records.
6703          */
6704         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK \
6705                 UINT32_C(0x3f)
6706         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT \
6707                 0
6708         /* HWRM Asynchronous Event Information */
6709         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6710                 UINT32_C(0x2e)
6711         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST \
6712                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
6713         /* Identifiers of events. */
6714         uint16_t        event_id;
6715         /* Port PHY configuration change */
6716         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE \
6717                 UINT32_C(0x7)
6718         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST \
6719                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
6720         /* Event specific data */
6721         uint32_t        event_data2;
6722         uint8_t opaque_v;
6723         /*
6724          * This value is written by the NIC such that it will be different
6725          * for each pass through the completion queue. The even passes
6726          * will write 1. The odd passes will write 0.
6727          */
6728         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V \
6729                 UINT32_C(0x1)
6730         /* opaque is 7 b */
6731         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK \
6732                 UINT32_C(0xfe)
6733         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
6734         /* 8-lsb timestamp from POR (100-msec resolution) */
6735         uint8_t timestamp_lo;
6736         /* 16-lsb timestamp from POR (100-msec resolution) */
6737         uint16_t        timestamp_hi;
6738         /* Event specific data */
6739         uint32_t        event_data1;
6740         /* PORT ID */
6741         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
6742                 UINT32_C(0xffff)
6743         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
6744                 0
6745         /*
6746          * If set to 1, it indicates that the FEC
6747          * configuration on the port has changed.
6748          * If set to 0, then there is no change in FEC configuration.
6749          */
6750         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE \
6751                 UINT32_C(0x10000)
6752         /*
6753          * If set to 1, it indicates that the EEE configuration
6754          * on the port has changed.
6755          * If set to 0, then there is no change in EEE configuration
6756          * on the port.
6757          */
6758         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE \
6759                 UINT32_C(0x20000)
6760         /*
6761          * If set to 1, it indicates that the pause configuration
6762          * on the PHY has changed.
6763          * If set to 0, then there is no change in the pause
6764          * configuration on the PHY.
6765          */
6766         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \
6767                 UINT32_C(0x40000)
6768 } __rte_packed;
6769
6770 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
6771 struct hwrm_async_event_cmpl_reset_notify {
6772         uint16_t        type;
6773         /*
6774          * This field indicates the exact type of the completion.
6775          * By convention, the LSB identifies the length of the
6776          * record in 16B units. Even values indicate 16B
6777          * records. Odd values indicate 32B
6778          * records.
6779          */
6780         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK \
6781                 UINT32_C(0x3f)
6782         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT             0
6783         /* HWRM Asynchronous Event Information */
6784         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT \
6785                 UINT32_C(0x2e)
6786         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST \
6787                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
6788         /* Identifiers of events. */
6789         uint16_t        event_id;
6790         /* Notify clients of imminent reset. */
6791         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY \
6792                 UINT32_C(0x8)
6793         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST \
6794                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
6795         /* Event specific data */
6796         uint32_t        event_data2;
6797         uint8_t opaque_v;
6798         /*
6799          * This value is written by the NIC such that it will be different
6800          * for each pass through the completion queue. The even passes
6801          * will write 1. The odd passes will write 0.
6802          */
6803         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V          UINT32_C(0x1)
6804         /* opaque is 7 b */
6805         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
6806         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
6807         /*
6808          * 8-lsb timestamp (100-msec resolution)
6809          * The Minimum time required for the Firmware readiness after sending this
6810          * notification to the driver instances.
6811          */
6812         uint8_t timestamp_lo;
6813         /*
6814          * 16-lsb timestamp (100-msec resolution)
6815          * The Maximum Firmware Reset bail out value in the order of 100
6816          * milli seconds. The driver instances will use this value to re-initiate the
6817          * registration process again if the core firmware didn’t set the ready
6818          * state bit.
6819          */
6820         uint16_t        timestamp_hi;
6821         /* Event specific data */
6822         uint32_t        event_data1;
6823         /* Indicates driver action requested */
6824         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK \
6825                 UINT32_C(0xff)
6826         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT \
6827                 0
6828         /*
6829          * If set to 1, it indicates that the l2 client should
6830          * stop sending in band traffic to Nitro.
6831          * if set to 0, there is no change in L2 client behavior.
6832          */
6833         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE \
6834                 UINT32_C(0x1)
6835         /*
6836          * If set to 1, it indicates that the L2 client should
6837          * bring down the interface.
6838          * If set to 0, then there is no change in L2 client behavior.
6839          */
6840         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN \
6841                 UINT32_C(0x2)
6842         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST \
6843                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
6844         /* Indicates reason for reset. */
6845         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK \
6846                 UINT32_C(0xff00)
6847         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT \
6848                 8
6849         /* A management client has requested reset. */
6850         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST \
6851                 (UINT32_C(0x1) << 8)
6852         /* A fatal firmware exception has occurred. */
6853         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL \
6854                 (UINT32_C(0x2) << 8)
6855         /* A non-fatal firmware exception has occurred. */
6856         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL \
6857                 (UINT32_C(0x3) << 8)
6858         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST \
6859                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL
6860         /*
6861          * Minimum time before driver should attempt access - units 100ms ticks.
6862          * Range 0-65535
6863          */
6864         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK \
6865                 UINT32_C(0xffff0000)
6866         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \
6867                 16
6868 } __rte_packed;
6869
6870 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
6871 struct hwrm_async_event_cmpl_error_recovery {
6872         uint16_t        type;
6873         /*
6874          * This field indicates the exact type of the completion.
6875          * By convention, the LSB identifies the length of the
6876          * record in 16B units. Even values indicate 16B
6877          * records. Odd values indicate 32B
6878          * records.
6879          */
6880         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK \
6881                 UINT32_C(0x3f)
6882         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT             0
6883         /* HWRM Asynchronous Event Information */
6884         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT \
6885                 UINT32_C(0x2e)
6886         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST \
6887                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
6888         /* Identifiers of events. */
6889         uint16_t        event_id;
6890         /*
6891          * This async notification message can be used for selecting or
6892          * deselecting master function for error recovery,
6893          * and to communicate to all the functions whether error recovery
6894          * was enabled/disabled.
6895          */
6896         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY \
6897                 UINT32_C(0x9)
6898         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST \
6899                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
6900         /* Event specific data */
6901         uint32_t        event_data2;
6902         uint8_t opaque_v;
6903         /*
6904          * This value is written by the NIC such that it will be different
6905          * for each pass through the completion queue. The even passes
6906          * will write 1. The odd passes will write 0.
6907          */
6908         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V          UINT32_C(0x1)
6909         /* opaque is 7 b */
6910         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
6911         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
6912         /* 8-lsb timestamp (100-msec resolution) */
6913         uint8_t timestamp_lo;
6914         /* 16-lsb timestamp (100-msec resolution) */
6915         uint16_t        timestamp_hi;
6916         /* Event specific data */
6917         uint32_t        event_data1;
6918         /* Indicates driver action requested */
6919         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK \
6920                 UINT32_C(0xff)
6921         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT \
6922                 0
6923         /*
6924          * If set to 1, this function is selected as Master function.
6925          * This function has responsibility to do 'chip reset' when it
6926          * detects a fatal error. If set to 0, master function functionality
6927          * is disabled on this function.
6928          */
6929         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC \
6930                 UINT32_C(0x1)
6931         /*
6932          * If set to 1, error recovery is enabled.
6933          * If set to 0, error recovery is disabled.
6934          */
6935         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED \
6936                 UINT32_C(0x2)
6937 } __rte_packed;
6938
6939 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
6940 struct hwrm_async_event_cmpl_func_drvr_unload {
6941         uint16_t        type;
6942         /*
6943          * This field indicates the exact type of the completion.
6944          * By convention, the LSB identifies the length of the
6945          * record in 16B units. Even values indicate 16B
6946          * records. Odd values indicate 32B
6947          * records.
6948          */
6949         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK \
6950                 UINT32_C(0x3f)
6951         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT             0
6952         /* HWRM Asynchronous Event Information */
6953         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
6954                 UINT32_C(0x2e)
6955         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST \
6956                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
6957         /* Identifiers of events. */
6958         uint16_t        event_id;
6959         /* Function driver unloaded */
6960         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD \
6961                 UINT32_C(0x10)
6962         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST \
6963                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
6964         /* Event specific data */
6965         uint32_t        event_data2;
6966         uint8_t opaque_v;
6967         /*
6968          * This value is written by the NIC such that it will be different
6969          * for each pass through the completion queue. The even passes
6970          * will write 1. The odd passes will write 0.
6971          */
6972         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V          UINT32_C(0x1)
6973         /* opaque is 7 b */
6974         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK \
6975                 UINT32_C(0xfe)
6976         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
6977         /* 8-lsb timestamp from POR (100-msec resolution) */
6978         uint8_t timestamp_lo;
6979         /* 16-lsb timestamp from POR (100-msec resolution) */
6980         uint16_t        timestamp_hi;
6981         /* Event specific data */
6982         uint32_t        event_data1;
6983         /* Function ID */
6984         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
6985                 UINT32_C(0xffff)
6986         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \
6987                 0
6988 } __rte_packed;
6989
6990 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
6991 struct hwrm_async_event_cmpl_func_drvr_load {
6992         uint16_t        type;
6993         /*
6994          * This field indicates the exact type of the completion.
6995          * By convention, the LSB identifies the length of the
6996          * record in 16B units. Even values indicate 16B
6997          * records. Odd values indicate 32B
6998          * records.
6999          */
7000         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK \
7001                 UINT32_C(0x3f)
7002         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT             0
7003         /* HWRM Asynchronous Event Information */
7004         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
7005                 UINT32_C(0x2e)
7006         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST \
7007                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
7008         /* Identifiers of events. */
7009         uint16_t        event_id;
7010         /* Function driver loaded */
7011         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD \
7012                 UINT32_C(0x11)
7013         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST \
7014                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
7015         /* Event specific data */
7016         uint32_t        event_data2;
7017         uint8_t opaque_v;
7018         /*
7019          * This value is written by the NIC such that it will be different
7020          * for each pass through the completion queue. The even passes
7021          * will write 1. The odd passes will write 0.
7022          */
7023         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V          UINT32_C(0x1)
7024         /* opaque is 7 b */
7025         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
7026         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
7027         /* 8-lsb timestamp from POR (100-msec resolution) */
7028         uint8_t timestamp_lo;
7029         /* 16-lsb timestamp from POR (100-msec resolution) */
7030         uint16_t        timestamp_hi;
7031         /* Event specific data */
7032         uint32_t        event_data1;
7033         /* Function ID */
7034         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
7035                 UINT32_C(0xffff)
7036         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
7037 } __rte_packed;
7038
7039 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
7040 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
7041         uint16_t        type;
7042         /*
7043          * This field indicates the exact type of the completion.
7044          * By convention, the LSB identifies the length of the
7045          * record in 16B units. Even values indicate 16B
7046          * records. Odd values indicate 32B
7047          * records.
7048          */
7049         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK \
7050                 UINT32_C(0x3f)
7051         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT \
7052                 0
7053         /* HWRM Asynchronous Event Information */
7054         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT \
7055                 UINT32_C(0x2e)
7056         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST \
7057                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
7058         /* Identifiers of events. */
7059         uint16_t        event_id;
7060         /* Function FLR related processing has completed */
7061         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT \
7062                 UINT32_C(0x12)
7063         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST \
7064                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
7065         /* Event specific data */
7066         uint32_t        event_data2;
7067         uint8_t opaque_v;
7068         /*
7069          * This value is written by the NIC such that it will be different
7070          * for each pass through the completion queue. The even passes
7071          * will write 1. The odd passes will write 0.
7072          */
7073         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V \
7074                 UINT32_C(0x1)
7075         /* opaque is 7 b */
7076         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK \
7077                 UINT32_C(0xfe)
7078         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
7079         /* 8-lsb timestamp from POR (100-msec resolution) */
7080         uint8_t timestamp_lo;
7081         /* 16-lsb timestamp from POR (100-msec resolution) */
7082         uint16_t        timestamp_hi;
7083         /* Event specific data */
7084         uint32_t        event_data1;
7085         /* Function ID */
7086         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK \
7087                 UINT32_C(0xffff)
7088         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \
7089                 0
7090 } __rte_packed;
7091
7092 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
7093 struct hwrm_async_event_cmpl_pf_drvr_unload {
7094         uint16_t        type;
7095         /*
7096          * This field indicates the exact type of the completion.
7097          * By convention, the LSB identifies the length of the
7098          * record in 16B units. Even values indicate 16B
7099          * records. Odd values indicate 32B
7100          * records.
7101          */
7102         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK \
7103                 UINT32_C(0x3f)
7104         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT             0
7105         /* HWRM Asynchronous Event Information */
7106         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
7107                 UINT32_C(0x2e)
7108         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST \
7109                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
7110         /* Identifiers of events. */
7111         uint16_t        event_id;
7112         /* PF driver unloaded */
7113         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD \
7114                 UINT32_C(0x20)
7115         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST \
7116                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
7117         /* Event specific data */
7118         uint32_t        event_data2;
7119         uint8_t opaque_v;
7120         /*
7121          * This value is written by the NIC such that it will be different
7122          * for each pass through the completion queue. The even passes
7123          * will write 1. The odd passes will write 0.
7124          */
7125         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V          UINT32_C(0x1)
7126         /* opaque is 7 b */
7127         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
7128         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
7129         /* 8-lsb timestamp from POR (100-msec resolution) */
7130         uint8_t timestamp_lo;
7131         /* 16-lsb timestamp from POR (100-msec resolution) */
7132         uint16_t        timestamp_hi;
7133         /* Event specific data */
7134         uint32_t        event_data1;
7135         /* PF ID */
7136         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
7137                 UINT32_C(0xffff)
7138         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
7139         /* Indicates the physical port this pf belongs to */
7140         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \
7141                 UINT32_C(0x70000)
7142         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT    16
7143 } __rte_packed;
7144
7145 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
7146 struct hwrm_async_event_cmpl_pf_drvr_load {
7147         uint16_t        type;
7148         /*
7149          * This field indicates the exact type of the completion.
7150          * By convention, the LSB identifies the length of the
7151          * record in 16B units. Even values indicate 16B
7152          * records. Odd values indicate 32B
7153          * records.
7154          */
7155         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK \
7156                 UINT32_C(0x3f)
7157         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT             0
7158         /* HWRM Asynchronous Event Information */
7159         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
7160                 UINT32_C(0x2e)
7161         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST \
7162                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
7163         /* Identifiers of events. */
7164         uint16_t        event_id;
7165         /* PF driver loaded */
7166         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD \
7167                 UINT32_C(0x21)
7168         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST \
7169                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
7170         /* Event specific data */
7171         uint32_t        event_data2;
7172         uint8_t opaque_v;
7173         /*
7174          * This value is written by the NIC such that it will be different
7175          * for each pass through the completion queue. The even passes
7176          * will write 1. The odd passes will write 0.
7177          */
7178         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V          UINT32_C(0x1)
7179         /* opaque is 7 b */
7180         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
7181         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
7182         /* 8-lsb timestamp from POR (100-msec resolution) */
7183         uint8_t timestamp_lo;
7184         /* 16-lsb timestamp from POR (100-msec resolution) */
7185         uint16_t        timestamp_hi;
7186         /* Event specific data */
7187         uint32_t        event_data1;
7188         /* PF ID */
7189         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
7190                 UINT32_C(0xffff)
7191         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
7192         /* Indicates the physical port this pf belongs to */
7193         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \
7194                 UINT32_C(0x70000)
7195         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT    16
7196 } __rte_packed;
7197
7198 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
7199 struct hwrm_async_event_cmpl_vf_flr {
7200         uint16_t        type;
7201         /*
7202          * This field indicates the exact type of the completion.
7203          * By convention, the LSB identifies the length of the
7204          * record in 16B units. Even values indicate 16B
7205          * records. Odd values indicate 32B
7206          * records.
7207          */
7208         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK \
7209                 UINT32_C(0x3f)
7210         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT             0
7211         /* HWRM Asynchronous Event Information */
7212         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT \
7213                 UINT32_C(0x2e)
7214         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST \
7215                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
7216         /* Identifiers of events. */
7217         uint16_t        event_id;
7218         /* VF Function Level Reset (FLR) */
7219         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
7220         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST \
7221                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
7222         /* Event specific data */
7223         uint32_t        event_data2;
7224         uint8_t opaque_v;
7225         /*
7226          * This value is written by the NIC such that it will be different
7227          * for each pass through the completion queue. The even passes
7228          * will write 1. The odd passes will write 0.
7229          */
7230         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V          UINT32_C(0x1)
7231         /* opaque is 7 b */
7232         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
7233         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
7234         /* 8-lsb timestamp from POR (100-msec resolution) */
7235         uint8_t timestamp_lo;
7236         /* 16-lsb timestamp from POR (100-msec resolution) */
7237         uint16_t        timestamp_hi;
7238         /* Event specific data */
7239         uint32_t        event_data1;
7240         /* VF ID */
7241         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK \
7242                 UINT32_C(0xffff)
7243         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
7244         /* Indicates the physical function this event occurred on. */
7245         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \
7246                 UINT32_C(0xff0000)
7247         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
7248 } __rte_packed;
7249
7250 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
7251 struct hwrm_async_event_cmpl_vf_mac_addr_change {
7252         uint16_t        type;
7253         /*
7254          * This field indicates the exact type of the completion.
7255          * By convention, the LSB identifies the length of the
7256          * record in 16B units. Even values indicate 16B
7257          * records. Odd values indicate 32B
7258          * records.
7259          */
7260         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK \
7261                 UINT32_C(0x3f)
7262         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT             0
7263         /* HWRM Asynchronous Event Information */
7264         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7265                 UINT32_C(0x2e)
7266         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST \
7267                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
7268         /* Identifiers of events. */
7269         uint16_t        event_id;
7270         /* VF MAC Address Change */
7271         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE \
7272                 UINT32_C(0x31)
7273         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST \
7274                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
7275         /* Event specific data */
7276         uint32_t        event_data2;
7277         uint8_t opaque_v;
7278         /*
7279          * This value is written by the NIC such that it will be different
7280          * for each pass through the completion queue. The even passes
7281          * will write 1. The odd passes will write 0.
7282          */
7283         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V \
7284                 UINT32_C(0x1)
7285         /* opaque is 7 b */
7286         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK \
7287                 UINT32_C(0xfe)
7288         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
7289         /* 8-lsb timestamp from POR (100-msec resolution) */
7290         uint8_t timestamp_lo;
7291         /* 16-lsb timestamp from POR (100-msec resolution) */
7292         uint16_t        timestamp_hi;
7293         /* Event specific data */
7294         uint32_t        event_data1;
7295         /* VF ID */
7296         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK \
7297                 UINT32_C(0xffff)
7298         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \
7299                 0
7300 } __rte_packed;
7301
7302 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
7303 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
7304         uint16_t        type;
7305         /*
7306          * This field indicates the exact type of the completion.
7307          * By convention, the LSB identifies the length of the
7308          * record in 16B units. Even values indicate 16B
7309          * records. Odd values indicate 32B
7310          * records.
7311          */
7312         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK \
7313                 UINT32_C(0x3f)
7314         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT \
7315                 0
7316         /* HWRM Asynchronous Event Information */
7317         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7318                 UINT32_C(0x2e)
7319         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST \
7320                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
7321         /* Identifiers of events. */
7322         uint16_t        event_id;
7323         /* PF-VF communication channel status change. */
7324         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
7325                 UINT32_C(0x32)
7326         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST \
7327                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
7328         /* Event specific data */
7329         uint32_t        event_data2;
7330         uint8_t opaque_v;
7331         /*
7332          * This value is written by the NIC such that it will be different
7333          * for each pass through the completion queue. The even passes
7334          * will write 1. The odd passes will write 0.
7335          */
7336         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V \
7337                 UINT32_C(0x1)
7338         /* opaque is 7 b */
7339         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK \
7340                 UINT32_C(0xfe)
7341         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
7342         /* 8-lsb timestamp from POR (100-msec resolution) */
7343         uint8_t timestamp_lo;
7344         /* 16-lsb timestamp from POR (100-msec resolution) */
7345         uint16_t        timestamp_hi;
7346         /* Event specific data */
7347         uint32_t        event_data1;
7348         /*
7349          * If this bit is set to 1, then it indicates that the PF-VF
7350          * communication was lost and it is established.
7351          * If this bit set to 0, then it indicates that the PF-VF
7352          * communication was established and it is lost.
7353          */
7354         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \
7355                 UINT32_C(0x1)
7356 } __rte_packed;
7357
7358 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
7359 struct hwrm_async_event_cmpl_vf_cfg_change {
7360         uint16_t        type;
7361         /*
7362          * This field indicates the exact type of the completion.
7363          * By convention, the LSB identifies the length of the
7364          * record in 16B units. Even values indicate 16B
7365          * records. Odd values indicate 32B
7366          * records.
7367          */
7368         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK \
7369                 UINT32_C(0x3f)
7370         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT             0
7371         /* HWRM Asynchronous Event Information */
7372         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7373                 UINT32_C(0x2e)
7374         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST \
7375                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
7376         /* Identifiers of events. */
7377         uint16_t        event_id;
7378         /* VF Configuration Change */
7379         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE \
7380                 UINT32_C(0x33)
7381         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST \
7382                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
7383         /* Event specific data */
7384         uint32_t        event_data2;
7385         uint8_t opaque_v;
7386         /*
7387          * This value is written by the NIC such that it will be different
7388          * for each pass through the completion queue. The even passes
7389          * will write 1. The odd passes will write 0.
7390          */
7391         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V          UINT32_C(0x1)
7392         /* opaque is 7 b */
7393         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
7394         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
7395         /* 8-lsb timestamp from POR (100-msec resolution) */
7396         uint8_t timestamp_lo;
7397         /* 16-lsb timestamp from POR (100-msec resolution) */
7398         uint16_t        timestamp_hi;
7399         /*
7400          * Each flag provided in this field indicates a specific VF
7401          * configuration change. At least one of these flags shall be set to 1
7402          * when an asynchronous event completion of this type is provided
7403          * by the HWRM.
7404          */
7405         uint32_t        event_data1;
7406         /*
7407          * If this bit is set to 1, then the value of MTU
7408          * was changed on this VF.
7409          * If set to 0, then this bit should be ignored.
7410          */
7411         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE \
7412                 UINT32_C(0x1)
7413         /*
7414          * If this bit is set to 1, then the value of MRU
7415          * was changed on this VF.
7416          * If set to 0, then this bit should be ignored.
7417          */
7418         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE \
7419                 UINT32_C(0x2)
7420         /*
7421          * If this bit is set to 1, then the value of default MAC
7422          * address was changed on this VF.
7423          * If set to 0, then this bit should be ignored.
7424          */
7425         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE \
7426                 UINT32_C(0x4)
7427         /*
7428          * If this bit is set to 1, then the value of default VLAN
7429          * was changed on this VF.
7430          * If set to 0, then this bit should be ignored.
7431          */
7432         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE \
7433                 UINT32_C(0x8)
7434         /*
7435          * If this bit is set to 1, then the value of trusted VF enable
7436          * was changed on this VF.
7437          * If set to 0, then this bit should be ignored.
7438          */
7439         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \
7440                 UINT32_C(0x10)
7441 } __rte_packed;
7442
7443 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
7444 struct hwrm_async_event_cmpl_llfc_pfc_change {
7445         uint16_t        type;
7446         /*
7447          * This field indicates the exact type of the completion.
7448          * By convention, the LSB identifies the length of the
7449          * record in 16B units. Even values indicate 16B
7450          * records. Odd values indicate 32B
7451          * records.
7452          */
7453         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK \
7454                 UINT32_C(0x3f)
7455         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT             0
7456         /* HWRM Asynchronous Event Information */
7457         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7458                 UINT32_C(0x2e)
7459         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST \
7460                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
7461         /* unused1 is 10 b */
7462         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK \
7463                 UINT32_C(0xffc0)
7464         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT          6
7465         /* Identifiers of events. */
7466         uint16_t        event_id;
7467         /* LLFC/PFC Configuration Change */
7468         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE \
7469                 UINT32_C(0x34)
7470         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST \
7471                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
7472         /* Event specific data */
7473         uint32_t        event_data2;
7474         uint8_t opaque_v;
7475         /*
7476          * This value is written by the NIC such that it will be different
7477          * for each pass through the completion queue. The even passes
7478          * will write 1. The odd passes will write 0.
7479          */
7480         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V          UINT32_C(0x1)
7481         /* opaque is 7 b */
7482         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK \
7483                 UINT32_C(0xfe)
7484         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
7485         /* 8-lsb timestamp from POR (100-msec resolution) */
7486         uint8_t timestamp_lo;
7487         /* 16-lsb timestamp from POR (100-msec resolution) */
7488         uint16_t        timestamp_hi;
7489         /* Event specific data */
7490         uint32_t        event_data1;
7491         /* Indicates llfc pfc status change */
7492         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK \
7493                 UINT32_C(0x3)
7494         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT \
7495                 0
7496         /*
7497          * If this field set to 1, then it indicates that llfc is
7498          * enabled.
7499          */
7500         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC \
7501                 UINT32_C(0x1)
7502         /*
7503          * If this field is set to 2, then it indicates that pfc
7504          * is enabled.
7505          */
7506         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC \
7507                 UINT32_C(0x2)
7508         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST \
7509                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
7510         /* Indicates the physical port this llfc pfc change occur */
7511         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK \
7512                 UINT32_C(0x1c)
7513         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT \
7514                 2
7515         /* PORT ID */
7516         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK \
7517                 UINT32_C(0x1fffe0)
7518         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \
7519                 5
7520 } __rte_packed;
7521
7522 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
7523 struct hwrm_async_event_cmpl_default_vnic_change {
7524         uint16_t        type;
7525         /*
7526          * This field indicates the exact type of the completion.
7527          * By convention, the LSB identifies the length of the
7528          * record in 16B units. Even values indicate 16B
7529          * records. Odd values indicate 32B
7530          * records.
7531          */
7532         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK \
7533                 UINT32_C(0x3f)
7534         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT \
7535                 0
7536         /* HWRM Asynchronous Event Information */
7537         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7538                 UINT32_C(0x2e)
7539         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST \
7540                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
7541         /* unused1 is 10 b */
7542         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK \
7543                 UINT32_C(0xffc0)
7544         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT \
7545                 6
7546         /* Identifiers of events. */
7547         uint16_t        event_id;
7548         /* Notification of a default vnic allocation or free */
7549         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION \
7550                 UINT32_C(0x35)
7551         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST \
7552                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
7553         /* Event specific data */
7554         uint32_t        event_data2;
7555         uint8_t opaque_v;
7556         /*
7557          * This value is written by the NIC such that it will be different
7558          * for each pass through the completion queue. The even passes
7559          * will write 1. The odd passes will write 0.
7560          */
7561         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V \
7562                 UINT32_C(0x1)
7563         /* opaque is 7 b */
7564         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK \
7565                 UINT32_C(0xfe)
7566         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
7567         /* 8-lsb timestamp from POR (100-msec resolution) */
7568         uint8_t timestamp_lo;
7569         /* 16-lsb timestamp from POR (100-msec resolution) */
7570         uint16_t        timestamp_hi;
7571         /* Event specific data */
7572         uint32_t        event_data1;
7573         /* Indicates default vnic configuration change */
7574         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK \
7575                 UINT32_C(0x3)
7576         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT \
7577                 0
7578         /*
7579          * If this field is set to 1, then it indicates that
7580          * a default VNIC has been allocate.
7581          */
7582         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC \
7583                 UINT32_C(0x1)
7584         /*
7585          * If this field is set to 2, then it indicates that
7586          * a default VNIC has been freed.
7587          */
7588         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE \
7589                 UINT32_C(0x2)
7590         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST \
7591                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
7592         /* Indicates the physical function this event occurred on. */
7593         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK \
7594                 UINT32_C(0x3fc)
7595         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT \
7596                 2
7597         /* Indicates the virtual function this event occurred on */
7598         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK \
7599                 UINT32_C(0x3fffc00)
7600         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \
7601                 10
7602 } __rte_packed;
7603
7604 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
7605 struct hwrm_async_event_cmpl_hw_flow_aged {
7606         uint16_t        type;
7607         /*
7608          * This field indicates the exact type of the completion.
7609          * By convention, the LSB identifies the length of the
7610          * record in 16B units. Even values indicate 16B
7611          * records. Odd values indicate 32B
7612          * records.
7613          */
7614         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK \
7615                 UINT32_C(0x3f)
7616         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT             0
7617         /* HWRM Asynchronous Event Information */
7618         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT \
7619                 UINT32_C(0x2e)
7620         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST \
7621                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
7622         /* Identifiers of events. */
7623         uint16_t        event_id;
7624         /* Notification of a hw flow aged */
7625         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED \
7626                 UINT32_C(0x36)
7627         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST \
7628                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
7629         /* Event specific data */
7630         uint32_t        event_data2;
7631         uint8_t opaque_v;
7632         /*
7633          * This value is written by the NIC such that it will be different
7634          * for each pass through the completion queue. The even passes
7635          * will write 1. The odd passes will write 0.
7636          */
7637         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V          UINT32_C(0x1)
7638         /* opaque is 7 b */
7639         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
7640         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
7641         /* 8-lsb timestamp from POR (100-msec resolution) */
7642         uint8_t timestamp_lo;
7643         /* 16-lsb timestamp from POR (100-msec resolution) */
7644         uint16_t        timestamp_hi;
7645         /* Event specific data */
7646         uint32_t        event_data1;
7647         /* Indicates flow ID this event occurred on. */
7648         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK \
7649                 UINT32_C(0x7fffffff)
7650         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT \
7651                 0
7652         /* Indicates flow direction this event occurred on. */
7653         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION \
7654                 UINT32_C(0x80000000)
7655         /*
7656          * If this bit set to 0, then it indicates that the aged
7657          * event was rx flow.
7658          */
7659         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX \
7660                 (UINT32_C(0x0) << 31)
7661         /*
7662          * If this bit is set to 1, then it indicates that the aged
7663          * event was tx flow.
7664          */
7665         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX \
7666                 (UINT32_C(0x1) << 31)
7667         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST \
7668                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
7669 } __rte_packed;
7670
7671 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
7672 struct hwrm_async_event_cmpl_eem_cache_flush_req {
7673         uint16_t        type;
7674         /*
7675          * This field indicates the exact type of the completion.
7676          * By convention, the LSB identifies the length of the
7677          * record in 16B units. Even values indicate 16B
7678          * records. Odd values indicate 32B
7679          * records.
7680          */
7681         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK \
7682                 UINT32_C(0x3f)
7683         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT \
7684                 0
7685         /* HWRM Asynchronous Event Information */
7686         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT \
7687                 UINT32_C(0x2e)
7688         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST \
7689                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
7690         /* Identifiers of events. */
7691         uint16_t        event_id;
7692         /* Notification of a eem_cache_flush request */
7693         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ \
7694                 UINT32_C(0x38)
7695         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_LAST \
7696                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ
7697         /* Event specific data */
7698         uint32_t        event_data2;
7699         uint8_t opaque_v;
7700         /*
7701          * This value is written by the NIC such that it will be different
7702          * for each pass through the completion queue. The even passes
7703          * will write 1. The odd passes will write 0.
7704          */
7705         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V \
7706                 UINT32_C(0x1)
7707         /* opaque is 7 b */
7708         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK \
7709                 UINT32_C(0xfe)
7710         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
7711         /* 8-lsb timestamp from POR (100-msec resolution) */
7712         uint8_t timestamp_lo;
7713         /* 16-lsb timestamp from POR (100-msec resolution) */
7714         uint16_t        timestamp_hi;
7715         /* Event specific data */
7716         uint32_t        event_data1;
7717 } __rte_packed;
7718
7719 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
7720 struct hwrm_async_event_cmpl_eem_cache_flush_done {
7721         uint16_t        type;
7722         /*
7723          * This field indicates the exact type of the completion.
7724          * By convention, the LSB identifies the length of the
7725          * record in 16B units. Even values indicate 16B
7726          * records. Odd values indicate 32B
7727          * records.
7728          */
7729         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK \
7730                 UINT32_C(0x3f)
7731         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT \
7732                 0
7733         /* HWRM Asynchronous Event Information */
7734         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT \
7735                 UINT32_C(0x2e)
7736         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST \
7737                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
7738         /* Identifiers of events. */
7739         uint16_t        event_id;
7740         /*
7741          * Notification of a host eem_cache_flush has completed. This event
7742          * is generated by the host driver.
7743          */
7744         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE \
7745                 UINT32_C(0x39)
7746         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_LAST \
7747                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE
7748         /* Event specific data */
7749         uint32_t        event_data2;
7750         uint8_t opaque_v;
7751         /*
7752          * This value is written by the NIC such that it will be different
7753          * for each pass through the completion queue. The even passes
7754          * will write 1. The odd passes will write 0.
7755          */
7756         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V \
7757                 UINT32_C(0x1)
7758         /* opaque is 7 b */
7759         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK \
7760                 UINT32_C(0xfe)
7761         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
7762         /* 8-lsb timestamp from POR (100-msec resolution) */
7763         uint8_t timestamp_lo;
7764         /* 16-lsb timestamp from POR (100-msec resolution) */
7765         uint16_t        timestamp_hi;
7766         /* Event specific data */
7767         uint32_t        event_data1;
7768         /* Indicates function ID that this event occurred on. */
7769         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK \
7770                 UINT32_C(0xffff)
7771         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT \
7772                 0
7773 } __rte_packed;
7774
7775 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
7776 struct hwrm_async_event_cmpl_tcp_flag_action_change {
7777         uint16_t        type;
7778         /*
7779          * This field indicates the exact type of the completion.
7780          * By convention, the LSB identifies the length of the
7781          * record in 16B units. Even values indicate 16B
7782          * records. Odd values indicate 32B
7783          * records.
7784          */
7785         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK \
7786                 UINT32_C(0x3f)
7787         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT \
7788                 0
7789         /* HWRM Asynchronous Event Information */
7790         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7791                 UINT32_C(0x2e)
7792         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST \
7793                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
7794         /* Identifiers of events. */
7795         uint16_t        event_id;
7796         /* Notification of tcp flag action change */
7797         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
7798                 UINT32_C(0x3a)
7799         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_LAST \
7800                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE
7801         /* Event specific data */
7802         uint32_t        event_data2;
7803         uint8_t opaque_v;
7804         /*
7805          * This value is written by the NIC such that it will be different
7806          * for each pass through the completion queue. The even passes
7807          * will write 1. The odd passes will write 0.
7808          */
7809         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V \
7810                 UINT32_C(0x1)
7811         /* opaque is 7 b */
7812         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK \
7813                 UINT32_C(0xfe)
7814         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
7815         /* 8-lsb timestamp from POR (100-msec resolution) */
7816         uint8_t timestamp_lo;
7817         /* 16-lsb timestamp from POR (100-msec resolution) */
7818         uint16_t        timestamp_hi;
7819         /* Event specific data */
7820         uint32_t        event_data1;
7821 } __rte_packed;
7822
7823 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
7824 struct hwrm_async_event_cmpl_eem_flow_active {
7825         uint16_t        type;
7826         /*
7827          * This field indicates the exact type of the completion.
7828          * By convention, the LSB identifies the length of the
7829          * record in 16B units. Even values indicate 16B
7830          * records. Odd values indicate 32B
7831          * records.
7832          */
7833         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK \
7834                 UINT32_C(0x3f)
7835         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT             0
7836         /* HWRM Asynchronous Event Information */
7837         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT \
7838                 UINT32_C(0x2e)
7839         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST \
7840                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
7841         /* Identifiers of events. */
7842         uint16_t        event_id;
7843         /* Notification of an active eem flow */
7844         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE \
7845                 UINT32_C(0x3b)
7846         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST \
7847                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
7848         /* Event specific data */
7849         uint32_t        event_data2;
7850         /* Indicates the 2nd global id this event occurred on. */
7851         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK \
7852                 UINT32_C(0x3fffffff)
7853         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT \
7854                 0
7855         /*
7856          * Indicates flow direction of the flow identified by
7857          * the global_id_2.
7858          */
7859         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION \
7860                 UINT32_C(0x40000000)
7861         /* If this bit is set to 0, then it indicates that this rx flow. */
7862         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX \
7863                 (UINT32_C(0x0) << 30)
7864         /* If this bit is set to 1, then it indicates that this tx flow. */
7865         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX \
7866                 (UINT32_C(0x1) << 30)
7867         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_LAST \
7868                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX
7869         uint8_t opaque_v;
7870         /*
7871          * This value is written by the NIC such that it will be different
7872          * for each pass through the completion queue. The even passes
7873          * will write 1. The odd passes will write 0.
7874          */
7875         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V          UINT32_C(0x1)
7876         /* opaque is 7 b */
7877         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK \
7878                 UINT32_C(0xfe)
7879         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
7880         /* 8-lsb timestamp from POR (100-msec resolution) */
7881         uint8_t timestamp_lo;
7882         /* 16-lsb timestamp from POR (100-msec resolution) */
7883         uint16_t        timestamp_hi;
7884         /* Event specific data */
7885         uint32_t        event_data1;
7886         /* Indicates the 1st global id this event occurred on. */
7887         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK \
7888                 UINT32_C(0x3fffffff)
7889         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT \
7890                 0
7891         /*
7892          * Indicates flow direction of the flow identified by the
7893          * global_id_1.
7894          */
7895         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION \
7896                 UINT32_C(0x40000000)
7897         /* If this bit is set to 0, then it indicates that this is rx flow. */
7898         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX \
7899                 (UINT32_C(0x0) << 30)
7900         /* If this bit is set to 1, then it indicates that this is tx flow. */
7901         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX \
7902                 (UINT32_C(0x1) << 30)
7903         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_LAST \
7904                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX
7905         /*
7906          * Indicates EEM flow aging mode this event occurred on. If
7907          * this bit is set to 0, the event_data1 is the EEM global
7908          * ID. If this bit is set to 1, the event_data1 is the number
7909          * of global ID in the context memory.
7910          */
7911         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE \
7912                 UINT32_C(0x80000000)
7913         /* EEM flow aging mode 0. */
7914         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0 \
7915                 (UINT32_C(0x0) << 31)
7916         /* EEM flow aging mode 1. */
7917         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1 \
7918                 (UINT32_C(0x1) << 31)
7919         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST \
7920                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
7921 } __rte_packed;
7922
7923 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
7924 struct hwrm_async_event_cmpl_eem_cfg_change {
7925         uint16_t        type;
7926         /*
7927          * This field indicates the exact type of the completion.
7928          * By convention, the LSB identifies the length of the
7929          * record in 16B units. Even values indicate 16B
7930          * records. Odd values indicate 32B
7931          * records.
7932          */
7933         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK \
7934                 UINT32_C(0x3f)
7935         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT             0
7936         /* HWRM Asynchronous Event Information */
7937         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7938                 UINT32_C(0x2e)
7939         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST \
7940                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
7941         /* Identifiers of events. */
7942         uint16_t        event_id;
7943         /* Notification of EEM configuration change */
7944         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE \
7945                 UINT32_C(0x3c)
7946         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST \
7947                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
7948         /* Event specific data */
7949         uint32_t        event_data2;
7950         uint8_t opaque_v;
7951         /*
7952          * This value is written by the NIC such that it will be different
7953          * for each pass through the completion queue. The even passes
7954          * will write 1. The odd passes will write 0.
7955          */
7956         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V          UINT32_C(0x1)
7957         /* opaque is 7 b */
7958         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
7959         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
7960         /* 8-lsb timestamp from POR (100-msec resolution) */
7961         uint8_t timestamp_lo;
7962         /* 16-lsb timestamp from POR (100-msec resolution) */
7963         uint16_t        timestamp_hi;
7964         /* Event specific data */
7965         uint32_t        event_data1;
7966         /*
7967          * Value of 1 to indicate EEM TX configuration is enabled. Value of
7968          * 0 to indicate the EEM TX configuration is disabled.
7969          */
7970         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE \
7971                 UINT32_C(0x1)
7972         /*
7973          * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
7974          * to indicate the EEM RX configuration is disabled.
7975          */
7976         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE \
7977                 UINT32_C(0x2)
7978 } __rte_packed;
7979
7980 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
7981 struct hwrm_async_event_cmpl_quiesce_done {
7982         uint16_t        type;
7983         /*
7984          * This field indicates the exact type of the completion.
7985          * By convention, the LSB identifies the length of the
7986          * record in 16B units. Even values indicate 16B
7987          * records. Odd values indicate 32B
7988          * records.
7989          */
7990         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_MASK \
7991                 UINT32_C(0x3f)
7992         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_SFT             0
7993         /* HWRM Asynchronous Event Information */
7994         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT \
7995                 UINT32_C(0x2e)
7996         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_LAST \
7997                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT
7998         /* Identifiers of events. */
7999         uint16_t        event_id;
8000         /* An event signifying completion of HWRM_FW_STATE_QUIESCE */
8001         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE \
8002                 UINT32_C(0x3f)
8003         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_LAST \
8004                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE
8005         /* Event specific data */
8006         uint32_t        event_data2;
8007         /* Status of HWRM_FW_STATE_QUIESCE completion */
8008         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_MASK \
8009                 UINT32_C(0xff)
8010         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SFT \
8011                 0
8012         /*
8013          * The quiesce operation started by HWRM_FW_STATE_QUIESCE
8014          * completed successfully.
8015          */
8016         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SUCCESS \
8017                 UINT32_C(0x0)
8018         /*
8019          * The quiesce operation started by HWRM_FW_STATE_QUIESCE timed
8020          * out.
8021          */
8022         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_TIMEOUT \
8023                 UINT32_C(0x1)
8024         /*
8025          * The quiesce operation started by HWRM_FW_STATE_QUIESCE
8026          * encountered an error.
8027          */
8028         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR \
8029                 UINT32_C(0x2)
8030         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_LAST \
8031                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR
8032         /* opaque is 8 b */
8033         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_MASK \
8034                 UINT32_C(0xff00)
8035         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_SFT \
8036                 8
8037         /*
8038          * Additional information about internal hardware state related to
8039          * idle/quiesce state.  QUIESCE may succeed per quiesce_status
8040          * regardless of idle_state_flags.  If QUIESCE fails, the host may
8041          * inspect idle_state_flags to determine whether a retry is warranted.
8042          */
8043         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_MASK \
8044                 UINT32_C(0xff0000)
8045         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_SFT \
8046                 16
8047         /*
8048          * Failure to quiesce is caused by host not updating the NQ consumer
8049          * index.
8050          */
8051         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_INCOMPLETE_NQ \
8052                 UINT32_C(0x10000)
8053         /* Flag 1 indicating partial non-idle state. */
8054         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_1 \
8055                 UINT32_C(0x20000)
8056         /* Flag 2 indicating partial non-idle state. */
8057         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_2 \
8058                 UINT32_C(0x40000)
8059         /* Flag 3 indicating partial non-idle state. */
8060         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_3 \
8061                 UINT32_C(0x80000)
8062         uint8_t opaque_v;
8063         /*
8064          * This value is written by the NIC such that it will be different
8065          * for each pass through the completion queue. The even passes
8066          * will write 1. The odd passes will write 0.
8067          */
8068         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_V          UINT32_C(0x1)
8069         /* opaque is 7 b */
8070         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_MASK UINT32_C(0xfe)
8071         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_SFT 1
8072         /* 8-lsb timestamp from POR (100-msec resolution) */
8073         uint8_t timestamp_lo;
8074         /* 16-lsb timestamp from POR (100-msec resolution) */
8075         uint16_t        timestamp_hi;
8076         /* Event specific data */
8077         uint32_t        event_data1;
8078         /* Time stamp for error event */
8079         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP \
8080                 UINT32_C(0x1)
8081 } __rte_packed;
8082
8083 /* hwrm_async_event_cmpl_deferred_response (size:128b/16B) */
8084 struct hwrm_async_event_cmpl_deferred_response {
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_DEFERRED_RESPONSE_TYPE_MASK \
8094                 UINT32_C(0x3f)
8095         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_SFT             0
8096         /* HWRM Asynchronous Event Information */
8097         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT \
8098                 UINT32_C(0x2e)
8099         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_LAST \
8100                 HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT
8101         /* Identifiers of events. */
8102         uint16_t        event_id;
8103         /*
8104          * An event signifying a HWRM command is in progress and its
8105          * response will be deferred
8106          */
8107         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE \
8108                 UINT32_C(0x40)
8109         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_LAST \
8110                 HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE
8111         /* Event specific data */
8112         uint32_t        event_data2;
8113         /*
8114          * The PF's mailbox is clear to issue another command.
8115          * A command with this seq_id is still in progress
8116          * and will return a regular HWRM completion when done.
8117          * 'event_data1' field, if non-zero, contains the estimated
8118          * execution time for the command.
8119          */
8120         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_MASK \
8121                 UINT32_C(0xffff)
8122         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_SFT \
8123                 0
8124         uint8_t opaque_v;
8125         /*
8126          * This value is written by the NIC such that it will be different
8127          * for each pass through the completion queue. The even passes
8128          * will write 1. The odd passes will write 0.
8129          */
8130         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_V \
8131                 UINT32_C(0x1)
8132         /* opaque is 7 b */
8133         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_MASK \
8134                 UINT32_C(0xfe)
8135         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_SFT 1
8136         /* 8-lsb timestamp from POR (100-msec resolution) */
8137         uint8_t timestamp_lo;
8138         /* 16-lsb timestamp from POR (100-msec resolution) */
8139         uint16_t        timestamp_hi;
8140         /* Estimated remaining time of command execution in ms (if not zero) */
8141         uint32_t        event_data1;
8142 } __rte_packed;
8143
8144 /* hwrm_async_event_cmpl_pfc_watchdog_cfg_change (size:128b/16B) */
8145 struct hwrm_async_event_cmpl_pfc_watchdog_cfg_change {
8146         uint16_t        type;
8147         /*
8148          * This field indicates the exact type of the completion.
8149          * By convention, the LSB identifies the length of the
8150          * record in 16B units. Even values indicate 16B
8151          * records. Odd values indicate 32B
8152          * records.
8153          */
8154         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_MASK \
8155                 UINT32_C(0x3f)
8156         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_SFT \
8157                 0
8158         /* HWRM Asynchronous Event Information */
8159         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8160                 UINT32_C(0x2e)
8161         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_LAST \
8162                 HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
8163         /* Identifiers of events. */
8164         uint16_t        event_id;
8165         /* PFC watchdog configuration change for given port/cos */
8166         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE \
8167                 UINT32_C(0x41)
8168         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_LAST \
8169                 HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE
8170         /* Event specific data */
8171         uint32_t        event_data2;
8172         uint8_t opaque_v;
8173         /*
8174          * This value is written by the NIC such that it will be different
8175          * for each pass through the completion queue. The even passes
8176          * will write 1. The odd passes will write 0.
8177          */
8178         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_V \
8179                 UINT32_C(0x1)
8180         /* opaque is 7 b */
8181         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_MASK \
8182                 UINT32_C(0xfe)
8183         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_SFT 1
8184         /* 8-lsb timestamp from POR (100-msec resolution) */
8185         uint8_t timestamp_lo;
8186         /* 16-lsb timestamp from POR (100-msec resolution) */
8187         uint16_t        timestamp_hi;
8188         /* Event specific data */
8189         uint32_t        event_data1;
8190         /*
8191          * 1 in bit position X indicates PFC watchdog should
8192          * be on for COSX
8193          */
8194         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_MASK \
8195                 UINT32_C(0xff)
8196         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_SFT \
8197                 0
8198         /* 1 means PFC WD for COS0 is on, 0 - off. */
8199         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS0 \
8200                 UINT32_C(0x1)
8201         /* 1 means PFC WD for COS1 is on, 0 - off. */
8202         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS1 \
8203                 UINT32_C(0x2)
8204         /* 1 means PFC WD for COS2 is on, 0 - off. */
8205         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS2 \
8206                 UINT32_C(0x4)
8207         /* 1 means PFC WD for COS3 is on, 0 - off. */
8208         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS3 \
8209                 UINT32_C(0x8)
8210         /* 1 means PFC WD for COS4 is on, 0 - off. */
8211         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS4 \
8212                 UINT32_C(0x10)
8213         /* 1 means PFC WD for COS5 is on, 0 - off. */
8214         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS5 \
8215                 UINT32_C(0x20)
8216         /* 1 means PFC WD for COS6 is on, 0 - off. */
8217         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS6 \
8218                 UINT32_C(0x40)
8219         /* 1 means PFC WD for COS7 is on, 0 - off. */
8220         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS7 \
8221                 UINT32_C(0x80)
8222         /* PORT ID */
8223         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
8224                 UINT32_C(0xffff00)
8225         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
8226                 8
8227 } __rte_packed;
8228
8229 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
8230 struct hwrm_async_event_cmpl_fw_trace_msg {
8231         uint16_t        type;
8232         /*
8233          * This field indicates the exact type of the completion.
8234          * By convention, the LSB identifies the length of the
8235          * record in 16B units. Even values indicate 16B
8236          * records. Odd values indicate 32B
8237          * records.
8238          */
8239         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK \
8240                 UINT32_C(0x3f)
8241         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT             0
8242         /* HWRM Asynchronous Event Information */
8243         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT \
8244                 UINT32_C(0x2e)
8245         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST \
8246                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
8247         /* Identifiers of events. */
8248         uint16_t        event_id;
8249         /* Firmware trace log message */
8250         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG \
8251                 UINT32_C(0xfe)
8252         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST \
8253                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
8254         /* Trace byte 0 to 3 */
8255         uint32_t        event_data2;
8256         /* Trace byte0 */
8257         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK \
8258                 UINT32_C(0xff)
8259         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
8260         /* Trace byte1 */
8261         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK \
8262                 UINT32_C(0xff00)
8263         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
8264         /* Trace byte2 */
8265         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK \
8266                 UINT32_C(0xff0000)
8267         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
8268         /* Trace byte3 */
8269         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK \
8270                 UINT32_C(0xff000000)
8271         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
8272         uint8_t opaque_v;
8273         /*
8274          * This value is written by the NIC such that it will be different
8275          * for each pass through the completion queue. The even passes
8276          * will write 1. The odd passes will write 0.
8277          */
8278         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V          UINT32_C(0x1)
8279         /* opaque is 7 b */
8280         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
8281         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
8282         /* Trace flags */
8283         uint8_t timestamp_lo;
8284         /* Indicates if the string is partial or complete. */
8285         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING \
8286                 UINT32_C(0x1)
8287         /* Complete string */
8288         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE \
8289                 UINT32_C(0x0)
8290         /* Partial string */
8291         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL \
8292                 UINT32_C(0x1)
8293         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST \
8294                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
8295         /* Indicates the firmware that sent the trace message. */
8296         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE \
8297                 UINT32_C(0x2)
8298         /* Primary firmware */
8299         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY \
8300                 (UINT32_C(0x0) << 1)
8301         /* Secondary firmware */
8302         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY \
8303                 (UINT32_C(0x1) << 1)
8304         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST \
8305                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
8306         /* Trace byte 4 to 5 */
8307         uint16_t        timestamp_hi;
8308         /* Trace byte4 */
8309         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK \
8310                 UINT32_C(0xff)
8311         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
8312         /* Trace byte5 */
8313         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK \
8314                 UINT32_C(0xff00)
8315         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
8316         /* Trace byte 6 to 9 */
8317         uint32_t        event_data1;
8318         /* Trace byte6 */
8319         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK \
8320                 UINT32_C(0xff)
8321         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
8322         /* Trace byte7 */
8323         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK \
8324                 UINT32_C(0xff00)
8325         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
8326         /* Trace byte8 */
8327         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK \
8328                 UINT32_C(0xff0000)
8329         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
8330         /* Trace byte9 */
8331         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK \
8332                 UINT32_C(0xff000000)
8333         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
8334 } __rte_packed;
8335
8336 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
8337 struct hwrm_async_event_cmpl_hwrm_error {
8338         uint16_t        type;
8339         /*
8340          * This field indicates the exact type of the completion.
8341          * By convention, the LSB identifies the length of the
8342          * record in 16B units. Even values indicate 16B
8343          * records. Odd values indicate 32B
8344          * records.
8345          */
8346         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK \
8347                 UINT32_C(0x3f)
8348         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT             0
8349         /* HWRM Asynchronous Event Information */
8350         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT \
8351                 UINT32_C(0x2e)
8352         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST \
8353                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
8354         /* Identifiers of events. */
8355         uint16_t        event_id;
8356         /* HWRM Error */
8357         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR \
8358                 UINT32_C(0xff)
8359         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST \
8360                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
8361         /* Event specific data */
8362         uint32_t        event_data2;
8363         /* Severity of HWRM Error */
8364         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK \
8365                 UINT32_C(0xff)
8366         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT     0
8367         /* Warning */
8368         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING \
8369                 UINT32_C(0x0)
8370         /* Non-fatal Error */
8371         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL \
8372                 UINT32_C(0x1)
8373         /* Fatal Error */
8374         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL \
8375                 UINT32_C(0x2)
8376         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST \
8377                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
8378         uint8_t opaque_v;
8379         /*
8380          * This value is written by the NIC such that it will be different
8381          * for each pass through the completion queue. The even passes
8382          * will write 1. The odd passes will write 0.
8383          */
8384         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V          UINT32_C(0x1)
8385         /* opaque is 7 b */
8386         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
8387         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
8388         /* 8-lsb timestamp from POR (100-msec resolution) */
8389         uint8_t timestamp_lo;
8390         /* 16-lsb timestamp from POR (100-msec resolution) */
8391         uint16_t        timestamp_hi;
8392         /* Event specific data */
8393         uint32_t        event_data1;
8394         /* Time stamp for error event */
8395         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \
8396                 UINT32_C(0x1)
8397 } __rte_packed;
8398
8399 /*******************
8400  * hwrm_func_reset *
8401  *******************/
8402
8403
8404 /* hwrm_func_reset_input (size:192b/24B) */
8405 struct hwrm_func_reset_input {
8406         /* The HWRM command request type. */
8407         uint16_t        req_type;
8408         /*
8409          * The completion ring to send the completion event on. This should
8410          * be the NQ ID returned from the `nq_alloc` HWRM command.
8411          */
8412         uint16_t        cmpl_ring;
8413         /*
8414          * The sequence ID is used by the driver for tracking multiple
8415          * commands. This ID is treated as opaque data by the firmware and
8416          * the value is returned in the `hwrm_resp_hdr` upon completion.
8417          */
8418         uint16_t        seq_id;
8419         /*
8420          * The target ID of the command:
8421          * * 0x0-0xFFF8 - The function ID
8422          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8423          * * 0xFFFD - Reserved for user-space HWRM interface
8424          * * 0xFFFF - HWRM
8425          */
8426         uint16_t        target_id;
8427         /*
8428          * A physical address pointer pointing to a host buffer that the
8429          * command's response data will be written. This can be either a host
8430          * physical address (HPA) or a guest physical address (GPA) and must
8431          * point to a physically contiguous block of memory.
8432          */
8433         uint64_t        resp_addr;
8434         uint32_t        enables;
8435         /*
8436          * This bit must be '1' for the vf_id_valid field to be
8437          * configured.
8438          */
8439         #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
8440         /*
8441          * The ID of the VF that this PF is trying to reset.
8442          * Only the parent PF shall be allowed to reset a child VF.
8443          *
8444          * A parent PF driver shall use this field only when a specific child VF
8445          * is requested to be reset.
8446          */
8447         uint16_t        vf_id;
8448         /* This value indicates the level of a function reset. */
8449         uint8_t func_reset_level;
8450         /*
8451          * Reset the caller function and its children VFs (if any). If no
8452          * children functions exist, then reset the caller function only.
8453          */
8454         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
8455                 UINT32_C(0x0)
8456         /* Reset the caller function only */
8457         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
8458                 UINT32_C(0x1)
8459         /*
8460          * Reset all children VFs of the caller function driver if the
8461          * caller is a PF driver.
8462          * It is an error to specify this level by a VF driver.
8463          * It is an error to specify this level by a PF driver with
8464          * no children VFs.
8465          */
8466         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
8467                 UINT32_C(0x2)
8468         /*
8469          * Reset a specific VF of the caller function driver if the caller
8470          * is the parent PF driver.
8471          * It is an error to specify this level by a VF driver.
8472          * It is an error to specify this level by a PF driver that is not
8473          * the parent of the VF that is being requested to reset.
8474          */
8475         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
8476                 UINT32_C(0x3)
8477         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
8478                 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
8479         uint8_t unused_0;
8480 } __rte_packed;
8481
8482 /* hwrm_func_reset_output (size:128b/16B) */
8483 struct hwrm_func_reset_output {
8484         /* The specific error status for the command. */
8485         uint16_t        error_code;
8486         /* The HWRM command request type. */
8487         uint16_t        req_type;
8488         /* The sequence ID from the original command. */
8489         uint16_t        seq_id;
8490         /* The length of the response data in number of bytes. */
8491         uint16_t        resp_len;
8492         uint8_t unused_0[7];
8493         /*
8494          * This field is used in Output records to indicate that the output
8495          * is completely written to RAM.  This field should be read as '1'
8496          * to indicate that the output has been completely written.
8497          * When writing a command completion or response to an internal processor,
8498          * the order of writes has to be such that this field is written last.
8499          */
8500         uint8_t valid;
8501 } __rte_packed;
8502
8503 /********************
8504  * hwrm_func_getfid *
8505  ********************/
8506
8507
8508 /* hwrm_func_getfid_input (size:192b/24B) */
8509 struct hwrm_func_getfid_input {
8510         /* The HWRM command request type. */
8511         uint16_t        req_type;
8512         /*
8513          * The completion ring to send the completion event on. This should
8514          * be the NQ ID returned from the `nq_alloc` HWRM command.
8515          */
8516         uint16_t        cmpl_ring;
8517         /*
8518          * The sequence ID is used by the driver for tracking multiple
8519          * commands. This ID is treated as opaque data by the firmware and
8520          * the value is returned in the `hwrm_resp_hdr` upon completion.
8521          */
8522         uint16_t        seq_id;
8523         /*
8524          * The target ID of the command:
8525          * * 0x0-0xFFF8 - The function ID
8526          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8527          * * 0xFFFD - Reserved for user-space HWRM interface
8528          * * 0xFFFF - HWRM
8529          */
8530         uint16_t        target_id;
8531         /*
8532          * A physical address pointer pointing to a host buffer that the
8533          * command's response data will be written. This can be either a host
8534          * physical address (HPA) or a guest physical address (GPA) and must
8535          * point to a physically contiguous block of memory.
8536          */
8537         uint64_t        resp_addr;
8538         uint32_t        enables;
8539         /*
8540          * This bit must be '1' for the pci_id field to be
8541          * configured.
8542          */
8543         #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID     UINT32_C(0x1)
8544         /*
8545          * This value is the PCI ID of the queried function.
8546          * If ARI is enabled, then it is
8547          * Bus Number (8b):Function Number(8b). Otherwise, it is
8548          * Bus Number (8b):Device Number (5b):Function Number(3b).
8549          */
8550         uint16_t        pci_id;
8551         uint8_t unused_0[2];
8552 } __rte_packed;
8553
8554 /* hwrm_func_getfid_output (size:128b/16B) */
8555 struct hwrm_func_getfid_output {
8556         /* The specific error status for the command. */
8557         uint16_t        error_code;
8558         /* The HWRM command request type. */
8559         uint16_t        req_type;
8560         /* The sequence ID from the original command. */
8561         uint16_t        seq_id;
8562         /* The length of the response data in number of bytes. */
8563         uint16_t        resp_len;
8564         /*
8565          * FID value.  This value is used to identify operations on the PCI
8566          * bus as belonging to a particular PCI function.
8567          */
8568         uint16_t        fid;
8569         uint8_t unused_0[5];
8570         /*
8571          * This field is used in Output records to indicate that the output
8572          * is completely written to RAM.  This field should be read as '1'
8573          * to indicate that the output has been completely written.
8574          * When writing a command completion or response to an internal processor,
8575          * the order of writes has to be such that this field is written last.
8576          */
8577         uint8_t valid;
8578 } __rte_packed;
8579
8580 /**********************
8581  * hwrm_func_vf_alloc *
8582  **********************/
8583
8584
8585 /* hwrm_func_vf_alloc_input (size:192b/24B) */
8586 struct hwrm_func_vf_alloc_input {
8587         /* The HWRM command request type. */
8588         uint16_t        req_type;
8589         /*
8590          * The completion ring to send the completion event on. This should
8591          * be the NQ ID returned from the `nq_alloc` HWRM command.
8592          */
8593         uint16_t        cmpl_ring;
8594         /*
8595          * The sequence ID is used by the driver for tracking multiple
8596          * commands. This ID is treated as opaque data by the firmware and
8597          * the value is returned in the `hwrm_resp_hdr` upon completion.
8598          */
8599         uint16_t        seq_id;
8600         /*
8601          * The target ID of the command:
8602          * * 0x0-0xFFF8 - The function ID
8603          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8604          * * 0xFFFD - Reserved for user-space HWRM interface
8605          * * 0xFFFF - HWRM
8606          */
8607         uint16_t        target_id;
8608         /*
8609          * A physical address pointer pointing to a host buffer that the
8610          * command's response data will be written. This can be either a host
8611          * physical address (HPA) or a guest physical address (GPA) and must
8612          * point to a physically contiguous block of memory.
8613          */
8614         uint64_t        resp_addr;
8615         uint32_t        enables;
8616         /*
8617          * This bit must be '1' for the first_vf_id field to be
8618          * configured.
8619          */
8620         #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
8621         /*
8622          * This value is used to identify a Virtual Function (VF).
8623          * The scope of VF ID is local within a PF.
8624          */
8625         uint16_t        first_vf_id;
8626         /* The number of virtual functions requested. */
8627         uint16_t        num_vfs;
8628 } __rte_packed;
8629
8630 /* hwrm_func_vf_alloc_output (size:128b/16B) */
8631 struct hwrm_func_vf_alloc_output {
8632         /* The specific error status for the command. */
8633         uint16_t        error_code;
8634         /* The HWRM command request type. */
8635         uint16_t        req_type;
8636         /* The sequence ID from the original command. */
8637         uint16_t        seq_id;
8638         /* The length of the response data in number of bytes. */
8639         uint16_t        resp_len;
8640         /* The ID of the first VF allocated. */
8641         uint16_t        first_vf_id;
8642         uint8_t unused_0[5];
8643         /*
8644          * This field is used in Output records to indicate that the output
8645          * is completely written to RAM.  This field should be read as '1'
8646          * to indicate that the output has been completely written.
8647          * When writing a command completion or response to an internal processor,
8648          * the order of writes has to be such that this field is written last.
8649          */
8650         uint8_t valid;
8651 } __rte_packed;
8652
8653 /*********************
8654  * hwrm_func_vf_free *
8655  *********************/
8656
8657
8658 /* hwrm_func_vf_free_input (size:192b/24B) */
8659 struct hwrm_func_vf_free_input {
8660         /* The HWRM command request type. */
8661         uint16_t        req_type;
8662         /*
8663          * The completion ring to send the completion event on. This should
8664          * be the NQ ID returned from the `nq_alloc` HWRM command.
8665          */
8666         uint16_t        cmpl_ring;
8667         /*
8668          * The sequence ID is used by the driver for tracking multiple
8669          * commands. This ID is treated as opaque data by the firmware and
8670          * the value is returned in the `hwrm_resp_hdr` upon completion.
8671          */
8672         uint16_t        seq_id;
8673         /*
8674          * The target ID of the command:
8675          * * 0x0-0xFFF8 - The function ID
8676          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8677          * * 0xFFFD - Reserved for user-space HWRM interface
8678          * * 0xFFFF - HWRM
8679          */
8680         uint16_t        target_id;
8681         /*
8682          * A physical address pointer pointing to a host buffer that the
8683          * command's response data will be written. This can be either a host
8684          * physical address (HPA) or a guest physical address (GPA) and must
8685          * point to a physically contiguous block of memory.
8686          */
8687         uint64_t        resp_addr;
8688         uint32_t        enables;
8689         /*
8690          * This bit must be '1' for the first_vf_id field to be
8691          * configured.
8692          */
8693         #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
8694         /*
8695          * This value is used to identify a Virtual Function (VF).
8696          * The scope of VF ID is local within a PF.
8697          */
8698         uint16_t        first_vf_id;
8699         /*
8700          * The number of virtual functions requested.
8701          * 0xFFFF - Cleanup all children of this PF.
8702          */
8703         uint16_t        num_vfs;
8704 } __rte_packed;
8705
8706 /* hwrm_func_vf_free_output (size:128b/16B) */
8707 struct hwrm_func_vf_free_output {
8708         /* The specific error status for the command. */
8709         uint16_t        error_code;
8710         /* The HWRM command request type. */
8711         uint16_t        req_type;
8712         /* The sequence ID from the original command. */
8713         uint16_t        seq_id;
8714         /* The length of the response data in number of bytes. */
8715         uint16_t        resp_len;
8716         uint8_t unused_0[7];
8717         /*
8718          * This field is used in Output records to indicate that the output
8719          * is completely written to RAM.  This field should be read as '1'
8720          * to indicate that the output has been completely written.
8721          * When writing a command completion or response to an internal processor,
8722          * the order of writes has to be such that this field is written last.
8723          */
8724         uint8_t valid;
8725 } __rte_packed;
8726
8727 /********************
8728  * hwrm_func_vf_cfg *
8729  ********************/
8730
8731
8732 /* hwrm_func_vf_cfg_input (size:448b/56B) */
8733 struct hwrm_func_vf_cfg_input {
8734         /* The HWRM command request type. */
8735         uint16_t        req_type;
8736         /*
8737          * The completion ring to send the completion event on. This should
8738          * be the NQ ID returned from the `nq_alloc` HWRM command.
8739          */
8740         uint16_t        cmpl_ring;
8741         /*
8742          * The sequence ID is used by the driver for tracking multiple
8743          * commands. This ID is treated as opaque data by the firmware and
8744          * the value is returned in the `hwrm_resp_hdr` upon completion.
8745          */
8746         uint16_t        seq_id;
8747         /*
8748          * The target ID of the command:
8749          * * 0x0-0xFFF8 - The function ID
8750          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8751          * * 0xFFFD - Reserved for user-space HWRM interface
8752          * * 0xFFFF - HWRM
8753          */
8754         uint16_t        target_id;
8755         /*
8756          * A physical address pointer pointing to a host buffer that the
8757          * command's response data will be written. This can be either a host
8758          * physical address (HPA) or a guest physical address (GPA) and must
8759          * point to a physically contiguous block of memory.
8760          */
8761         uint64_t        resp_addr;
8762         uint32_t        enables;
8763         /*
8764          * This bit must be '1' for the mtu field to be
8765          * configured.
8766          */
8767         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \
8768                 UINT32_C(0x1)
8769         /*
8770          * This bit must be '1' for the guest_vlan field to be
8771          * configured.
8772          */
8773         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \
8774                 UINT32_C(0x2)
8775         /*
8776          * This bit must be '1' for the async_event_cr field to be
8777          * configured.
8778          */
8779         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
8780                 UINT32_C(0x4)
8781         /*
8782          * This bit must be '1' for the dflt_mac_addr field to be
8783          * configured.
8784          */
8785         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
8786                 UINT32_C(0x8)
8787         /*
8788          * This bit must be '1' for the num_rsscos_ctxs field to be
8789          * configured.
8790          */
8791         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
8792                 UINT32_C(0x10)
8793         /*
8794          * This bit must be '1' for the num_cmpl_rings field to be
8795          * configured.
8796          */
8797         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
8798                 UINT32_C(0x20)
8799         /*
8800          * This bit must be '1' for the num_tx_rings field to be
8801          * configured.
8802          */
8803         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \
8804                 UINT32_C(0x40)
8805         /*
8806          * This bit must be '1' for the num_rx_rings field to be
8807          * configured.
8808          */
8809         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \
8810                 UINT32_C(0x80)
8811         /*
8812          * This bit must be '1' for the num_l2_ctxs field to be
8813          * configured.
8814          */
8815         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \
8816                 UINT32_C(0x100)
8817         /*
8818          * This bit must be '1' for the num_vnics field to be
8819          * configured.
8820          */
8821         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \
8822                 UINT32_C(0x200)
8823         /*
8824          * This bit must be '1' for the num_stat_ctxs field to be
8825          * configured.
8826          */
8827         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
8828                 UINT32_C(0x400)
8829         /*
8830          * This bit must be '1' for the num_hw_ring_grps field to be
8831          * configured.
8832          */
8833         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
8834                 UINT32_C(0x800)
8835         /*
8836          * The maximum transmission unit requested on the function.
8837          * The HWRM should make sure that the mtu of
8838          * the function does not exceed the mtu of the physical
8839          * port that this function is associated with.
8840          *
8841          * In addition to requesting mtu per function, it is
8842          * possible to configure mtu per transmit ring.
8843          * By default, the mtu of each transmit ring associated
8844          * with a function is equal to the mtu of the function.
8845          * The HWRM should make sure that the mtu of each transmit
8846          * ring that is assigned to a function has a valid mtu.
8847          */
8848         uint16_t        mtu;
8849         /*
8850          * The guest VLAN for the function being configured.
8851          * This field's format is same as 802.1Q Tag's
8852          * Tag Control Information (TCI) format that includes both
8853          * Priority Code Point (PCP) and VLAN Identifier (VID).
8854          */
8855         uint16_t        guest_vlan;
8856         /*
8857          * ID of the target completion ring for receiving asynchronous
8858          * event completions. If this field is not valid, then the
8859          * HWRM shall use the default completion ring of the function
8860          * that is being configured as the target completion ring for
8861          * providing any asynchronous event completions for that
8862          * function.
8863          * If this field is valid, then the HWRM shall use the
8864          * completion ring identified by this ID as the target
8865          * completion ring for providing any asynchronous event
8866          * completions for the function that is being configured.
8867          */
8868         uint16_t        async_event_cr;
8869         /*
8870          * This value is the current MAC address requested by the VF
8871          * driver to be configured on this VF. A value of
8872          * 00-00-00-00-00-00 indicates no MAC address configuration
8873          * is requested by the VF driver.
8874          * The parent PF driver may reject or overwrite this
8875          * MAC address.
8876          */
8877         uint8_t dflt_mac_addr[6];
8878         uint32_t        flags;
8879         /*
8880          * This bit requests that the firmware test to see if all the assets
8881          * requested in this command (i.e. number of TX rings) are available.
8882          * The firmware will return an error if the requested assets are
8883          * not available. The firwmare will NOT reserve the assets if they
8884          * are available.
8885          */
8886         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
8887                 UINT32_C(0x1)
8888         /*
8889          * This bit requests that the firmware test to see if all the assets
8890          * requested in this command (i.e. number of RX rings) are available.
8891          * The firmware will return an error if the requested assets are
8892          * not available. The firwmare will NOT reserve the assets if they
8893          * are available.
8894          */
8895         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
8896                 UINT32_C(0x2)
8897         /*
8898          * This bit requests that the firmware test to see if all the assets
8899          * requested in this command (i.e. number of CMPL rings) are available.
8900          * The firmware will return an error if the requested assets are
8901          * not available. The firwmare will NOT reserve the assets if they
8902          * are available.
8903          */
8904         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
8905                 UINT32_C(0x4)
8906         /*
8907          * This bit requests that the firmware test to see if all the assets
8908          * requested in this command (i.e. number of RSS ctx) are available.
8909          * The firmware will return an error if the requested assets are
8910          * not available. The firwmare will NOT reserve the assets if they
8911          * are available.
8912          */
8913         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
8914                 UINT32_C(0x8)
8915         /*
8916          * This bit requests that the firmware test to see if all the assets
8917          * requested in this command (i.e. number of ring groups) are available.
8918          * The firmware will return an error if the requested assets are
8919          * not available. The firwmare will NOT reserve the assets if they
8920          * are available.
8921          */
8922         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
8923                 UINT32_C(0x10)
8924         /*
8925          * This bit requests that the firmware test to see if all the assets
8926          * requested in this command (i.e. number of stat ctx) are available.
8927          * The firmware will return an error if the requested assets are
8928          * not available. The firwmare will NOT reserve the assets if they
8929          * are available.
8930          */
8931         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
8932                 UINT32_C(0x20)
8933         /*
8934          * This bit requests that the firmware test to see if all the assets
8935          * requested in this command (i.e. number of VNICs) are available.
8936          * The firmware will return an error if the requested assets are
8937          * not available. The firwmare will NOT reserve the assets if they
8938          * are available.
8939          */
8940         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
8941                 UINT32_C(0x40)
8942         /*
8943          * This bit requests that the firmware test to see if all the assets
8944          * requested in this command (i.e. number of L2 ctx) are available.
8945          * The firmware will return an error if the requested assets are
8946          * not available. The firwmare will NOT reserve the assets if they
8947          * are available.
8948          */
8949         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
8950                 UINT32_C(0x80)
8951         /*
8952          * If this bit is set to 1, the VF driver is requesting FW to enable
8953          * PPP TX PUSH feature on all the TX rings specified in the
8954          * num_tx_rings field. By default, the PPP TX push feature is
8955          * disabled for all the TX rings of the VF. This flag is ignored if
8956          * the num_tx_rings field is not specified or the VF doesn't support
8957          * PPP tx push feature.
8958          */
8959         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE \
8960                 UINT32_C(0x100)
8961         /*
8962          * If this bit is set to 1, the VF driver is requesting FW to disable
8963          * PPP TX PUSH feature on all the TX rings of the VF. This flag is
8964          * ignored if the VF doesn't support PPP tx push feature.
8965          */
8966         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE \
8967                 UINT32_C(0x200)
8968         /* The number of RSS/COS contexts requested for the VF. */
8969         uint16_t        num_rsscos_ctxs;
8970         /* The number of completion rings requested for the VF. */
8971         uint16_t        num_cmpl_rings;
8972         /* The number of transmit rings requested for the VF. */
8973         uint16_t        num_tx_rings;
8974         /* The number of receive rings requested for the VF. */
8975         uint16_t        num_rx_rings;
8976         /* The number of L2 contexts requested for the VF. */
8977         uint16_t        num_l2_ctxs;
8978         /* The number of vnics requested for the VF. */
8979         uint16_t        num_vnics;
8980         /* The number of statistic contexts requested for the VF. */
8981         uint16_t        num_stat_ctxs;
8982         /* The number of HW ring groups requested for the VF. */
8983         uint16_t        num_hw_ring_grps;
8984         uint8_t unused_0[4];
8985 } __rte_packed;
8986
8987 /* hwrm_func_vf_cfg_output (size:128b/16B) */
8988 struct hwrm_func_vf_cfg_output {
8989         /* The specific error status for the command. */
8990         uint16_t        error_code;
8991         /* The HWRM command request type. */
8992         uint16_t        req_type;
8993         /* The sequence ID from the original command. */
8994         uint16_t        seq_id;
8995         /* The length of the response data in number of bytes. */
8996         uint16_t        resp_len;
8997         uint8_t unused_0[7];
8998         /*
8999          * This field is used in Output records to indicate that the output
9000          * is completely written to RAM.  This field should be read as '1'
9001          * to indicate that the output has been completely written.
9002          * When writing a command completion or response to an internal processor,
9003          * the order of writes has to be such that this field is written last.
9004          */
9005         uint8_t valid;
9006 } __rte_packed;
9007
9008 /*******************
9009  * hwrm_func_qcaps *
9010  *******************/
9011
9012
9013 /* hwrm_func_qcaps_input (size:192b/24B) */
9014 struct hwrm_func_qcaps_input {
9015         /* The HWRM command request type. */
9016         uint16_t        req_type;
9017         /*
9018          * The completion ring to send the completion event on. This should
9019          * be the NQ ID returned from the `nq_alloc` HWRM command.
9020          */
9021         uint16_t        cmpl_ring;
9022         /*
9023          * The sequence ID is used by the driver for tracking multiple
9024          * commands. This ID is treated as opaque data by the firmware and
9025          * the value is returned in the `hwrm_resp_hdr` upon completion.
9026          */
9027         uint16_t        seq_id;
9028         /*
9029          * The target ID of the command:
9030          * * 0x0-0xFFF8 - The function ID
9031          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9032          * * 0xFFFD - Reserved for user-space HWRM interface
9033          * * 0xFFFF - HWRM
9034          */
9035         uint16_t        target_id;
9036         /*
9037          * A physical address pointer pointing to a host buffer that the
9038          * command's response data will be written. This can be either a host
9039          * physical address (HPA) or a guest physical address (GPA) and must
9040          * point to a physically contiguous block of memory.
9041          */
9042         uint64_t        resp_addr;
9043         /*
9044          * Function ID of the function that is being queried.
9045          * 0xFF... (All Fs) if the query is for the requesting
9046          * function.
9047          * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
9048          * to be used by a trusted VF to query its parent PF.
9049          */
9050         uint16_t        fid;
9051         uint8_t unused_0[6];
9052 } __rte_packed;
9053
9054 /* hwrm_func_qcaps_output (size:704b/88B) */
9055 struct hwrm_func_qcaps_output {
9056         /* The specific error status for the command. */
9057         uint16_t        error_code;
9058         /* The HWRM command request type. */
9059         uint16_t        req_type;
9060         /* The sequence ID from the original command. */
9061         uint16_t        seq_id;
9062         /* The length of the response data in number of bytes. */
9063         uint16_t        resp_len;
9064         /*
9065          * FID value.  This value is used to identify operations on the PCI
9066          * bus as belonging to a particular PCI function.
9067          */
9068         uint16_t        fid;
9069         /*
9070          * Port ID of port that this function is associated with.
9071          * Valid only for the PF.
9072          * 0xFF... (All Fs) if this function is not associated with
9073          * any port.
9074          * 0xFF... (All Fs) if this function is called from a VF.
9075          */
9076         uint16_t        port_id;
9077         uint32_t        flags;
9078         /* If 1, then Push mode is supported on this function. */
9079         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \
9080                 UINT32_C(0x1)
9081         /*
9082          * If 1, then the global MSI-X auto-masking is enabled for the
9083          * device.
9084          */
9085         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
9086                 UINT32_C(0x2)
9087         /*
9088          * If 1, then the Precision Time Protocol (PTP) processing
9089          * is supported on this function.
9090          * The HWRM should enable PTP on only a single Physical
9091          * Function (PF) per port.
9092          */
9093         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \
9094                 UINT32_C(0x4)
9095         /*
9096          * If 1, then RDMA over Converged Ethernet (RoCE) v1
9097          * is supported on this function.
9098          */
9099         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \
9100                 UINT32_C(0x8)
9101         /*
9102          * If 1, then RDMA over Converged Ethernet (RoCE) v2
9103          * is supported on this function.
9104          */
9105         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \
9106                 UINT32_C(0x10)
9107         /*
9108          * If 1, then control and configuration of WoL magic packet
9109          * are supported on this function.
9110          */
9111         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
9112                 UINT32_C(0x20)
9113         /*
9114          * If 1, then control and configuration of bitmap pattern
9115          * packet are supported on this function.
9116          */
9117         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \
9118                 UINT32_C(0x40)
9119         /*
9120          * If set to 1, then the control and configuration of rate limit
9121          * of an allocated TX ring on the queried function is supported.
9122          */
9123         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \
9124                 UINT32_C(0x80)
9125         /*
9126          * If 1, then control and configuration of minimum and
9127          * maximum bandwidths are supported on the queried function.
9128          */
9129         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \
9130                 UINT32_C(0x100)
9131         /*
9132          * If the query is for a VF, then this flag shall be ignored.
9133          * If this query is for a PF and this flag is set to 1,
9134          * then the PF has the capability to set the rate limits
9135          * on the TX rings of its children VFs.
9136          * If this query is for a PF and this flag is set to 0, then
9137          * the PF does not have the capability to set the rate limits
9138          * on the TX rings of its children VFs.
9139          */
9140         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
9141                 UINT32_C(0x200)
9142         /*
9143          * If the query is for a VF, then this flag shall be ignored.
9144          * If this query is for a PF and this flag is set to 1,
9145          * then the PF has the capability to set the minimum and/or
9146          * maximum bandwidths for its children VFs.
9147          * If this query is for a PF and this flag is set to 0, then
9148          * the PF does not have the capability to set the minimum or
9149          * maximum bandwidths for its children VFs.
9150          */
9151         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \
9152                 UINT32_C(0x400)
9153         /*
9154          * Standard TX Ring mode is used for the allocation of TX ring
9155          * and underlying scheduling resources that allow bandwidth
9156          * reservation and limit settings on the queried function.
9157          * If set to 1, then standard TX ring mode is supported
9158          * on the queried function.
9159          * If set to 0, then standard TX ring mode is not available
9160          * on the queried function.
9161          */
9162         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
9163                 UINT32_C(0x800)
9164         /*
9165          * If the query is for a VF, then this flag shall be ignored,
9166          * If this query is for a PF and this flag is set to 1,
9167          * then the PF has the capability to detect GENEVE tunnel
9168          * flags.
9169          */
9170         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \
9171                 UINT32_C(0x1000)
9172         /*
9173          * If the query is for a VF, then this flag shall be ignored,
9174          * If this query is for a PF and this flag is set to 1,
9175          * then the PF has the capability to detect NVGRE tunnel
9176          * flags.
9177          */
9178         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \
9179                 UINT32_C(0x2000)
9180         /*
9181          * If the query is for a VF, then this flag shall be ignored,
9182          * If this query is for a PF and this flag is set to 1,
9183          * then the PF has the capability to detect GRE tunnel
9184          * flags.
9185          */
9186         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \
9187                 UINT32_C(0x4000)
9188         /*
9189          * If the query is for a VF, then this flag shall be ignored,
9190          * If this query is for a PF and this flag is set to 1,
9191          * then the PF has the capability to detect MPLS tunnel
9192          * flags.
9193          */
9194         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \
9195                 UINT32_C(0x8000)
9196         /*
9197          * If the query is for a VF, then this flag shall be ignored,
9198          * If this query is for a PF and this flag is set to 1,
9199          * then the PF has the capability to support pcie stats.
9200          */
9201         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \
9202                 UINT32_C(0x10000)
9203         /*
9204          * If the query is for a VF, then this flag shall be ignored,
9205          * If this query is for a PF and this flag is set to 1,
9206          * then the PF has the capability to adopt the VF's belonging
9207          * to another PF.
9208          */
9209         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED \
9210                 UINT32_C(0x20000)
9211         /*
9212          * If the query is for a VF, then this flag shall be ignored,
9213          * If this query is for a PF and this flag is set to 1,
9214          * then the PF has the administrative privilege to configure another PF
9215          */
9216         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED \
9217                 UINT32_C(0x40000)
9218         /*
9219          * If the query is for a VF, then this flag shall be ignored.
9220          * If this query is for a PF and this flag is set to 1, then
9221          * the PF will know that the firmware has the capability to track
9222          * the virtual link status.
9223          */
9224         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED \
9225                 UINT32_C(0x80000)
9226         /*
9227          * If 1, then this function supports the push mode that uses
9228          * write combine buffers and the long inline tx buffer descriptor.
9229          */
9230         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE \
9231                 UINT32_C(0x100000)
9232         /*
9233          * If 1, then FW has capability to allocate TX rings dynamically
9234          * in ring alloc even if PF reserved pool is zero.
9235          * This bit will be used only for PFs.
9236          */
9237         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
9238                 UINT32_C(0x200000)
9239         /*
9240          * When this bit is '1', it indicates that core firmware is
9241          * capable of Hot Reset.
9242          */
9243         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE \
9244                 UINT32_C(0x400000)
9245         /*
9246          * This flag will be set to 1 by the FW if FW supports adapter error
9247          * recovery.
9248          */
9249         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE \
9250                 UINT32_C(0x800000)
9251         /*
9252          * If the query is for a VF, then this flag shall be ignored.
9253          * If this query is for a PF and this flag is set to 1, then
9254          * the PF has the capability to support extended stats.
9255          */
9256         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED \
9257                 UINT32_C(0x1000000)
9258         /*
9259          * If the query is for a VF, then this flag shall be ignored.
9260          * If this query is for a PF and this flag is set to 1, then host
9261          * must initiate reset or reload (or fastboot) the firmware image
9262          * upon detection of device shutdown state.
9263          */
9264         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD \
9265                 UINT32_C(0x2000000)
9266         /*
9267          * If the query is for a VF, then this flag (always set to 0) shall
9268          * be ignored. If this query is for a PF and this flag is set to 1,
9269          * host, when registered for the default vnic change async event,
9270          * receives async notification whenever a default vnic state is
9271          * changed for any of child or adopted VFs.
9272          */
9273         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED \
9274                 UINT32_C(0x4000000)
9275         /* If set to 1, then the vlan acceleration for TX is disabled. */
9276         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED \
9277                 UINT32_C(0x8000000)
9278         /*
9279          * When this bit is '1', it indicates that core firmware supports
9280          * DBG_COREDUMP_XXX commands.
9281          */
9282         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_COREDUMP_CMD_SUPPORTED \
9283                 UINT32_C(0x10000000)
9284         /*
9285          * When this bit is '1', it indicates that core firmware supports
9286          * DBG_CRASHDUMP_XXX commands.
9287          */
9288         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_CRASHDUMP_CMD_SUPPORTED \
9289                 UINT32_C(0x20000000)
9290         /*
9291          * If the query is for a VF, then this flag should be ignored.
9292          * If the query is for a PF and this flag is set to 1, then
9293          * the PF has the capability to support retrieval of
9294          * rx_port_stats_ext_pfc_wd statistics (supported by the PFC
9295          * WatchDog feature) via the hwrm_port_qstats_ext_pfc_wd command.
9296          * If this flag is set to 1, only that (supported) command should
9297          * be used for retrieval of PFC related statistics (rather than
9298          * hwrm_port_qstats_ext command, which could previously be used).
9299          */
9300         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED \
9301                 UINT32_C(0x40000000)
9302         /*
9303          * When this bit is '1', it indicates that core firmware supports
9304          * DBG_QCAPS command
9305          */
9306         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED \
9307                 UINT32_C(0x80000000)
9308         /*
9309          * This value is current MAC address configured for this
9310          * function. A value of 00-00-00-00-00-00 indicates no
9311          * MAC address is currently configured.
9312          */
9313         uint8_t mac_address[6];
9314         /*
9315          * The maximum number of RSS/COS contexts that can be
9316          * allocated to the function.
9317          */
9318         uint16_t        max_rsscos_ctx;
9319         /*
9320          * The maximum number of completion rings that can be
9321          * allocated to the function.
9322          */
9323         uint16_t        max_cmpl_rings;
9324         /*
9325          * The maximum number of transmit rings that can be
9326          * allocated to the function.
9327          */
9328         uint16_t        max_tx_rings;
9329         /*
9330          * The maximum number of receive rings that can be
9331          * allocated to the function.
9332          */
9333         uint16_t        max_rx_rings;
9334         /*
9335          * The maximum number of L2 contexts that can be
9336          * allocated to the function.
9337          */
9338         uint16_t        max_l2_ctxs;
9339         /*
9340          * The maximum number of VNICs that can be
9341          * allocated to the function.
9342          */
9343         uint16_t        max_vnics;
9344         /*
9345          * The identifier for the first VF enabled on a PF. This
9346          * is valid only on the PF with SR-IOV enabled.
9347          * 0xFF... (All Fs) if this command is called on a PF with
9348          * SR-IOV disabled or on a VF.
9349          */
9350         uint16_t        first_vf_id;
9351         /*
9352          * The maximum number of VFs that can be
9353          * allocated to the function. This is valid only on the
9354          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
9355          * command is called on a PF with SR-IOV disabled or
9356          * on a VF.
9357          */
9358         uint16_t        max_vfs;
9359         /*
9360          * The maximum number of statistic contexts that can be
9361          * allocated to the function.
9362          */
9363         uint16_t        max_stat_ctx;
9364         /*
9365          * The maximum number of Encapsulation records that can be
9366          * offloaded by this function.
9367          */
9368         uint32_t        max_encap_records;
9369         /*
9370          * The maximum number of decapsulation records that can
9371          * be offloaded by this function.
9372          */
9373         uint32_t        max_decap_records;
9374         /*
9375          * The maximum number of Exact Match (EM) flows that can be
9376          * offloaded by this function on the TX side.
9377          */
9378         uint32_t        max_tx_em_flows;
9379         /*
9380          * The maximum number of Wildcard Match (WM) flows that can
9381          * be offloaded by this function on the TX side.
9382          */
9383         uint32_t        max_tx_wm_flows;
9384         /*
9385          * The maximum number of Exact Match (EM) flows that can be
9386          * offloaded by this function on the RX side.
9387          */
9388         uint32_t        max_rx_em_flows;
9389         /*
9390          * The maximum number of Wildcard Match (WM) flows that can
9391          * be offloaded by this function on the RX side.
9392          */
9393         uint32_t        max_rx_wm_flows;
9394         /*
9395          * The maximum number of multicast filters that can
9396          * be supported by this function on the RX side.
9397          */
9398         uint32_t        max_mcast_filters;
9399         /*
9400          * The maximum value of flow_id that can be supported
9401          * in completion records.
9402          */
9403         uint32_t        max_flow_id;
9404         /*
9405          * The maximum number of HW ring groups that can be
9406          * supported on this function.
9407          */
9408         uint32_t        max_hw_ring_grps;
9409         /*
9410          * The maximum number of strict priority transmit rings
9411          * that can be allocated to the function.
9412          * This number indicates the maximum number of TX rings
9413          * that can be assigned strict priorities out of the
9414          * maximum number of TX rings that can be allocated
9415          * (max_tx_rings) to the function.
9416          */
9417         uint16_t        max_sp_tx_rings;
9418         uint8_t unused_0[2];
9419         uint32_t        flags_ext;
9420         /*
9421          * If 1, the device can be configured to set the ECN bits in the
9422          * IP header of received packets if the receive queue length
9423          * exceeds a given threshold.
9424          */
9425         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_MARK_SUPPORTED \
9426                 UINT32_C(0x1)
9427         /*
9428          * If 1, the device can report the number of received packets
9429          * that it marked as having experienced congestion.
9430          */
9431         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED \
9432                 UINT32_C(0x2)
9433         /*
9434          * If 1, the device can report extended hw statistics (including
9435          * additional tpa statistics).
9436          */
9437         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED \
9438                 UINT32_C(0x4)
9439         /*
9440          * If set to 1, then the core firmware has support to enable/
9441          * disable hot reset support for interface dynamically through
9442          * HWRM_FUNC_CFG.
9443          */
9444         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT \
9445                 UINT32_C(0x8)
9446         /* If 1, the proxy mode is supported on this function */
9447         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PROXY_MODE_SUPPORT \
9448                 UINT32_C(0x10)
9449         /*
9450          * If 1, the tx rings source interface override feature is supported
9451          * on this function.
9452          */
9453         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT \
9454                 UINT32_C(0x20)
9455         /*
9456          * If 1, the device supports scheduler queues. SCHQs can be managed
9457          * using RING_SCHQ_ALLOC/CFG/FREE commands.
9458          */
9459         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SCHQ_SUPPORTED \
9460                 UINT32_C(0x40)
9461         /*
9462          * If set to 1, then this function supports the TX push mode that
9463          * uses ping-pong buffers from the push pages.
9464          */
9465         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED \
9466                 UINT32_C(0x80)
9467         /* The maximum number of SCHQs supported by this device. */
9468         uint8_t max_schqs;
9469         uint8_t unused_1[2];
9470         /*
9471          * This field is used in Output records to indicate that the output
9472          * is completely written to RAM.  This field should be read as '1'
9473          * to indicate that the output has been completely written.
9474          * When writing a command completion or response to an internal processor,
9475          * the order of writes has to be such that this field is written last.
9476          */
9477         uint8_t valid;
9478 } __rte_packed;
9479
9480 /******************
9481  * hwrm_func_qcfg *
9482  ******************/
9483
9484
9485 /* hwrm_func_qcfg_input (size:192b/24B) */
9486 struct hwrm_func_qcfg_input {
9487         /* The HWRM command request type. */
9488         uint16_t        req_type;
9489         /*
9490          * The completion ring to send the completion event on. This should
9491          * be the NQ ID returned from the `nq_alloc` HWRM command.
9492          */
9493         uint16_t        cmpl_ring;
9494         /*
9495          * The sequence ID is used by the driver for tracking multiple
9496          * commands. This ID is treated as opaque data by the firmware and
9497          * the value is returned in the `hwrm_resp_hdr` upon completion.
9498          */
9499         uint16_t        seq_id;
9500         /*
9501          * The target ID of the command:
9502          * * 0x0-0xFFF8 - The function ID
9503          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9504          * * 0xFFFD - Reserved for user-space HWRM interface
9505          * * 0xFFFF - HWRM
9506          */
9507         uint16_t        target_id;
9508         /*
9509          * A physical address pointer pointing to a host buffer that the
9510          * command's response data will be written. This can be either a host
9511          * physical address (HPA) or a guest physical address (GPA) and must
9512          * point to a physically contiguous block of memory.
9513          */
9514         uint64_t        resp_addr;
9515         /*
9516          * Function ID of the function that is being queried.
9517          * 0xFF... (All Fs) if the query is for the requesting
9518          * function.
9519          * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
9520          * to be used by a trusted VF to query its parent PF.
9521          */
9522         uint16_t        fid;
9523         uint8_t unused_0[6];
9524 } __rte_packed;
9525
9526 /* hwrm_func_qcfg_output (size:768b/96B) */
9527 struct hwrm_func_qcfg_output {
9528         /* The specific error status for the command. */
9529         uint16_t        error_code;
9530         /* The HWRM command request type. */
9531         uint16_t        req_type;
9532         /* The sequence ID from the original command. */
9533         uint16_t        seq_id;
9534         /* The length of the response data in number of bytes. */
9535         uint16_t        resp_len;
9536         /*
9537          * FID value.  This value is used to identify operations on the PCI
9538          * bus as belonging to a particular PCI function.
9539          */
9540         uint16_t        fid;
9541         /*
9542          * Port ID of port that this function is associated with.
9543          * 0xFF... (All Fs) if this function is not associated with
9544          * any port.
9545          */
9546         uint16_t        port_id;
9547         /*
9548          * This value is the current VLAN setting for this
9549          * function. The value of 0 for this field indicates
9550          * no priority tagging or VLAN is used.
9551          * This field's format is same as 802.1Q Tag's
9552          * Tag Control Information (TCI) format that includes both
9553          * Priority Code Point (PCP) and VLAN Identifier (VID).
9554          */
9555         uint16_t        vlan;
9556         uint16_t        flags;
9557         /*
9558          * If 1, then magic packet based Out-Of-Box WoL is enabled on
9559          * the port associated with this function.
9560          */
9561         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
9562                 UINT32_C(0x1)
9563         /*
9564          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
9565          * on the port associated with this function.
9566          */
9567         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
9568                 UINT32_C(0x2)
9569         /*
9570          * If set to 1, then FW based DCBX agent is enabled and running on
9571          * the port associated with this function.
9572          * If set to 0, then DCBX agent is not running in the firmware.
9573          */
9574         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
9575                 UINT32_C(0x4)
9576         /*
9577          * Standard TX Ring mode is used for the allocation of TX ring
9578          * and underlying scheduling resources that allow bandwidth
9579          * reservation and limit settings on the queried function.
9580          * If set to 1, then standard TX ring mode is enabled
9581          * on the queried function.
9582          * If set to 0, then the standard TX ring mode is disabled
9583          * on the queried function. In this extended TX ring resource
9584          * mode, the minimum and maximum bandwidth settings are not
9585          * supported to allow the allocation of TX rings to span multiple
9586          * scheduler nodes.
9587          */
9588         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
9589                 UINT32_C(0x8)
9590         /*
9591          * If set to 1 then FW based LLDP agent is enabled and running on
9592          * the port associated with this function.
9593          * If set to 0 then the LLDP agent is not running in the firmware.
9594          */
9595         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
9596                 UINT32_C(0x10)
9597         /*
9598          * If set to 1, then multi-host mode is active for this function.
9599          * If set to 0, then multi-host mode is inactive for this function
9600          * or not applicable for this device.
9601          */
9602         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
9603                 UINT32_C(0x20)
9604         /*
9605          * If the function that is being queried is a PF, then the HWRM shall
9606          * set this field to 0 and the HWRM client shall ignore this field.
9607          * If the function that is being queried is a VF, then the HWRM shall
9608          * set this field to 1 if the queried VF is trusted, otherwise the HWRM
9609          * shall set this field to 0.
9610          */
9611         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \
9612                 UINT32_C(0x40)
9613         /*
9614          * If set to 1, then secure mode is enabled for this function or device.
9615          * If set to 0, then secure mode is disabled (or normal mode) for this
9616          * function or device.
9617          */
9618         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED \
9619                 UINT32_C(0x80)
9620         /*
9621          * If set to 1, then this PF is enabled with a preboot driver that
9622          * requires access to the legacy L2 ring model and legacy 32b
9623          * doorbells. If set to 0, then this PF is not allowed to use
9624          * the legacy L2 rings. This feature is not allowed on VFs and
9625          * is only relevant for devices that require a context backing
9626          * store.
9627          */
9628         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
9629                 UINT32_C(0x100)
9630         /*
9631          * If set to 1, then the firmware and all currently registered driver
9632          * instances support hot reset. The hot reset support will be updated
9633          * dynamically based on the driver interface advertisement.
9634          * If set to 0, then the adapter is not currently able to initiate
9635          * hot reset.
9636          */
9637         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED \
9638                 UINT32_C(0x200)
9639         /*
9640          * If set to 1, then the PPP tx push mode is enabled for all the
9641          * reserved TX rings of this function. If set to 0, then PPP tx push
9642          * mode is disabled for all the reserved TX rings of this function.
9643          */
9644         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PPP_PUSH_MODE_ENABLED \
9645                 UINT32_C(0x400)
9646         /*
9647          * This value is current MAC address configured for this
9648          * function. A value of 00-00-00-00-00-00 indicates no
9649          * MAC address is currently configured.
9650          */
9651         uint8_t mac_address[6];
9652         /*
9653          * This value is current PCI ID of this
9654          * function. If ARI is enabled, then it is
9655          * Bus Number (8b):Function Number(8b). Otherwise, it is
9656          * Bus Number (8b):Device Number (4b):Function Number(4b).
9657          * If multi-host mode is active, the 4 lsb will indicate
9658          * the PF index for this function.
9659          */
9660         uint16_t        pci_id;
9661         /*
9662          * The number of RSS/COS contexts currently
9663          * allocated to the function.
9664          */
9665         uint16_t        alloc_rsscos_ctx;
9666         /*
9667          * The number of completion rings currently allocated to
9668          * the function. This does not include the rings allocated
9669          * to any children functions if any.
9670          */
9671         uint16_t        alloc_cmpl_rings;
9672         /*
9673          * The number of transmit rings currently allocated to
9674          * the function. This does not include the rings allocated
9675          * to any children functions if any.
9676          */
9677         uint16_t        alloc_tx_rings;
9678         /*
9679          * The number of receive rings currently allocated to
9680          * the function. This does not include the rings allocated
9681          * to any children functions if any.
9682          */
9683         uint16_t        alloc_rx_rings;
9684         /* The allocated number of L2 contexts to the function. */
9685         uint16_t        alloc_l2_ctx;
9686         /* The allocated number of vnics to the function. */
9687         uint16_t        alloc_vnics;
9688         /*
9689          * The maximum transmission unit of the function.
9690          * If the reported mtu value is non-zero then it will used for the
9691          * rings allocated on this function. otherwise the default
9692          * value is used if ring MTU is not specified.
9693          */
9694         uint16_t        mtu;
9695         /*
9696          * The maximum receive unit of the function.
9697          * For vnics allocated on this function, this default
9698          * value is used if vnic MRU is not specified.
9699          */
9700         uint16_t        mru;
9701         /* The statistics context assigned to a function. */
9702         uint16_t        stat_ctx_id;
9703         /*
9704          * The HWRM shall return Unknown value for this field
9705          * when this command is used to query VF's configuration.
9706          */
9707         uint8_t port_partition_type;
9708         /* Single physical function */
9709         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
9710         /* Multiple physical functions */
9711         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
9712         /* Network Partitioning 1.0 */
9713         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
9714         /* Network Partitioning 1.5 */
9715         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
9716         /* Network Partitioning 2.0 */
9717         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
9718         /* Unknown */
9719         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
9720                 UINT32_C(0xff)
9721         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
9722                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
9723         /*
9724          * This field will indicate number of physical functions on this port_partition.
9725          * HWRM shall return unavail (i.e. value of 0) for this field
9726          * when this command is used to query VF's configuration or
9727          * from older firmware that doesn't support this field.
9728          */
9729         uint8_t port_pf_cnt;
9730         /* number of PFs is not available */
9731         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
9732         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
9733                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
9734         /*
9735          * The default VNIC ID assigned to a function that is
9736          * being queried.
9737          */
9738         uint16_t        dflt_vnic_id;
9739         uint16_t        max_mtu_configured;
9740         /*
9741          * Minimum BW allocated for this function.
9742          * The HWRM will translate this value into byte counter and
9743          * time interval used for the scheduler inside the device.
9744          * A value of 0 indicates the minimum bandwidth is not
9745          * configured.
9746          */
9747         uint32_t        min_bw;
9748         /* The bandwidth value. */
9749         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
9750                 UINT32_C(0xfffffff)
9751         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
9752         /* The granularity of the value (bits or bytes). */
9753         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
9754                 UINT32_C(0x10000000)
9755         /* Value is in bits. */
9756         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
9757                 (UINT32_C(0x0) << 28)
9758         /* Value is in bytes. */
9759         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
9760                 (UINT32_C(0x1) << 28)
9761         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
9762                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
9763         /* bw_value_unit is 3 b */
9764         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
9765                 UINT32_C(0xe0000000)
9766         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
9767         /* Value is in Mb or MB (base 10). */
9768         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
9769                 (UINT32_C(0x0) << 29)
9770         /* Value is in Kb or KB (base 10). */
9771         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
9772                 (UINT32_C(0x2) << 29)
9773         /* Value is in bits or bytes. */
9774         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
9775                 (UINT32_C(0x4) << 29)
9776         /* Value is in Gb or GB (base 10). */
9777         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
9778                 (UINT32_C(0x6) << 29)
9779         /* Value is in 1/100th of a percentage of total bandwidth. */
9780         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
9781                 (UINT32_C(0x1) << 29)
9782         /* Invalid unit */
9783         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
9784                 (UINT32_C(0x7) << 29)
9785         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
9786                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
9787         /*
9788          * Maximum BW allocated for this function.
9789          * The HWRM will translate this value into byte counter and
9790          * time interval used for the scheduler inside the device.
9791          * A value of 0 indicates that the maximum bandwidth is not
9792          * configured.
9793          */
9794         uint32_t        max_bw;
9795         /* The bandwidth value. */
9796         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
9797                 UINT32_C(0xfffffff)
9798         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
9799         /* The granularity of the value (bits or bytes). */
9800         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
9801                 UINT32_C(0x10000000)
9802         /* Value is in bits. */
9803         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
9804                 (UINT32_C(0x0) << 28)
9805         /* Value is in bytes. */
9806         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
9807                 (UINT32_C(0x1) << 28)
9808         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
9809                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
9810         /* bw_value_unit is 3 b */
9811         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
9812                 UINT32_C(0xe0000000)
9813         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
9814         /* Value is in Mb or MB (base 10). */
9815         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
9816                 (UINT32_C(0x0) << 29)
9817         /* Value is in Kb or KB (base 10). */
9818         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
9819                 (UINT32_C(0x2) << 29)
9820         /* Value is in bits or bytes. */
9821         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
9822                 (UINT32_C(0x4) << 29)
9823         /* Value is in Gb or GB (base 10). */
9824         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
9825                 (UINT32_C(0x6) << 29)
9826         /* Value is in 1/100th of a percentage of total bandwidth. */
9827         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
9828                 (UINT32_C(0x1) << 29)
9829         /* Invalid unit */
9830         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
9831                 (UINT32_C(0x7) << 29)
9832         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
9833                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
9834         /*
9835          * This value indicates the Edge virtual bridge mode for the
9836          * domain that this function belongs to.
9837          */
9838         uint8_t evb_mode;
9839         /* No Edge Virtual Bridging (EVB) */
9840         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
9841         /* Virtual Ethernet Bridge (VEB) */
9842         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
9843         /* Virtual Ethernet Port Aggregator (VEPA) */
9844         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
9845         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
9846                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
9847         uint8_t options;
9848         /*
9849          * This value indicates the PCIE device cache line size.
9850          * The cache line size allows the DMA writes to terminate and
9851          * start at the cache boundary.
9852          */
9853         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
9854                 UINT32_C(0x3)
9855         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT          0
9856         /* Cache Line Size 64 bytes */
9857         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
9858                 UINT32_C(0x0)
9859         /* Cache Line Size 128 bytes */
9860         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
9861                 UINT32_C(0x1)
9862         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
9863                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
9864         /* This value is the virtual link admin state setting. */
9865         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
9866                 UINT32_C(0xc)
9867         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
9868         /* Admin link state is in forced down mode. */
9869         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
9870                 (UINT32_C(0x0) << 2)
9871         /* Admin link state is in forced up mode. */
9872         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
9873                 (UINT32_C(0x1) << 2)
9874         /* Admin link state is in auto mode  - follows the physical link state. */
9875         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
9876                 (UINT32_C(0x2) << 2)
9877         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
9878                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
9879         /* Reserved for future. */
9880         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
9881                 UINT32_C(0xf0)
9882         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT                    4
9883         /*
9884          * The number of VFs that are allocated to the function.
9885          * This is valid only on the PF with SR-IOV enabled.
9886          * 0xFF... (All Fs) if this command is called on a PF with
9887          * SR-IOV disabled or on a VF.
9888          */
9889         uint16_t        alloc_vfs;
9890         /*
9891          * The number of allocated multicast filters for this
9892          * function on the RX side.
9893          */
9894         uint32_t        alloc_mcast_filters;
9895         /*
9896          * The number of allocated HW ring groups for this
9897          * function.
9898          */
9899         uint32_t        alloc_hw_ring_grps;
9900         /*
9901          * The number of strict priority transmit rings out of
9902          * currently allocated TX rings to the function
9903          * (alloc_tx_rings).
9904          */
9905         uint16_t        alloc_sp_tx_rings;
9906         /*
9907          * The number of statistics contexts
9908          * currently reserved for the function.
9909          */
9910         uint16_t        alloc_stat_ctx;
9911         /*
9912          * This field specifies how many NQs are reserved for the PF.
9913          * Remaining NQs that belong to the PF are available for VFs.
9914          * Once a PF has created VFs, it cannot change how many NQs are
9915          * reserved for itself (since the NQs must be contiguous in HW).
9916          */
9917         uint16_t        alloc_msix;
9918         /*
9919          * The number of registered VF’s associated with the PF. This field
9920          * should be ignored when the request received on the VF interface.
9921          * This field will be updated on the PF interface to initiate
9922          * the unregister request on PF in the HOT Reset Process.
9923          */
9924         uint16_t        registered_vfs;
9925         /*
9926          * The size of the doorbell BAR in KBytes reserved for L2 including
9927          * any area that is shared between L2 and RoCE.  The L2 driver
9928          * should only map the L2 portion of the doorbell BAR.  Any rounding
9929          * of the BAR size to the native CPU page size should be performed
9930          * by the driver.  If the value is zero, no special partitioning
9931          * of the doorbell BAR between L2 and RoCE is required.
9932          */
9933         uint16_t        l2_doorbell_bar_size_kb;
9934         uint8_t unused_1;
9935         /*
9936          * For backward compatibility this field must be set to 1.
9937          * Older drivers might look for this field to be 1 before
9938          * processing the message.
9939          */
9940         uint8_t always_1;
9941         /*
9942          * This GRC address location is used by the Host driver interfaces to poll
9943          * the adapter ready state to re-initiate the registration process again
9944          * after receiving the RESET Notify event.
9945          */
9946         uint32_t        reset_addr_poll;
9947         /*
9948          * This field specifies legacy L2 doorbell size in KBytes. Drivers should use
9949          * this value to find out the doorbell page offset from the BAR.
9950          */
9951         uint16_t        legacy_l2_db_size_kb;
9952         uint16_t        svif_info;
9953         /*
9954          * This field specifies the source virtual interface of the function being
9955          * queried. Drivers can use this to program svif field in the L2 context
9956          * table
9957          */
9958         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK      UINT32_C(0x7fff)
9959         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_SFT       0
9960         /* This field specifies whether svif is valid or not */
9961         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID     UINT32_C(0x8000)
9962         uint8_t unused_2[7];
9963         /*
9964          * This field is used in Output records to indicate that the output
9965          * is completely written to RAM.  This field should be read as '1'
9966          * to indicate that the output has been completely written.
9967          * When writing a command completion or response to an internal processor,
9968          * the order of writes has to be such that this field is written last.
9969          */
9970         uint8_t valid;
9971 } __rte_packed;
9972
9973 /*****************
9974  * hwrm_func_cfg *
9975  *****************/
9976
9977
9978 /* hwrm_func_cfg_input (size:768b/96B) */
9979 struct hwrm_func_cfg_input {
9980         /* The HWRM command request type. */
9981         uint16_t        req_type;
9982         /*
9983          * The completion ring to send the completion event on. This should
9984          * be the NQ ID returned from the `nq_alloc` HWRM command.
9985          */
9986         uint16_t        cmpl_ring;
9987         /*
9988          * The sequence ID is used by the driver for tracking multiple
9989          * commands. This ID is treated as opaque data by the firmware and
9990          * the value is returned in the `hwrm_resp_hdr` upon completion.
9991          */
9992         uint16_t        seq_id;
9993         /*
9994          * The target ID of the command:
9995          * * 0x0-0xFFF8 - The function ID
9996          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9997          * * 0xFFFD - Reserved for user-space HWRM interface
9998          * * 0xFFFF - HWRM
9999          */
10000         uint16_t        target_id;
10001         /*
10002          * A physical address pointer pointing to a host buffer that the
10003          * command's response data will be written. This can be either a host
10004          * physical address (HPA) or a guest physical address (GPA) and must
10005          * point to a physically contiguous block of memory.
10006          */
10007         uint64_t        resp_addr;
10008         /*
10009          * Function ID of the function that is being
10010          * configured.
10011          * If set to 0xFF... (All Fs), then the the configuration is
10012          * for the requesting function.
10013          */
10014         uint16_t        fid;
10015         /*
10016          * This field specifies how many NQs will be reserved for the PF.
10017          * Remaining NQs that belong to the PF become available for VFs.
10018          * Once a PF has created VFs, it cannot change how many NQs are
10019          * reserved for itself (since the NQs must be contiguous in HW).
10020          */
10021         uint16_t        num_msix;
10022         uint32_t        flags;
10023         /*
10024          * When this bit is '1', the function is disabled with
10025          * source MAC address check.
10026          * This is an anti-spoofing check. If this flag is set,
10027          * then the function shall be configured to disallow
10028          * transmission of frames with the source MAC address that
10029          * is configured for this function.
10030          */
10031         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
10032                 UINT32_C(0x1)
10033         /*
10034          * When this bit is '1', the function is enabled with
10035          * source MAC address check.
10036          * This is an anti-spoofing check. If this flag is set,
10037          * then the function shall be configured to allow
10038          * transmission of frames with the source MAC address that
10039          * is configured for this function.
10040          */
10041         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
10042                 UINT32_C(0x2)
10043         /* reserved. */
10044         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
10045                 UINT32_C(0x1fc)
10046         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
10047         /*
10048          * Standard TX Ring mode is used for the allocation of TX ring
10049          * and underlying scheduling resources that allow bandwidth
10050          * reservation and limit settings on the queried function.
10051          * If set to 1, then standard TX ring mode is requested to be
10052          * enabled on the function being configured.
10053          */
10054         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
10055                 UINT32_C(0x200)
10056         /*
10057          * Standard TX Ring mode is used for the allocation of TX ring
10058          * and underlying scheduling resources that allow bandwidth
10059          * reservation and limit settings on the queried function.
10060          * If set to 1, then the standard TX ring mode is requested to
10061          * be disabled on the function being configured. In this extended
10062          * TX ring resource mode, the minimum and maximum bandwidth settings
10063          * are not supported to allow the allocation of TX rings to
10064          * span multiple scheduler nodes.
10065          */
10066         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
10067                 UINT32_C(0x400)
10068         /*
10069          * If this bit is set, virtual mac address configured
10070          * in this command will be persistent over warm boot.
10071          */
10072         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
10073                 UINT32_C(0x800)
10074         /*
10075          * This bit only applies to the VF. If this bit is set, the statistic
10076          * context counters will not be cleared when the statistic context is freed
10077          * or a function reset is called on VF. This bit will be cleared when the PF
10078          * is unloaded or a function reset is called on the PF.
10079          */
10080         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
10081                 UINT32_C(0x1000)
10082         /*
10083          * This bit requests that the firmware test to see if all the assets
10084          * requested in this command (i.e. number of TX rings) are available.
10085          * The firmware will return an error if the requested assets are
10086          * not available. The firwmare will NOT reserve the assets if they
10087          * are available.
10088          */
10089         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
10090                 UINT32_C(0x2000)
10091         /*
10092          * This bit requests that the firmware test to see if all the assets
10093          * requested in this command (i.e. number of RX rings) are available.
10094          * The firmware will return an error if the requested assets are
10095          * not available. The firwmare will NOT reserve the assets if they
10096          * are available.
10097          */
10098         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
10099                 UINT32_C(0x4000)
10100         /*
10101          * This bit requests that the firmware test to see if all the assets
10102          * requested in this command (i.e. number of CMPL rings) are available.
10103          * The firmware will return an error if the requested assets are
10104          * not available. The firwmare will NOT reserve the assets if they
10105          * are available.
10106          */
10107         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
10108                 UINT32_C(0x8000)
10109         /*
10110          * This bit requests that the firmware test to see if all the assets
10111          * requested in this command (i.e. number of RSS ctx) are available.
10112          * The firmware will return an error if the requested assets are
10113          * not available. The firwmare will NOT reserve the assets if they
10114          * are available.
10115          */
10116         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
10117                 UINT32_C(0x10000)
10118         /*
10119          * This bit requests that the firmware test to see if all the assets
10120          * requested in this command (i.e. number of ring groups) are available.
10121          * The firmware will return an error if the requested assets are
10122          * not available. The firwmare will NOT reserve the assets if they
10123          * are available.
10124          */
10125         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
10126                 UINT32_C(0x20000)
10127         /*
10128          * This bit requests that the firmware test to see if all the assets
10129          * requested in this command (i.e. number of stat ctx) are available.
10130          * The firmware will return an error if the requested assets are
10131          * not available. The firwmare will NOT reserve the assets if they
10132          * are available.
10133          */
10134         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
10135                 UINT32_C(0x40000)
10136         /*
10137          * This bit requests that the firmware test to see if all the assets
10138          * requested in this command (i.e. number of VNICs) are available.
10139          * The firmware will return an error if the requested assets are
10140          * not available. The firwmare will NOT reserve the assets if they
10141          * are available.
10142          */
10143         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
10144                 UINT32_C(0x80000)
10145         /*
10146          * This bit requests that the firmware test to see if all the assets
10147          * requested in this command (i.e. number of L2 ctx) are available.
10148          * The firmware will return an error if the requested assets are
10149          * not available. The firwmare will NOT reserve the assets if they
10150          * are available.
10151          */
10152         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
10153                 UINT32_C(0x100000)
10154         /*
10155          * This configuration change can be initiated by a PF driver. This
10156          * configuration request shall be targeted to a VF. From local host
10157          * resident HWRM clients, only the parent PF driver shall be allowed
10158          * to initiate this change on one of its children VFs. If this bit is
10159          * set to 1, then the VF that is being configured is requested to be
10160          * trusted.
10161          */
10162         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \
10163                 UINT32_C(0x200000)
10164         /*
10165          * When this bit it set, even if PF reserved pool size is zero,
10166          * FW will allow driver to create TX rings in ring alloc,
10167          * by reserving TX ring, S3 node dynamically.
10168          */
10169         #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
10170                 UINT32_C(0x400000)
10171         /*
10172          * This bit requests that the firmware test to see if all the assets
10173          * requested in this command (i.e. number of NQ rings) are available.
10174          * The firmware will return an error if the requested assets are
10175          * not available. The firwmare will NOT reserve the assets if they
10176          * are available.
10177          */
10178         #define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST \
10179                 UINT32_C(0x800000)
10180         /*
10181          * This configuration change can be initiated by a PF driver. This
10182          * configuration request shall be targeted to a VF. From local host
10183          * resident HWRM clients, only the parent PF driver shall be allowed
10184          * to initiate this change on one of its children VFs. If this bit is
10185          * set to 1, then the VF that is being configured is requested to be
10186          * untrusted.
10187          */
10188         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE \
10189                 UINT32_C(0x1000000)
10190         /*
10191          * This bit is used by preboot drivers on a PF that require access
10192          * to the legacy L2 ring model and legacy 32b doorbells. This
10193          * feature is not allowed on VFs and is only relevant for devices
10194          * that require a context backing store.
10195          */
10196         #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
10197                 UINT32_C(0x2000000)
10198         /*
10199          * If this bit is set to 0, then the interface does not support hot
10200          * reset capability which it advertised with the hot_reset_support
10201          * flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this
10202          * flag to 0, adapter cannot do the hot reset. In this state, if the
10203          * firmware receives a hot reset request, firmware must fail the
10204          * request. If this bit is set to 1, then interface is renabling the
10205          * hot reset capability.
10206          */
10207         #define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS \
10208                 UINT32_C(0x4000000)
10209         /*
10210          * If this bit is set to 1, the PF driver is requesting FW
10211          * to enable PPP TX PUSH feature on all the TX rings specified in
10212          * the num_tx_rings field. By default, the PPP TX push feature is
10213          * disabled for all the TX rings of the function. This flag is
10214          * ignored if num_tx_rings field is not specified or the function
10215          * doesn't support PPP tx push feature.
10216          */
10217         #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE \
10218                 UINT32_C(0x8000000)
10219         /*
10220          * If this bit is set to 1, the PF driver is requesting FW
10221          * to disable PPP TX PUSH feature on all the TX rings specified in
10222          * the num_tx_rings field. This flag is ignored if num_tx_rings
10223          * field is not specified or the function doesn't support PPP tx
10224          * push feature.
10225          */
10226         #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE \
10227                 UINT32_C(0x10000000)
10228         uint32_t        enables;
10229         /*
10230          * This bit must be '1' for the mtu field to be
10231          * configured.
10232          */
10233         #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \
10234                 UINT32_C(0x1)
10235         /*
10236          * This bit must be '1' for the mru field to be
10237          * configured.
10238          */
10239         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
10240                 UINT32_C(0x2)
10241         /*
10242          * This bit must be '1' for the num_rsscos_ctxs field to be
10243          * configured.
10244          */
10245         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
10246                 UINT32_C(0x4)
10247         /*
10248          * This bit must be '1' for the num_cmpl_rings field to be
10249          * configured.
10250          */
10251         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
10252                 UINT32_C(0x8)
10253         /*
10254          * This bit must be '1' for the num_tx_rings field to be
10255          * configured.
10256          */
10257         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
10258                 UINT32_C(0x10)
10259         /*
10260          * This bit must be '1' for the num_rx_rings field to be
10261          * configured.
10262          */
10263         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
10264                 UINT32_C(0x20)
10265         /*
10266          * This bit must be '1' for the num_l2_ctxs field to be
10267          * configured.
10268          */
10269         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
10270                 UINT32_C(0x40)
10271         /*
10272          * This bit must be '1' for the num_vnics field to be
10273          * configured.
10274          */
10275         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
10276                 UINT32_C(0x80)
10277         /*
10278          * This bit must be '1' for the num_stat_ctxs field to be
10279          * configured.
10280          */
10281         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
10282                 UINT32_C(0x100)
10283         /*
10284          * This bit must be '1' for the dflt_mac_addr field to be
10285          * configured.
10286          */
10287         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
10288                 UINT32_C(0x200)
10289         /*
10290          * This bit must be '1' for the dflt_vlan field to be
10291          * configured.
10292          */
10293         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
10294                 UINT32_C(0x400)
10295         /*
10296          * This bit must be '1' for the dflt_ip_addr field to be
10297          * configured.
10298          */
10299         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
10300                 UINT32_C(0x800)
10301         /*
10302          * This bit must be '1' for the min_bw field to be
10303          * configured.
10304          */
10305         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
10306                 UINT32_C(0x1000)
10307         /*
10308          * This bit must be '1' for the max_bw field to be
10309          * configured.
10310          */
10311         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
10312                 UINT32_C(0x2000)
10313         /*
10314          * This bit must be '1' for the async_event_cr field to be
10315          * configured.
10316          */
10317         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
10318                 UINT32_C(0x4000)
10319         /*
10320          * This bit must be '1' for the vlan_antispoof_mode field to be
10321          * configured.
10322          */
10323         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
10324                 UINT32_C(0x8000)
10325         /*
10326          * This bit must be '1' for the allowed_vlan_pris field to be
10327          * configured.
10328          */
10329         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
10330                 UINT32_C(0x10000)
10331         /*
10332          * This bit must be '1' for the evb_mode field to be
10333          * configured.
10334          */
10335         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
10336                 UINT32_C(0x20000)
10337         /*
10338          * This bit must be '1' for the num_mcast_filters field to be
10339          * configured.
10340          */
10341         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
10342                 UINT32_C(0x40000)
10343         /*
10344          * This bit must be '1' for the num_hw_ring_grps field to be
10345          * configured.
10346          */
10347         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
10348                 UINT32_C(0x80000)
10349         /*
10350          * This bit must be '1' for the cache_linesize field to be
10351          * configured.
10352          */
10353         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
10354                 UINT32_C(0x100000)
10355         /*
10356          * This bit must be '1' for the num_msix field to be
10357          * configured.
10358          */
10359         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
10360                 UINT32_C(0x200000)
10361         /*
10362          * This bit must be '1' for the link admin state field to be
10363          * configured.
10364          */
10365         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \
10366                 UINT32_C(0x400000)
10367         /*
10368          * This bit must be '1' for the hot_reset_if_en_dis field to be
10369          * configured.
10370          */
10371         #define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT \
10372                 UINT32_C(0x800000)
10373         /*
10374          * This bit must be '1' for the schq_id field to be
10375          * configured.
10376          */
10377         #define HWRM_FUNC_CFG_INPUT_ENABLES_SCHQ_ID \
10378                 UINT32_C(0x1000000)
10379         /*
10380          * The maximum transmission unit of the function.
10381          * The HWRM should make sure that the mtu of
10382          * the function does not exceed the mtu of the physical
10383          * port that this function is associated with.
10384          *
10385          * In addition to configuring mtu per function, it is
10386          * possible to configure mtu per transmit ring.
10387          * By default, the mtu of each transmit ring associated
10388          * with a function is equal to the mtu of the function.
10389          * The HWRM should make sure that the mtu of each transmit
10390          * ring that is assigned to a function has a valid mtu.
10391          */
10392         uint16_t        mtu;
10393         /*
10394          * The maximum receive unit of the function.
10395          * The HWRM should make sure that the mru of
10396          * the function does not exceed the mru of the physical
10397          * port that this function is associated with.
10398          *
10399          * In addition to configuring mru per function, it is
10400          * possible to configure mru per vnic.
10401          * By default, the mru of each vnic associated
10402          * with a function is equal to the mru of the function.
10403          * The HWRM should make sure that the mru of each vnic
10404          * that is assigned to a function has a valid mru.
10405          */
10406         uint16_t        mru;
10407         /*
10408          * The number of RSS/COS contexts requested for the
10409          * function.
10410          */
10411         uint16_t        num_rsscos_ctxs;
10412         /*
10413          * The number of completion rings requested for the
10414          * function. This does not include the rings allocated
10415          * to any children functions if any.
10416          */
10417         uint16_t        num_cmpl_rings;
10418         /*
10419          * The number of transmit rings requested for the function.
10420          * This does not include the rings allocated to any
10421          * children functions if any.
10422          */
10423         uint16_t        num_tx_rings;
10424         /*
10425          * The number of receive rings requested for the function.
10426          * This does not include the rings allocated
10427          * to any children functions if any.
10428          */
10429         uint16_t        num_rx_rings;
10430         /* The requested number of L2 contexts for the function. */
10431         uint16_t        num_l2_ctxs;
10432         /* The requested number of vnics for the function. */
10433         uint16_t        num_vnics;
10434         /* The requested number of statistic contexts for the function. */
10435         uint16_t        num_stat_ctxs;
10436         /*
10437          * The number of HW ring groups that should
10438          * be reserved for this function.
10439          */
10440         uint16_t        num_hw_ring_grps;
10441         /* The default MAC address for the function being configured. */
10442         uint8_t dflt_mac_addr[6];
10443         /*
10444          * The default VLAN for the function being configured.
10445          * This field's format is same as 802.1Q Tag's
10446          * Tag Control Information (TCI) format that includes both
10447          * Priority Code Point (PCP) and VLAN Identifier (VID).
10448          */
10449         uint16_t        dflt_vlan;
10450         /*
10451          * The default IP address for the function being configured.
10452          * This address is only used in enabling source property check.
10453          */
10454         uint32_t        dflt_ip_addr[4];
10455         /*
10456          * Minimum BW allocated for this function.
10457          * The HWRM will translate this value into byte counter and
10458          * time interval used for the scheduler inside the device.
10459          */
10460         uint32_t        min_bw;
10461         /* The bandwidth value. */
10462         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
10463                 UINT32_C(0xfffffff)
10464         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
10465         /* The granularity of the value (bits or bytes). */
10466         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
10467                 UINT32_C(0x10000000)
10468         /* Value is in bits. */
10469         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
10470                 (UINT32_C(0x0) << 28)
10471         /* Value is in bytes. */
10472         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
10473                 (UINT32_C(0x1) << 28)
10474         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
10475                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
10476         /* bw_value_unit is 3 b */
10477         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
10478                 UINT32_C(0xe0000000)
10479         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
10480         /* Value is in Mb or MB (base 10). */
10481         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
10482                 (UINT32_C(0x0) << 29)
10483         /* Value is in Kb or KB (base 10). */
10484         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
10485                 (UINT32_C(0x2) << 29)
10486         /* Value is in bits or bytes. */
10487         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
10488                 (UINT32_C(0x4) << 29)
10489         /* Value is in Gb or GB (base 10). */
10490         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
10491                 (UINT32_C(0x6) << 29)
10492         /* Value is in 1/100th of a percentage of total bandwidth. */
10493         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
10494                 (UINT32_C(0x1) << 29)
10495         /* Invalid unit */
10496         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
10497                 (UINT32_C(0x7) << 29)
10498         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
10499                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
10500         /*
10501          * Maximum BW allocated for this function.
10502          * The HWRM will translate this value into byte counter and
10503          * time interval used for the scheduler inside the device.
10504          */
10505         uint32_t        max_bw;
10506         /* The bandwidth value. */
10507         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
10508                 UINT32_C(0xfffffff)
10509         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
10510         /* The granularity of the value (bits or bytes). */
10511         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
10512                 UINT32_C(0x10000000)
10513         /* Value is in bits. */
10514         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
10515                 (UINT32_C(0x0) << 28)
10516         /* Value is in bytes. */
10517         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
10518                 (UINT32_C(0x1) << 28)
10519         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
10520                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
10521         /* bw_value_unit is 3 b */
10522         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
10523                 UINT32_C(0xe0000000)
10524         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
10525         /* Value is in Mb or MB (base 10). */
10526         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
10527                 (UINT32_C(0x0) << 29)
10528         /* Value is in Kb or KB (base 10). */
10529         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
10530                 (UINT32_C(0x2) << 29)
10531         /* Value is in bits or bytes. */
10532         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
10533                 (UINT32_C(0x4) << 29)
10534         /* Value is in Gb or GB (base 10). */
10535         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
10536                 (UINT32_C(0x6) << 29)
10537         /* Value is in 1/100th of a percentage of total bandwidth. */
10538         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
10539                 (UINT32_C(0x1) << 29)
10540         /* Invalid unit */
10541         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
10542                 (UINT32_C(0x7) << 29)
10543         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
10544                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
10545         /*
10546          * ID of the target completion ring for receiving asynchronous
10547          * event completions. If this field is not valid, then the
10548          * HWRM shall use the default completion ring of the function
10549          * that is being configured as the target completion ring for
10550          * providing any asynchronous event completions for that
10551          * function.
10552          * If this field is valid, then the HWRM shall use the
10553          * completion ring identified by this ID as the target
10554          * completion ring for providing any asynchronous event
10555          * completions for the function that is being configured.
10556          */
10557         uint16_t        async_event_cr;
10558         /* VLAN Anti-spoofing mode. */
10559         uint8_t vlan_antispoof_mode;
10560         /* No VLAN anti-spoofing checks are enabled */
10561         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
10562                 UINT32_C(0x0)
10563         /* Validate VLAN against the configured VLAN(s) */
10564         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
10565                 UINT32_C(0x1)
10566         /* Insert VLAN if it does not exist, otherwise discard */
10567         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
10568                 UINT32_C(0x2)
10569         /* Insert VLAN if it does not exist, override VLAN if it exists */
10570         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
10571                 UINT32_C(0x3)
10572         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
10573                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
10574         /*
10575          * This bit field defines VLAN PRIs that are allowed on
10576          * this function.
10577          * If nth bit is set, then VLAN PRI n is allowed on this
10578          * function.
10579          */
10580         uint8_t allowed_vlan_pris;
10581         /*
10582          * The HWRM shall allow a PF driver to change EVB mode for the
10583          * partition it belongs to.
10584          * The HWRM shall not allow a VF driver to change the EVB mode.
10585          * The HWRM shall take into account the switching of EVB mode
10586          * from one to another and reconfigure hardware resources as
10587          * appropriately.
10588          * The switching from VEB to VEPA mode requires
10589          * the disabling of the loopback traffic. Additionally,
10590          * source knock outs are handled differently in VEB and VEPA
10591          * modes.
10592          */
10593         uint8_t evb_mode;
10594         /* No Edge Virtual Bridging (EVB) */
10595         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
10596         /* Virtual Ethernet Bridge (VEB) */
10597         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
10598         /* Virtual Ethernet Port Aggregator (VEPA) */
10599         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
10600         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
10601                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
10602         uint8_t options;
10603         /*
10604          * This value indicates the PCIE device cache line size.
10605          * The cache line size allows the DMA writes to terminate and
10606          * start at the cache boundary.
10607          */
10608         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
10609                 UINT32_C(0x3)
10610         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT          0
10611         /* Cache Line Size 64 bytes */
10612         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
10613                 UINT32_C(0x0)
10614         /* Cache Line Size 128 bytes */
10615         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
10616                 UINT32_C(0x1)
10617         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
10618                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
10619         /* This value is the virtual link admin state setting. */
10620         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
10621                 UINT32_C(0xc)
10622         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
10623         /* Admin state is forced down. */
10624         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
10625                 (UINT32_C(0x0) << 2)
10626         /* Admin state is forced up. */
10627         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
10628                 (UINT32_C(0x1) << 2)
10629         /* Admin state is in auto mode - is to follow the physical link state. */
10630         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
10631                 (UINT32_C(0x2) << 2)
10632         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
10633                 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
10634         /* Reserved for future. */
10635         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
10636                 UINT32_C(0xf0)
10637         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT                    4
10638         /*
10639          * The number of multicast filters that should
10640          * be reserved for this function on the RX side.
10641          */
10642         uint16_t        num_mcast_filters;
10643         /* Used by a PF driver to associate a SCHQ with a VF. */
10644         uint16_t        schq_id;
10645         uint8_t unused_0[6];
10646 } __rte_packed;
10647
10648 /* hwrm_func_cfg_output (size:128b/16B) */
10649 struct hwrm_func_cfg_output {
10650         /* The specific error status for the command. */
10651         uint16_t        error_code;
10652         /* The HWRM command request type. */
10653         uint16_t        req_type;
10654         /* The sequence ID from the original command. */
10655         uint16_t        seq_id;
10656         /* The length of the response data in number of bytes. */
10657         uint16_t        resp_len;
10658         uint8_t unused_0[7];
10659         /*
10660          * This field is used in Output records to indicate that the output
10661          * is completely written to RAM.  This field should be read as '1'
10662          * to indicate that the output has been completely written.
10663          * When writing a command completion or response to an internal processor,
10664          * the order of writes has to be such that this field is written last.
10665          */
10666         uint8_t valid;
10667 } __rte_packed;
10668
10669 /********************
10670  * hwrm_func_qstats *
10671  ********************/
10672
10673
10674 /* hwrm_func_qstats_input (size:192b/24B) */
10675 struct hwrm_func_qstats_input {
10676         /* The HWRM command request type. */
10677         uint16_t        req_type;
10678         /*
10679          * The completion ring to send the completion event on. This should
10680          * be the NQ ID returned from the `nq_alloc` HWRM command.
10681          */
10682         uint16_t        cmpl_ring;
10683         /*
10684          * The sequence ID is used by the driver for tracking multiple
10685          * commands. This ID is treated as opaque data by the firmware and
10686          * the value is returned in the `hwrm_resp_hdr` upon completion.
10687          */
10688         uint16_t        seq_id;
10689         /*
10690          * The target ID of the command:
10691          * * 0x0-0xFFF8 - The function ID
10692          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10693          * * 0xFFFD - Reserved for user-space HWRM interface
10694          * * 0xFFFF - HWRM
10695          */
10696         uint16_t        target_id;
10697         /*
10698          * A physical address pointer pointing to a host buffer that the
10699          * command's response data will be written. This can be either a host
10700          * physical address (HPA) or a guest physical address (GPA) and must
10701          * point to a physically contiguous block of memory.
10702          */
10703         uint64_t        resp_addr;
10704         /*
10705          * Function ID of the function that is being queried.
10706          * 0xFF... (All Fs) if the query is for the requesting
10707          * function.
10708          * A privileged PF can query for other function's statistics.
10709          */
10710         uint16_t        fid;
10711         /* This flags indicates the type of statistics request. */
10712         uint8_t flags;
10713         /* This value is not used to avoid backward compatibility issues. */
10714         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
10715         /*
10716          * flags should be set to 1 when request is for only RoCE statistics.
10717          * This will be honored only if the caller_fid is a privileged PF.
10718          * In all other cases FID and caller_fid should be the same.
10719          */
10720         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY    UINT32_C(0x1)
10721         /*
10722          * flags should be set to 2 when request is for the counter mask,
10723          * representing the width of each of the stats counters, rather
10724          * than counters themselves.
10725          */
10726         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
10727         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_LAST \
10728                 HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK
10729         uint8_t unused_0[5];
10730 } __rte_packed;
10731
10732 /* hwrm_func_qstats_output (size:1408b/176B) */
10733 struct hwrm_func_qstats_output {
10734         /* The specific error status for the command. */
10735         uint16_t        error_code;
10736         /* The HWRM command request type. */
10737         uint16_t        req_type;
10738         /* The sequence ID from the original command. */
10739         uint16_t        seq_id;
10740         /* The length of the response data in number of bytes. */
10741         uint16_t        resp_len;
10742         /* Number of transmitted unicast packets on the function. */
10743         uint64_t        tx_ucast_pkts;
10744         /* Number of transmitted multicast packets on the function. */
10745         uint64_t        tx_mcast_pkts;
10746         /* Number of transmitted broadcast packets on the function. */
10747         uint64_t        tx_bcast_pkts;
10748         /*
10749          * Number of transmitted packets that were discarded due to
10750          * internal NIC resource problems.  For transmit, this
10751          * can only happen if TMP is configured to allow dropping
10752          * in HOL blocking conditions, which is not a normal
10753          * configuration.
10754          */
10755         uint64_t        tx_discard_pkts;
10756         /*
10757          * Number of dropped packets on transmit path on the function.
10758          * These are packets that have been marked for drop by
10759          * the TE CFA block or are packets that exceeded the
10760          * transmit MTU limit for the function.
10761          */
10762         uint64_t        tx_drop_pkts;
10763         /* Number of transmitted bytes for unicast traffic on the function. */
10764         uint64_t        tx_ucast_bytes;
10765         /* Number of transmitted bytes for multicast traffic on the function. */
10766         uint64_t        tx_mcast_bytes;
10767         /* Number of transmitted bytes for broadcast traffic on the function. */
10768         uint64_t        tx_bcast_bytes;
10769         /* Number of received unicast packets on the function. */
10770         uint64_t        rx_ucast_pkts;
10771         /* Number of received multicast packets on the function. */
10772         uint64_t        rx_mcast_pkts;
10773         /* Number of received broadcast packets on the function. */
10774         uint64_t        rx_bcast_pkts;
10775         /*
10776          * Number of received packets that were discarded on the function
10777          * due to resource limitations.  This can happen for 3 reasons.
10778          * # The BD used for the packet has a bad format.
10779          * # There were no BDs available in the ring for the packet.
10780          * # There were no BDs available on-chip for the packet.
10781          */
10782         uint64_t        rx_discard_pkts;
10783         /*
10784          * Number of dropped packets on received path on the function.
10785          * These are packets that have been marked for drop by the
10786          * RE CFA.
10787          */
10788         uint64_t        rx_drop_pkts;
10789         /* Number of received bytes for unicast traffic on the function. */
10790         uint64_t        rx_ucast_bytes;
10791         /* Number of received bytes for multicast traffic on the function. */
10792         uint64_t        rx_mcast_bytes;
10793         /* Number of received bytes for broadcast traffic on the function. */
10794         uint64_t        rx_bcast_bytes;
10795         /* Number of aggregated unicast packets on the function. */
10796         uint64_t        rx_agg_pkts;
10797         /* Number of aggregated unicast bytes on the function. */
10798         uint64_t        rx_agg_bytes;
10799         /* Number of aggregation events on the function. */
10800         uint64_t        rx_agg_events;
10801         /* Number of aborted aggregations on the function. */
10802         uint64_t        rx_agg_aborts;
10803         uint8_t unused_0[7];
10804         /*
10805          * This field is used in Output records to indicate that the output
10806          * is completely written to RAM.  This field should be read as '1'
10807          * to indicate that the output has been completely written.
10808          * When writing a command completion or response to an internal processor,
10809          * the order of writes has to be such that this field is written last.
10810          */
10811         uint8_t valid;
10812 } __rte_packed;
10813
10814 /************************
10815  * hwrm_func_qstats_ext *
10816  ************************/
10817
10818
10819 /* hwrm_func_qstats_ext_input (size:256b/32B) */
10820 struct hwrm_func_qstats_ext_input {
10821         /* The HWRM command request type. */
10822         uint16_t        req_type;
10823         /*
10824          * The completion ring to send the completion event on. This should
10825          * be the NQ ID returned from the `nq_alloc` HWRM command.
10826          */
10827         uint16_t        cmpl_ring;
10828         /*
10829          * The sequence ID is used by the driver for tracking multiple
10830          * commands. This ID is treated as opaque data by the firmware and
10831          * the value is returned in the `hwrm_resp_hdr` upon completion.
10832          */
10833         uint16_t        seq_id;
10834         /*
10835          * The target ID of the command:
10836          * * 0x0-0xFFF8 - The function ID
10837          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10838          * * 0xFFFD - Reserved for user-space HWRM interface
10839          * * 0xFFFF - HWRM
10840          */
10841         uint16_t        target_id;
10842         /*
10843          * A physical address pointer pointing to a host buffer that the
10844          * command's response data will be written. This can be either a host
10845          * physical address (HPA) or a guest physical address (GPA) and must
10846          * point to a physically contiguous block of memory.
10847          */
10848         uint64_t        resp_addr;
10849         /*
10850          * Function ID of the function that is being queried.
10851          * 0xFF... (All Fs) if the query is for the requesting
10852          * function.
10853          * A privileged PF can query for other function's statistics.
10854          */
10855         uint16_t        fid;
10856         /* This flags indicates the type of statistics request. */
10857         uint8_t flags;
10858         /* This value is not used to avoid backward compatibility issues. */
10859         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
10860         /*
10861          * flags should be set to 1 when request is for only RoCE statistics.
10862          * This will be honored only if the caller_fid is a privileged PF.
10863          * In all other cases FID and caller_fid should be the same.
10864          */
10865         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY    UINT32_C(0x1)
10866         /*
10867          * flags should be set to 2 when request is for the counter mask
10868          * representing the width of each of the stats counters, rather
10869          * than counters themselves.
10870          */
10871         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
10872         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_LAST \
10873                 HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
10874         uint8_t unused_0[1];
10875         uint32_t        enables;
10876         /*
10877          * This bit must be '1' for the schq_id and traffic_class fields to
10878          * be configured.
10879          */
10880         #define HWRM_FUNC_QSTATS_EXT_INPUT_ENABLES_SCHQ_ID     UINT32_C(0x1)
10881         /* Specifies the SCHQ for which to gather statistics */
10882         uint16_t        schq_id;
10883         /*
10884          * Specifies the traffic class for which to gather statistics. Valid
10885          * values are 0 through (max_configurable_queues - 1), where
10886          * max_configurable_queues is in the response of HWRM_QUEUE_QPORTCFG
10887          */
10888         uint16_t        traffic_class;
10889         uint8_t unused_1[4];
10890 } __rte_packed;
10891
10892 /* hwrm_func_qstats_ext_output (size:1472b/184B) */
10893 struct hwrm_func_qstats_ext_output {
10894         /* The specific error status for the command. */
10895         uint16_t        error_code;
10896         /* The HWRM command request type. */
10897         uint16_t        req_type;
10898         /* The sequence ID from the original command. */
10899         uint16_t        seq_id;
10900         /* The length of the response data in number of bytes. */
10901         uint16_t        resp_len;
10902         /* Number of received unicast packets */
10903         uint64_t        rx_ucast_pkts;
10904         /* Number of received multicast packets */
10905         uint64_t        rx_mcast_pkts;
10906         /* Number of received broadcast packets */
10907         uint64_t        rx_bcast_pkts;
10908         /* Number of discarded packets on received path */
10909         uint64_t        rx_discard_pkts;
10910         /* Number of packets on receive path with error */
10911         uint64_t        rx_error_pkts;
10912         /* Number of received bytes for unicast traffic */
10913         uint64_t        rx_ucast_bytes;
10914         /* Number of received bytes for multicast traffic */
10915         uint64_t        rx_mcast_bytes;
10916         /* Number of received bytes for broadcast traffic */
10917         uint64_t        rx_bcast_bytes;
10918         /* Number of transmitted unicast packets */
10919         uint64_t        tx_ucast_pkts;
10920         /* Number of transmitted multicast packets */
10921         uint64_t        tx_mcast_pkts;
10922         /* Number of transmitted broadcast packets */
10923         uint64_t        tx_bcast_pkts;
10924         /* Number of packets on transmit path with error */
10925         uint64_t        tx_error_pkts;
10926         /* Number of discarded packets on transmit path */
10927         uint64_t        tx_discard_pkts;
10928         /* Number of transmitted bytes for unicast traffic */
10929         uint64_t        tx_ucast_bytes;
10930         /* Number of transmitted bytes for multicast traffic */
10931         uint64_t        tx_mcast_bytes;
10932         /* Number of transmitted bytes for broadcast traffic */
10933         uint64_t        tx_bcast_bytes;
10934         /* Number of TPA eligible packets */
10935         uint64_t        rx_tpa_eligible_pkt;
10936         /* Number of TPA eligible bytes */
10937         uint64_t        rx_tpa_eligible_bytes;
10938         /* Number of TPA packets */
10939         uint64_t        rx_tpa_pkt;
10940         /* Number of TPA bytes */
10941         uint64_t        rx_tpa_bytes;
10942         /* Number of TPA errors */
10943         uint64_t        rx_tpa_errors;
10944         uint8_t unused_0[7];
10945         /*
10946          * This field is used in Output records to indicate that the output
10947          * is completely written to RAM.  This field should be read as '1'
10948          * to indicate that the output has been completely written.
10949          * When writing a command completion or response to an internal processor,
10950          * the order of writes has to be such that this field is written last.
10951          */
10952         uint8_t valid;
10953 } __rte_packed;
10954
10955 /***********************
10956  * hwrm_func_clr_stats *
10957  ***********************/
10958
10959
10960 /* hwrm_func_clr_stats_input (size:192b/24B) */
10961 struct hwrm_func_clr_stats_input {
10962         /* The HWRM command request type. */
10963         uint16_t        req_type;
10964         /*
10965          * The completion ring to send the completion event on. This should
10966          * be the NQ ID returned from the `nq_alloc` HWRM command.
10967          */
10968         uint16_t        cmpl_ring;
10969         /*
10970          * The sequence ID is used by the driver for tracking multiple
10971          * commands. This ID is treated as opaque data by the firmware and
10972          * the value is returned in the `hwrm_resp_hdr` upon completion.
10973          */
10974         uint16_t        seq_id;
10975         /*
10976          * The target ID of the command:
10977          * * 0x0-0xFFF8 - The function ID
10978          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10979          * * 0xFFFD - Reserved for user-space HWRM interface
10980          * * 0xFFFF - HWRM
10981          */
10982         uint16_t        target_id;
10983         /*
10984          * A physical address pointer pointing to a host buffer that the
10985          * command's response data will be written. This can be either a host
10986          * physical address (HPA) or a guest physical address (GPA) and must
10987          * point to a physically contiguous block of memory.
10988          */
10989         uint64_t        resp_addr;
10990         /*
10991          * Function ID of the function.
10992          * 0xFF... (All Fs) if the query is for the requesting
10993          * function.
10994          */
10995         uint16_t        fid;
10996         uint8_t unused_0[6];
10997 } __rte_packed;
10998
10999 /* hwrm_func_clr_stats_output (size:128b/16B) */
11000 struct hwrm_func_clr_stats_output {
11001         /* The specific error status for the command. */
11002         uint16_t        error_code;
11003         /* The HWRM command request type. */
11004         uint16_t        req_type;
11005         /* The sequence ID from the original command. */
11006         uint16_t        seq_id;
11007         /* The length of the response data in number of bytes. */
11008         uint16_t        resp_len;
11009         uint8_t unused_0[7];
11010         /*
11011          * This field is used in Output records to indicate that the output
11012          * is completely written to RAM.  This field should be read as '1'
11013          * to indicate that the output has been completely written.
11014          * When writing a command completion or response to an internal processor,
11015          * the order of writes has to be such that this field is written last.
11016          */
11017         uint8_t valid;
11018 } __rte_packed;
11019
11020 /**************************
11021  * hwrm_func_vf_resc_free *
11022  **************************/
11023
11024
11025 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
11026 struct hwrm_func_vf_resc_free_input {
11027         /* The HWRM command request type. */
11028         uint16_t        req_type;
11029         /*
11030          * The completion ring to send the completion event on. This should
11031          * be the NQ ID returned from the `nq_alloc` HWRM command.
11032          */
11033         uint16_t        cmpl_ring;
11034         /*
11035          * The sequence ID is used by the driver for tracking multiple
11036          * commands. This ID is treated as opaque data by the firmware and
11037          * the value is returned in the `hwrm_resp_hdr` upon completion.
11038          */
11039         uint16_t        seq_id;
11040         /*
11041          * The target ID of the command:
11042          * * 0x0-0xFFF8 - The function ID
11043          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11044          * * 0xFFFD - Reserved for user-space HWRM interface
11045          * * 0xFFFF - HWRM
11046          */
11047         uint16_t        target_id;
11048         /*
11049          * A physical address pointer pointing to a host buffer that the
11050          * command's response data will be written. This can be either a host
11051          * physical address (HPA) or a guest physical address (GPA) and must
11052          * point to a physically contiguous block of memory.
11053          */
11054         uint64_t        resp_addr;
11055         /*
11056          * This value is used to identify a Virtual Function (VF).
11057          * The scope of VF ID is local within a PF.
11058          */
11059         uint16_t        vf_id;
11060         uint8_t unused_0[6];
11061 } __rte_packed;
11062
11063 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
11064 struct hwrm_func_vf_resc_free_output {
11065         /* The specific error status for the command. */
11066         uint16_t        error_code;
11067         /* The HWRM command request type. */
11068         uint16_t        req_type;
11069         /* The sequence ID from the original command. */
11070         uint16_t        seq_id;
11071         /* The length of the response data in number of bytes. */
11072         uint16_t        resp_len;
11073         uint8_t unused_0[7];
11074         /*
11075          * This field is used in Output records to indicate that the output
11076          * is completely written to RAM.  This field should be read as '1'
11077          * to indicate that the output has been completely written.
11078          * When writing a command completion or response to an internal processor,
11079          * the order of writes has to be such that this field is written last.
11080          */
11081         uint8_t valid;
11082 } __rte_packed;
11083
11084 /**********************
11085  * hwrm_func_drv_rgtr *
11086  **********************/
11087
11088
11089 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
11090 struct hwrm_func_drv_rgtr_input {
11091         /* The HWRM command request type. */
11092         uint16_t        req_type;
11093         /*
11094          * The completion ring to send the completion event on. This should
11095          * be the NQ ID returned from the `nq_alloc` HWRM command.
11096          */
11097         uint16_t        cmpl_ring;
11098         /*
11099          * The sequence ID is used by the driver for tracking multiple
11100          * commands. This ID is treated as opaque data by the firmware and
11101          * the value is returned in the `hwrm_resp_hdr` upon completion.
11102          */
11103         uint16_t        seq_id;
11104         /*
11105          * The target ID of the command:
11106          * * 0x0-0xFFF8 - The function ID
11107          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11108          * * 0xFFFD - Reserved for user-space HWRM interface
11109          * * 0xFFFF - HWRM
11110          */
11111         uint16_t        target_id;
11112         /*
11113          * A physical address pointer pointing to a host buffer that the
11114          * command's response data will be written. This can be either a host
11115          * physical address (HPA) or a guest physical address (GPA) and must
11116          * point to a physically contiguous block of memory.
11117          */
11118         uint64_t        resp_addr;
11119         uint32_t        flags;
11120         /*
11121          * When this bit is '1', the function driver is requesting
11122          * all requests from its children VF drivers to be
11123          * forwarded to itself.
11124          * This flag can only be set by the PF driver.
11125          * If a VF driver sets this flag, it should be ignored
11126          * by the HWRM.
11127          */
11128         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \
11129                 UINT32_C(0x1)
11130         /*
11131          * When this bit is '1', the function is requesting none of
11132          * the requests from its children VF drivers to be
11133          * forwarded to itself.
11134          * This flag can only be set by the PF driver.
11135          * If a VF driver sets this flag, it should be ignored
11136          * by the HWRM.
11137          */
11138         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \
11139                 UINT32_C(0x2)
11140         /*
11141          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
11142          * fields shall be ignored and ver_maj, ver_min, ver_upd
11143          * and ver_patch shall be used for the driver version information.
11144          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
11145          * fields shall be used for the driver version information and
11146          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
11147          */
11148         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \
11149                 UINT32_C(0x4)
11150         /*
11151          * When this bit is '1', the function is indicating support of
11152          * 64bit flow handle.  The firmware that only supports 64bit flow
11153          * handle should check this bit before allowing processing of
11154          * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
11155          * with 64bit flow handle support can only be compatible with drivers
11156          * that support 64bit flow handle. The legacy drivers that don't support
11157          * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
11158          * running with new firmware that only supports 64bit flow handle. The new
11159          * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
11160          * status to the legacy driver when encounters these commands.
11161          */
11162         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \
11163                 UINT32_C(0x8)
11164         /*
11165          * When this bit is '1', the function is indicating support of
11166          * Hot Reset. The driver interface will destroy the resources,
11167          * unregister the function and register again up on receiving
11168          * the RESET_NOTIFY Async notification from the core firmware.
11169          * The core firmware will this use flag and trigger the Hot Reset
11170          * process only if all the registered driver instances are capable
11171          * of this support.
11172          */
11173         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT \
11174                 UINT32_C(0x10)
11175         /*
11176          * When this bit is 1, the function is indicating the support of the
11177          * error recovery capability. Error recovery support will be used by
11178          * firmware only if all the driver instances support error recovery
11179          * process. By setting this bit, driver is indicating support for
11180          * corresponding async event completion message. These will be
11181          * delivered to the driver even if they did not register for it.
11182          * If supported, after receiving reset notify async event with fatal
11183          * flag set in event data1, then all the drivers have to tear down
11184          * their resources without sending any HWRM commands to FW.
11185          */
11186         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT \
11187                 UINT32_C(0x20)
11188         /*
11189          * When this bit is 1, the function is indicating the support of the
11190          * Master capability. The Firmware will use this capability to select the
11191          * Master function. The master function will be used to initiate
11192          * designated functionality like error recovery etc… If none of the
11193          * registered PF’s or trusted VF’s indicate this support, then
11194          * firmware will select the 1st registered PF as Master capable instance.
11195          */
11196         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT \
11197                 UINT32_C(0x40)
11198         uint32_t        enables;
11199         /*
11200          * This bit must be '1' for the os_type field to be
11201          * configured.
11202          */
11203         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
11204                 UINT32_C(0x1)
11205         /*
11206          * This bit must be '1' for the ver field to be
11207          * configured.
11208          */
11209         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
11210                 UINT32_C(0x2)
11211         /*
11212          * This bit must be '1' for the timestamp field to be
11213          * configured.
11214          */
11215         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
11216                 UINT32_C(0x4)
11217         /*
11218          * This bit must be '1' for the vf_req_fwd field to be
11219          * configured.
11220          */
11221         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
11222                 UINT32_C(0x8)
11223         /*
11224          * This bit must be '1' for the async_event_fwd field to be
11225          * configured.
11226          */
11227         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
11228                 UINT32_C(0x10)
11229         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
11230         uint16_t        os_type;
11231         /* Unknown */
11232         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
11233         /* Other OS not listed below. */
11234         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
11235         /* MSDOS OS. */
11236         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
11237         /* Windows OS. */
11238         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
11239         /* Solaris OS. */
11240         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
11241         /* Linux OS. */
11242         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
11243         /* FreeBSD OS. */
11244         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
11245         /* VMware ESXi OS. */
11246         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
11247         /* Microsoft Windows 8 64-bit OS. */
11248         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
11249         /* Microsoft Windows Server 2012 R2 OS. */
11250         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
11251         /* UEFI driver. */
11252         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
11253         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
11254                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
11255         /* This is the 8bit major version of the driver. */
11256         uint8_t ver_maj_8b;
11257         /* This is the 8bit minor version of the driver. */
11258         uint8_t ver_min_8b;
11259         /* This is the 8bit update version of the driver. */
11260         uint8_t ver_upd_8b;
11261         uint8_t unused_0[3];
11262         /*
11263          * This is a 32-bit timestamp provided by the driver for
11264          * keep alive.
11265          * The timestamp is in multiples of 1ms.
11266          */
11267         uint32_t        timestamp;
11268         uint8_t unused_1[4];
11269         /*
11270          * This is a 256-bit bit mask provided by the PF driver for
11271          * letting the HWRM know what commands issued by the VF driver
11272          * to the HWRM should be forwarded to the PF driver.
11273          * Nth bit refers to the Nth req_type.
11274          *
11275          * Setting Nth bit to 1 indicates that requests from the
11276          * VF driver with req_type equal to N shall be forwarded to
11277          * the parent PF driver.
11278          *
11279          * This field is not valid for the VF driver.
11280          */
11281         uint32_t        vf_req_fwd[8];
11282         /*
11283          * This is a 256-bit bit mask provided by the function driver
11284          * (PF or VF driver) to indicate the list of asynchronous event
11285          * completions to be forwarded.
11286          *
11287          * Nth bit refers to the Nth event_id.
11288          *
11289          * Setting Nth bit to 1 by the function driver shall result in
11290          * the HWRM forwarding asynchronous event completion with
11291          * event_id equal to N.
11292          *
11293          * If all bits are set to 0 (value of 0), then the HWRM shall
11294          * not forward any asynchronous event completion to this
11295          * function driver.
11296          */
11297         uint32_t        async_event_fwd[8];
11298         /* This is the 16bit major version of the driver. */
11299         uint16_t        ver_maj;
11300         /* This is the 16bit minor version of the driver. */
11301         uint16_t        ver_min;
11302         /* This is the 16bit update version of the driver. */
11303         uint16_t        ver_upd;
11304         /* This is the 16bit patch version of the driver. */
11305         uint16_t        ver_patch;
11306 } __rte_packed;
11307
11308 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
11309 struct hwrm_func_drv_rgtr_output {
11310         /* The specific error status for the command. */
11311         uint16_t        error_code;
11312         /* The HWRM command request type. */
11313         uint16_t        req_type;
11314         /* The sequence ID from the original command. */
11315         uint16_t        seq_id;
11316         /* The length of the response data in number of bytes. */
11317         uint16_t        resp_len;
11318         uint32_t        flags;
11319         /*
11320          * When this bit is '1', it indicates that the
11321          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
11322          */
11323         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
11324                 UINT32_C(0x1)
11325         uint8_t unused_0[3];
11326         /*
11327          * This field is used in Output records to indicate that the output
11328          * is completely written to RAM.  This field should be read as '1'
11329          * to indicate that the output has been completely written.
11330          * When writing a command completion or response to an internal processor,
11331          * the order of writes has to be such that this field is written last.
11332          */
11333         uint8_t valid;
11334 } __rte_packed;
11335
11336 /************************
11337  * hwrm_func_drv_unrgtr *
11338  ************************/
11339
11340
11341 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
11342 struct hwrm_func_drv_unrgtr_input {
11343         /* The HWRM command request type. */
11344         uint16_t        req_type;
11345         /*
11346          * The completion ring to send the completion event on. This should
11347          * be the NQ ID returned from the `nq_alloc` HWRM command.
11348          */
11349         uint16_t        cmpl_ring;
11350         /*
11351          * The sequence ID is used by the driver for tracking multiple
11352          * commands. This ID is treated as opaque data by the firmware and
11353          * the value is returned in the `hwrm_resp_hdr` upon completion.
11354          */
11355         uint16_t        seq_id;
11356         /*
11357          * The target ID of the command:
11358          * * 0x0-0xFFF8 - The function ID
11359          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11360          * * 0xFFFD - Reserved for user-space HWRM interface
11361          * * 0xFFFF - HWRM
11362          */
11363         uint16_t        target_id;
11364         /*
11365          * A physical address pointer pointing to a host buffer that the
11366          * command's response data will be written. This can be either a host
11367          * physical address (HPA) or a guest physical address (GPA) and must
11368          * point to a physically contiguous block of memory.
11369          */
11370         uint64_t        resp_addr;
11371         uint32_t        flags;
11372         /*
11373          * When this bit is '1', the function driver is notifying
11374          * the HWRM to prepare for the shutdown.
11375          */
11376         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
11377                 UINT32_C(0x1)
11378         uint8_t unused_0[4];
11379 } __rte_packed;
11380
11381 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
11382 struct hwrm_func_drv_unrgtr_output {
11383         /* The specific error status for the command. */
11384         uint16_t        error_code;
11385         /* The HWRM command request type. */
11386         uint16_t        req_type;
11387         /* The sequence ID from the original command. */
11388         uint16_t        seq_id;
11389         /* The length of the response data in number of bytes. */
11390         uint16_t        resp_len;
11391         uint8_t unused_0[7];
11392         /*
11393          * This field is used in Output records to indicate that the output
11394          * is completely written to RAM.  This field should be read as '1'
11395          * to indicate that the output has been completely written.
11396          * When writing a command completion or response to an internal processor,
11397          * the order of writes has to be such that this field is written last.
11398          */
11399         uint8_t valid;
11400 } __rte_packed;
11401
11402 /**********************
11403  * hwrm_func_buf_rgtr *
11404  **********************/
11405
11406
11407 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
11408 struct hwrm_func_buf_rgtr_input {
11409         /* The HWRM command request type. */
11410         uint16_t        req_type;
11411         /*
11412          * The completion ring to send the completion event on. This should
11413          * be the NQ ID returned from the `nq_alloc` HWRM command.
11414          */
11415         uint16_t        cmpl_ring;
11416         /*
11417          * The sequence ID is used by the driver for tracking multiple
11418          * commands. This ID is treated as opaque data by the firmware and
11419          * the value is returned in the `hwrm_resp_hdr` upon completion.
11420          */
11421         uint16_t        seq_id;
11422         /*
11423          * The target ID of the command:
11424          * * 0x0-0xFFF8 - The function ID
11425          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11426          * * 0xFFFD - Reserved for user-space HWRM interface
11427          * * 0xFFFF - HWRM
11428          */
11429         uint16_t        target_id;
11430         /*
11431          * A physical address pointer pointing to a host buffer that the
11432          * command's response data will be written. This can be either a host
11433          * physical address (HPA) or a guest physical address (GPA) and must
11434          * point to a physically contiguous block of memory.
11435          */
11436         uint64_t        resp_addr;
11437         uint32_t        enables;
11438         /*
11439          * This bit must be '1' for the vf_id field to be
11440          * configured.
11441          */
11442         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
11443         /*
11444          * This bit must be '1' for the err_buf_addr field to be
11445          * configured.
11446          */
11447         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
11448         /*
11449          * This value is used to identify a Virtual Function (VF).
11450          * The scope of VF ID is local within a PF.
11451          */
11452         uint16_t        vf_id;
11453         /*
11454          * This field represents the number of pages used for request
11455          * buffer(s).
11456          */
11457         uint16_t        req_buf_num_pages;
11458         /*
11459          * This field represents the page size used for request
11460          * buffer(s).
11461          */
11462         uint16_t        req_buf_page_size;
11463         /* 16 bytes */
11464         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
11465         /* 4 Kbytes */
11466         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
11467         /* 8 Kbytes */
11468         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
11469         /* 64 Kbytes */
11470         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
11471         /* 2 Mbytes */
11472         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
11473         /* 4 Mbytes */
11474         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
11475         /* 1 Gbytes */
11476         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
11477         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
11478                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
11479         /* The length of the request buffer per VF in bytes. */
11480         uint16_t        req_buf_len;
11481         /* The length of the response buffer in bytes. */
11482         uint16_t        resp_buf_len;
11483         uint8_t unused_0[2];
11484         /* This field represents the page address of page #0. */
11485         uint64_t        req_buf_page_addr0;
11486         /* This field represents the page address of page #1. */
11487         uint64_t        req_buf_page_addr1;
11488         /* This field represents the page address of page #2. */
11489         uint64_t        req_buf_page_addr2;
11490         /* This field represents the page address of page #3. */
11491         uint64_t        req_buf_page_addr3;
11492         /* This field represents the page address of page #4. */
11493         uint64_t        req_buf_page_addr4;
11494         /* This field represents the page address of page #5. */
11495         uint64_t        req_buf_page_addr5;
11496         /* This field represents the page address of page #6. */
11497         uint64_t        req_buf_page_addr6;
11498         /* This field represents the page address of page #7. */
11499         uint64_t        req_buf_page_addr7;
11500         /* This field represents the page address of page #8. */
11501         uint64_t        req_buf_page_addr8;
11502         /* This field represents the page address of page #9. */
11503         uint64_t        req_buf_page_addr9;
11504         /*
11505          * This field is used to receive the error reporting from
11506          * the chipset. Only applicable for PFs.
11507          */
11508         uint64_t        error_buf_addr;
11509         /*
11510          * This field is used to receive the response forwarded by the
11511          * HWRM.
11512          */
11513         uint64_t        resp_buf_addr;
11514 } __rte_packed;
11515
11516 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
11517 struct hwrm_func_buf_rgtr_output {
11518         /* The specific error status for the command. */
11519         uint16_t        error_code;
11520         /* The HWRM command request type. */
11521         uint16_t        req_type;
11522         /* The sequence ID from the original command. */
11523         uint16_t        seq_id;
11524         /* The length of the response data in number of bytes. */
11525         uint16_t        resp_len;
11526         uint8_t unused_0[7];
11527         /*
11528          * This field is used in Output records to indicate that the output
11529          * is completely written to RAM.  This field should be read as '1'
11530          * to indicate that the output has been completely written.
11531          * When writing a command completion or response to an internal processor,
11532          * the order of writes has to be such that this field is written last.
11533          */
11534         uint8_t valid;
11535 } __rte_packed;
11536
11537 /************************
11538  * hwrm_func_buf_unrgtr *
11539  ************************/
11540
11541
11542 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
11543 struct hwrm_func_buf_unrgtr_input {
11544         /* The HWRM command request type. */
11545         uint16_t        req_type;
11546         /*
11547          * The completion ring to send the completion event on. This should
11548          * be the NQ ID returned from the `nq_alloc` HWRM command.
11549          */
11550         uint16_t        cmpl_ring;
11551         /*
11552          * The sequence ID is used by the driver for tracking multiple
11553          * commands. This ID is treated as opaque data by the firmware and
11554          * the value is returned in the `hwrm_resp_hdr` upon completion.
11555          */
11556         uint16_t        seq_id;
11557         /*
11558          * The target ID of the command:
11559          * * 0x0-0xFFF8 - The function ID
11560          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11561          * * 0xFFFD - Reserved for user-space HWRM interface
11562          * * 0xFFFF - HWRM
11563          */
11564         uint16_t        target_id;
11565         /*
11566          * A physical address pointer pointing to a host buffer that the
11567          * command's response data will be written. This can be either a host
11568          * physical address (HPA) or a guest physical address (GPA) and must
11569          * point to a physically contiguous block of memory.
11570          */
11571         uint64_t        resp_addr;
11572         uint32_t        enables;
11573         /*
11574          * This bit must be '1' for the vf_id field to be
11575          * configured.
11576          */
11577         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
11578         /*
11579          * This value is used to identify a Virtual Function (VF).
11580          * The scope of VF ID is local within a PF.
11581          */
11582         uint16_t        vf_id;
11583         uint8_t unused_0[2];
11584 } __rte_packed;
11585
11586 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
11587 struct hwrm_func_buf_unrgtr_output {
11588         /* The specific error status for the command. */
11589         uint16_t        error_code;
11590         /* The HWRM command request type. */
11591         uint16_t        req_type;
11592         /* The sequence ID from the original command. */
11593         uint16_t        seq_id;
11594         /* The length of the response data in number of bytes. */
11595         uint16_t        resp_len;
11596         uint8_t unused_0[7];
11597         /*
11598          * This field is used in Output records to indicate that the output
11599          * is completely written to RAM.  This field should be read as '1'
11600          * to indicate that the output has been completely written.
11601          * When writing a command completion or response to an internal processor,
11602          * the order of writes has to be such that this field is written last.
11603          */
11604         uint8_t valid;
11605 } __rte_packed;
11606
11607 /**********************
11608  * hwrm_func_drv_qver *
11609  **********************/
11610
11611
11612 /* hwrm_func_drv_qver_input (size:192b/24B) */
11613 struct hwrm_func_drv_qver_input {
11614         /* The HWRM command request type. */
11615         uint16_t        req_type;
11616         /*
11617          * The completion ring to send the completion event on. This should
11618          * be the NQ ID returned from the `nq_alloc` HWRM command.
11619          */
11620         uint16_t        cmpl_ring;
11621         /*
11622          * The sequence ID is used by the driver for tracking multiple
11623          * commands. This ID is treated as opaque data by the firmware and
11624          * the value is returned in the `hwrm_resp_hdr` upon completion.
11625          */
11626         uint16_t        seq_id;
11627         /*
11628          * The target ID of the command:
11629          * * 0x0-0xFFF8 - The function ID
11630          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11631          * * 0xFFFD - Reserved for user-space HWRM interface
11632          * * 0xFFFF - HWRM
11633          */
11634         uint16_t        target_id;
11635         /*
11636          * A physical address pointer pointing to a host buffer that the
11637          * command's response data will be written. This can be either a host
11638          * physical address (HPA) or a guest physical address (GPA) and must
11639          * point to a physically contiguous block of memory.
11640          */
11641         uint64_t        resp_addr;
11642         /* Reserved for future use. */
11643         uint32_t        reserved;
11644         /*
11645          * Function ID of the function that is being queried.
11646          * 0xFF... (All Fs) if the query is for the requesting
11647          * function.
11648          */
11649         uint16_t        fid;
11650         uint8_t unused_0[2];
11651 } __rte_packed;
11652
11653 /* hwrm_func_drv_qver_output (size:256b/32B) */
11654 struct hwrm_func_drv_qver_output {
11655         /* The specific error status for the command. */
11656         uint16_t        error_code;
11657         /* The HWRM command request type. */
11658         uint16_t        req_type;
11659         /* The sequence ID from the original command. */
11660         uint16_t        seq_id;
11661         /* The length of the response data in number of bytes. */
11662         uint16_t        resp_len;
11663         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
11664         uint16_t        os_type;
11665         /* Unknown */
11666         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
11667         /* Other OS not listed below. */
11668         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
11669         /* MSDOS OS. */
11670         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
11671         /* Windows OS. */
11672         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
11673         /* Solaris OS. */
11674         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
11675         /* Linux OS. */
11676         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
11677         /* FreeBSD OS. */
11678         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
11679         /* VMware ESXi OS. */
11680         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
11681         /* Microsoft Windows 8 64-bit OS. */
11682         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
11683         /* Microsoft Windows Server 2012 R2 OS. */
11684         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
11685         /* UEFI driver. */
11686         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
11687         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
11688                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
11689         /* This is the 8bit major version of the driver. */
11690         uint8_t ver_maj_8b;
11691         /* This is the 8bit minor version of the driver. */
11692         uint8_t ver_min_8b;
11693         /* This is the 8bit update version of the driver. */
11694         uint8_t ver_upd_8b;
11695         uint8_t unused_0[3];
11696         /* This is the 16bit major version of the driver. */
11697         uint16_t        ver_maj;
11698         /* This is the 16bit minor version of the driver. */
11699         uint16_t        ver_min;
11700         /* This is the 16bit update version of the driver. */
11701         uint16_t        ver_upd;
11702         /* This is the 16bit patch version of the driver. */
11703         uint16_t        ver_patch;
11704         uint8_t unused_1[7];
11705         /*
11706          * This field is used in Output records to indicate that the output
11707          * is completely written to RAM.  This field should be read as '1'
11708          * to indicate that the output has been completely written.
11709          * When writing a command completion or response to an internal processor,
11710          * the order of writes has to be such that this field is written last.
11711          */
11712         uint8_t valid;
11713 } __rte_packed;
11714
11715 /****************************
11716  * hwrm_func_resource_qcaps *
11717  ****************************/
11718
11719
11720 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
11721 struct hwrm_func_resource_qcaps_input {
11722         /* The HWRM command request type. */
11723         uint16_t        req_type;
11724         /*
11725          * The completion ring to send the completion event on. This should
11726          * be the NQ ID returned from the `nq_alloc` HWRM command.
11727          */
11728         uint16_t        cmpl_ring;
11729         /*
11730          * The sequence ID is used by the driver for tracking multiple
11731          * commands. This ID is treated as opaque data by the firmware and
11732          * the value is returned in the `hwrm_resp_hdr` upon completion.
11733          */
11734         uint16_t        seq_id;
11735         /*
11736          * The target ID of the command:
11737          * * 0x0-0xFFF8 - The function ID
11738          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11739          * * 0xFFFD - Reserved for user-space HWRM interface
11740          * * 0xFFFF - HWRM
11741          */
11742         uint16_t        target_id;
11743         /*
11744          * A physical address pointer pointing to a host buffer that the
11745          * command's response data will be written. This can be either a host
11746          * physical address (HPA) or a guest physical address (GPA) and must
11747          * point to a physically contiguous block of memory.
11748          */
11749         uint64_t        resp_addr;
11750         /*
11751          * Function ID of the function that is being queried.
11752          * 0xFF... (All Fs) if the query is for the requesting
11753          * function.
11754          */
11755         uint16_t        fid;
11756         uint8_t unused_0[6];
11757 } __rte_packed;
11758
11759 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
11760 struct hwrm_func_resource_qcaps_output {
11761         /* The specific error status for the command. */
11762         uint16_t        error_code;
11763         /* The HWRM command request type. */
11764         uint16_t        req_type;
11765         /* The sequence ID from the original command. */
11766         uint16_t        seq_id;
11767         /* The length of the response data in number of bytes. */
11768         uint16_t        resp_len;
11769         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
11770         uint16_t        max_vfs;
11771         /* Maximum guaranteed number of MSI-X vectors supported by function */
11772         uint16_t        max_msix;
11773         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
11774         uint16_t        vf_reservation_strategy;
11775         /* The PF driver should evenly divide its remaining resources among all VFs. */
11776         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
11777                 UINT32_C(0x0)
11778         /* The PF driver should only reserve minimal resources for each VF. */
11779         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
11780                 UINT32_C(0x1)
11781         /*
11782          * The PF driver should not reserve any resources for each VF until the
11783          * the VF interface is brought up.
11784          */
11785         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
11786                 UINT32_C(0x2)
11787         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
11788                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
11789         /* Minimum guaranteed number of RSS/COS contexts */
11790         uint16_t        min_rsscos_ctx;
11791         /* Maximum non-guaranteed number of RSS/COS contexts */
11792         uint16_t        max_rsscos_ctx;
11793         /* Minimum guaranteed number of completion rings */
11794         uint16_t        min_cmpl_rings;
11795         /* Maximum non-guaranteed number of completion rings */
11796         uint16_t        max_cmpl_rings;
11797         /* Minimum guaranteed number of transmit rings */
11798         uint16_t        min_tx_rings;
11799         /* Maximum non-guaranteed number of transmit rings */
11800         uint16_t        max_tx_rings;
11801         /* Minimum guaranteed number of receive rings */
11802         uint16_t        min_rx_rings;
11803         /* Maximum non-guaranteed number of receive rings */
11804         uint16_t        max_rx_rings;
11805         /* Minimum guaranteed number of L2 contexts */
11806         uint16_t        min_l2_ctxs;
11807         /* Maximum non-guaranteed number of L2 contexts */
11808         uint16_t        max_l2_ctxs;
11809         /* Minimum guaranteed number of VNICs */
11810         uint16_t        min_vnics;
11811         /* Maximum non-guaranteed number of VNICs */
11812         uint16_t        max_vnics;
11813         /* Minimum guaranteed number of statistic contexts */
11814         uint16_t        min_stat_ctx;
11815         /* Maximum non-guaranteed number of statistic contexts */
11816         uint16_t        max_stat_ctx;
11817         /* Minimum guaranteed number of ring groups */
11818         uint16_t        min_hw_ring_grps;
11819         /* Maximum non-guaranteed number of ring groups */
11820         uint16_t        max_hw_ring_grps;
11821         /*
11822          * Maximum number of inputs into the transmit scheduler for this function.
11823          * The number of TX rings assigned to the function cannot exceed this value.
11824          */
11825         uint16_t        max_tx_scheduler_inputs;
11826         uint16_t        flags;
11827         /*
11828          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
11829          * feature to reserve all minimum resources when minimum >= 1, otherwise
11830          * returns an error.
11831          */
11832         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
11833                 UINT32_C(0x1)
11834         uint8_t unused_0[5];
11835         /*
11836          * This field is used in Output records to indicate that the output
11837          * is completely written to RAM.  This field should be read as '1'
11838          * to indicate that the output has been completely written.
11839          * When writing a command completion or response to an internal processor,
11840          * the order of writes has to be such that this field is written last.
11841          */
11842         uint8_t valid;
11843 } __rte_packed;
11844
11845 /*********************************
11846  * hwrm_func_backing_store_qcaps *
11847  *********************************/
11848
11849
11850 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
11851 struct hwrm_func_backing_store_qcaps_input {
11852         /* The HWRM command request type. */
11853         uint16_t        req_type;
11854         /*
11855          * The completion ring to send the completion event on. This should
11856          * be the NQ ID returned from the `nq_alloc` HWRM command.
11857          */
11858         uint16_t        cmpl_ring;
11859         /*
11860          * The sequence ID is used by the driver for tracking multiple
11861          * commands. This ID is treated as opaque data by the firmware and
11862          * the value is returned in the `hwrm_resp_hdr` upon completion.
11863          */
11864         uint16_t        seq_id;
11865         /*
11866          * The target ID of the command:
11867          * * 0x0-0xFFF8 - The function ID
11868          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11869          * * 0xFFFD - Reserved for user-space HWRM interface
11870          * * 0xFFFF - HWRM
11871          */
11872         uint16_t        target_id;
11873         /*
11874          * A physical address pointer pointing to a host buffer that the
11875          * command's response data will be written. This can be either a host
11876          * physical address (HPA) or a guest physical address (GPA) and must
11877          * point to a physically contiguous block of memory.
11878          */
11879         uint64_t        resp_addr;
11880 } __rte_packed;
11881
11882 /* hwrm_func_backing_store_qcaps_output (size:640b/80B) */
11883 struct hwrm_func_backing_store_qcaps_output {
11884         /* The specific error status for the command. */
11885         uint16_t        error_code;
11886         /* The HWRM command request type. */
11887         uint16_t        req_type;
11888         /* The sequence ID from the original command. */
11889         uint16_t        seq_id;
11890         /* The length of the response data in number of bytes. */
11891         uint16_t        resp_len;
11892         /* Maximum number of QP context entries supported for this function. */
11893         uint32_t        qp_max_entries;
11894         /*
11895          * Minimum number of QP context entries that are needed to be reserved
11896          * for QP1 for the PF and its VFs. PF drivers must allocate at least
11897          * this many QP context entries, even if RoCE will not be used.
11898          */
11899         uint16_t        qp_min_qp1_entries;
11900         /* Maximum number of QP context entries that can be used for L2. */
11901         uint16_t        qp_max_l2_entries;
11902         /* Number of bytes that must be allocated for each context entry. */
11903         uint16_t        qp_entry_size;
11904         /* Maximum number of SRQ context entries that can be used for L2. */
11905         uint16_t        srq_max_l2_entries;
11906         /* Maximum number of SRQ context entries supported for this function. */
11907         uint32_t        srq_max_entries;
11908         /* Number of bytes that must be allocated for each context entry. */
11909         uint16_t        srq_entry_size;
11910         /* Maximum number of CQ context entries that can be used for L2. */
11911         uint16_t        cq_max_l2_entries;
11912         /* Maximum number of CQ context entries supported for this function. */
11913         uint32_t        cq_max_entries;
11914         /* Number of bytes that must be allocated for each context entry. */
11915         uint16_t        cq_entry_size;
11916         /* Maximum number of VNIC context entries supported for this function. */
11917         uint16_t        vnic_max_vnic_entries;
11918         /* Maximum number of Ring table context entries supported for this function. */
11919         uint16_t        vnic_max_ring_table_entries;
11920         /* Number of bytes that must be allocated for each context entry. */
11921         uint16_t        vnic_entry_size;
11922         /* Maximum number of statistic context entries supported for this function. */
11923         uint32_t        stat_max_entries;
11924         /* Number of bytes that must be allocated for each context entry. */
11925         uint16_t        stat_entry_size;
11926         /* Number of bytes that must be allocated for each context entry. */
11927         uint16_t        tqm_entry_size;
11928         /* Minimum number of TQM context entries required per ring. */
11929         uint32_t        tqm_min_entries_per_ring;
11930         /*
11931          * Maximum number of TQM context entries supported per ring. This is
11932          * actually a recommended TQM queue size based on worst case usage of
11933          * the TQM queue.
11934          *
11935          * TQM fastpath rings should be sized large enough to accommodate the
11936          * maximum number of QPs (either L2 or RoCE, or both if shared)
11937          * that can be enqueued to the TQM ring.
11938          *
11939          * TQM slowpath rings should be sized as follows:
11940          *
11941          * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
11942          *
11943          * Where:
11944          *   num_vnics is the number of VNICs allocated in the VNIC backing store
11945          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
11946          *   num_roce_qps is the number of RoCE QPs in the QP backing store
11947          *   tqm_min_size is tqm_min_entries_per_ring reported by
11948          *     HWRM_FUNC_BACKING_STORE_QCAPS
11949          *
11950          * Note that TQM ring sizes cannot be extended while the system is
11951          * operational. If a PF driver needs to extend a TQM ring, it needs
11952          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
11953          * the backing store.
11954          */
11955         uint32_t        tqm_max_entries_per_ring;
11956         /*
11957          * Maximum number of MR plus AV context entries supported for this
11958          * function.
11959          */
11960         uint32_t        mrav_max_entries;
11961         /* Number of bytes that must be allocated for each context entry. */
11962         uint16_t        mrav_entry_size;
11963         /* Number of bytes that must be allocated for each context entry. */
11964         uint16_t        tim_entry_size;
11965         /* Maximum number of Timer context entries supported for this function. */
11966         uint32_t        tim_max_entries;
11967         /*
11968          * When this field is zero, the 32b `mrav_num_entries` field in the
11969          * `backing_store_cfg` and `backing_store_qcfg` commands represents
11970          * the total number of MR plus AV entries allowed in the MR/AV backing
11971          * store PBL.
11972          *
11973          * When this field is non-zero, the 32b `mrav_num_entries` field in
11974          * the `backing_store_cfg` and `backing_store_qcfg` commands is
11975          * logically divided into two 16b fields. Bits `[31:16]` represents
11976          * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
11977          * Both of these values are represented in a unit granularity
11978          * specified by this field. For example, if this field is 16 and
11979          * `mrav_num_entries` is `0x02000100`, then the number of MR entries
11980          * is 8192 and the number of AV entries is 4096.
11981          */
11982         uint16_t        mrav_num_entries_units;
11983         /*
11984          * The number of entries specified for any TQM ring must be a
11985          * multiple of this value to prevent any resource allocation
11986          * limitations.
11987          */
11988         uint8_t tqm_entries_multiple;
11989         /*
11990          * Initializer to be used by drivers
11991          * to initialize context memory to ensure
11992          * context subsystem flags an error for an attack
11993          * before the first time context load.
11994          */
11995         uint8_t ctx_kind_initializer;
11996         /* Reserved for future. */
11997         uint32_t        rsvd;
11998         /* Reserved for future. */
11999         uint16_t        rsvd1;
12000         /*
12001          * Count of TQM fastpath rings to be used for allocating backing store.
12002          * Backing store configuration must be specified for each TQM ring from
12003          * this count in `backing_store_cfg`.
12004          */
12005         uint8_t tqm_fp_rings_count;
12006         /*
12007          * This field is used in Output records to indicate that the output
12008          * is completely written to RAM.  This field should be read as '1'
12009          * to indicate that the output has been completely written.
12010          * When writing a command completion or response to an internal processor,
12011          * the order of writes has to be such that this field is written last.
12012          */
12013         uint8_t valid;
12014 } __rte_packed;
12015
12016 /*******************************
12017  * hwrm_func_backing_store_cfg *
12018  *******************************/
12019
12020
12021 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */
12022 struct hwrm_func_backing_store_cfg_input {
12023         /* The HWRM command request type. */
12024         uint16_t        req_type;
12025         /*
12026          * The completion ring to send the completion event on. This should
12027          * be the NQ ID returned from the `nq_alloc` HWRM command.
12028          */
12029         uint16_t        cmpl_ring;
12030         /*
12031          * The sequence ID is used by the driver for tracking multiple
12032          * commands. This ID is treated as opaque data by the firmware and
12033          * the value is returned in the `hwrm_resp_hdr` upon completion.
12034          */
12035         uint16_t        seq_id;
12036         /*
12037          * The target ID of the command:
12038          * * 0x0-0xFFF8 - The function ID
12039          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12040          * * 0xFFFD - Reserved for user-space HWRM interface
12041          * * 0xFFFF - HWRM
12042          */
12043         uint16_t        target_id;
12044         /*
12045          * A physical address pointer pointing to a host buffer that the
12046          * command's response data will be written. This can be either a host
12047          * physical address (HPA) or a guest physical address (GPA) and must
12048          * point to a physically contiguous block of memory.
12049          */
12050         uint64_t        resp_addr;
12051         uint32_t        flags;
12052         /*
12053          * When set, the firmware only uses on-chip resources and does not
12054          * expect any backing store to be provided by the host driver. This
12055          * mode provides minimal L2 functionality (e.g. limited L2 resources,
12056          * no RoCE).
12057          */
12058         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
12059                 UINT32_C(0x1)
12060         /*
12061          * When set, the 32b `mrav_num_entries` field is logically divided
12062          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
12063          */
12064         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT \
12065                 UINT32_C(0x2)
12066         uint32_t        enables;
12067         /*
12068          * This bit must be '1' for the qp fields to be
12069          * configured.
12070          */
12071         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
12072                 UINT32_C(0x1)
12073         /*
12074          * This bit must be '1' for the srq fields to be
12075          * configured.
12076          */
12077         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
12078                 UINT32_C(0x2)
12079         /*
12080          * This bit must be '1' for the cq fields to be
12081          * configured.
12082          */
12083         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
12084                 UINT32_C(0x4)
12085         /*
12086          * This bit must be '1' for the vnic fields to be
12087          * configured.
12088          */
12089         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
12090                 UINT32_C(0x8)
12091         /*
12092          * This bit must be '1' for the stat fields to be
12093          * configured.
12094          */
12095         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
12096                 UINT32_C(0x10)
12097         /*
12098          * This bit must be '1' for the tqm_sp fields to be
12099          * configured.
12100          */
12101         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
12102                 UINT32_C(0x20)
12103         /*
12104          * This bit must be '1' for the tqm_ring0 fields to be
12105          * configured.
12106          */
12107         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
12108                 UINT32_C(0x40)
12109         /*
12110          * This bit must be '1' for the tqm_ring1 fields to be
12111          * configured.
12112          */
12113         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
12114                 UINT32_C(0x80)
12115         /*
12116          * This bit must be '1' for the tqm_ring2 fields to be
12117          * configured.
12118          */
12119         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
12120                 UINT32_C(0x100)
12121         /*
12122          * This bit must be '1' for the tqm_ring3 fields to be
12123          * configured.
12124          */
12125         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
12126                 UINT32_C(0x200)
12127         /*
12128          * This bit must be '1' for the tqm_ring4 fields to be
12129          * configured.
12130          */
12131         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
12132                 UINT32_C(0x400)
12133         /*
12134          * This bit must be '1' for the tqm_ring5 fields to be
12135          * configured.
12136          */
12137         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
12138                 UINT32_C(0x800)
12139         /*
12140          * This bit must be '1' for the tqm_ring6 fields to be
12141          * configured.
12142          */
12143         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
12144                 UINT32_C(0x1000)
12145         /*
12146          * This bit must be '1' for the tqm_ring7 fields to be
12147          * configured.
12148          */
12149         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
12150                 UINT32_C(0x2000)
12151         /*
12152          * This bit must be '1' for the mrav fields to be
12153          * configured.
12154          */
12155         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
12156                 UINT32_C(0x4000)
12157         /*
12158          * This bit must be '1' for the tim fields to be
12159          * configured.
12160          */
12161         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
12162                 UINT32_C(0x8000)
12163         /* QPC page size and level. */
12164         uint8_t qpc_pg_size_qpc_lvl;
12165         /* QPC PBL indirect levels. */
12166         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
12167                 UINT32_C(0xf)
12168         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
12169         /* PBL pointer is physical start address. */
12170         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
12171                 UINT32_C(0x0)
12172         /* PBL pointer points to PTE table. */
12173         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
12174                 UINT32_C(0x1)
12175         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12176         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
12177                 UINT32_C(0x2)
12178         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
12179                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
12180         /* QPC page size. */
12181         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
12182                 UINT32_C(0xf0)
12183         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
12184         /* 4KB. */
12185         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
12186                 (UINT32_C(0x0) << 4)
12187         /* 8KB. */
12188         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
12189                 (UINT32_C(0x1) << 4)
12190         /* 64KB. */
12191         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
12192                 (UINT32_C(0x2) << 4)
12193         /* 2MB. */
12194         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
12195                 (UINT32_C(0x3) << 4)
12196         /* 8MB. */
12197         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
12198                 (UINT32_C(0x4) << 4)
12199         /* 1GB. */
12200         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
12201                 (UINT32_C(0x5) << 4)
12202         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
12203                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
12204         /* SRQ page size and level. */
12205         uint8_t srq_pg_size_srq_lvl;
12206         /* SRQ PBL indirect levels. */
12207         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
12208                 UINT32_C(0xf)
12209         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
12210         /* PBL pointer is physical start address. */
12211         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
12212                 UINT32_C(0x0)
12213         /* PBL pointer points to PTE table. */
12214         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
12215                 UINT32_C(0x1)
12216         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12217         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
12218                 UINT32_C(0x2)
12219         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
12220                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
12221         /* SRQ page size. */
12222         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
12223                 UINT32_C(0xf0)
12224         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
12225         /* 4KB. */
12226         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
12227                 (UINT32_C(0x0) << 4)
12228         /* 8KB. */
12229         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
12230                 (UINT32_C(0x1) << 4)
12231         /* 64KB. */
12232         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
12233                 (UINT32_C(0x2) << 4)
12234         /* 2MB. */
12235         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
12236                 (UINT32_C(0x3) << 4)
12237         /* 8MB. */
12238         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
12239                 (UINT32_C(0x4) << 4)
12240         /* 1GB. */
12241         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
12242                 (UINT32_C(0x5) << 4)
12243         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
12244                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
12245         /* CQ page size and level. */
12246         uint8_t cq_pg_size_cq_lvl;
12247         /* CQ PBL indirect levels. */
12248         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
12249                 UINT32_C(0xf)
12250         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
12251         /* PBL pointer is physical start address. */
12252         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
12253                 UINT32_C(0x0)
12254         /* PBL pointer points to PTE table. */
12255         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
12256                 UINT32_C(0x1)
12257         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12258         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
12259                 UINT32_C(0x2)
12260         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
12261                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
12262         /* CQ page size. */
12263         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
12264                 UINT32_C(0xf0)
12265         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
12266         /* 4KB. */
12267         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
12268                 (UINT32_C(0x0) << 4)
12269         /* 8KB. */
12270         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
12271                 (UINT32_C(0x1) << 4)
12272         /* 64KB. */
12273         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
12274                 (UINT32_C(0x2) << 4)
12275         /* 2MB. */
12276         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
12277                 (UINT32_C(0x3) << 4)
12278         /* 8MB. */
12279         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
12280                 (UINT32_C(0x4) << 4)
12281         /* 1GB. */
12282         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
12283                 (UINT32_C(0x5) << 4)
12284         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
12285                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
12286         /* VNIC page size and level. */
12287         uint8_t vnic_pg_size_vnic_lvl;
12288         /* VNIC PBL indirect levels. */
12289         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
12290                 UINT32_C(0xf)
12291         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
12292         /* PBL pointer is physical start address. */
12293         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
12294                 UINT32_C(0x0)
12295         /* PBL pointer points to PTE table. */
12296         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
12297                 UINT32_C(0x1)
12298         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12299         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
12300                 UINT32_C(0x2)
12301         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
12302                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
12303         /* VNIC page size. */
12304         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
12305                 UINT32_C(0xf0)
12306         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
12307         /* 4KB. */
12308         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
12309                 (UINT32_C(0x0) << 4)
12310         /* 8KB. */
12311         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
12312                 (UINT32_C(0x1) << 4)
12313         /* 64KB. */
12314         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
12315                 (UINT32_C(0x2) << 4)
12316         /* 2MB. */
12317         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
12318                 (UINT32_C(0x3) << 4)
12319         /* 8MB. */
12320         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
12321                 (UINT32_C(0x4) << 4)
12322         /* 1GB. */
12323         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
12324                 (UINT32_C(0x5) << 4)
12325         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
12326                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
12327         /* Stat page size and level. */
12328         uint8_t stat_pg_size_stat_lvl;
12329         /* Stat PBL indirect levels. */
12330         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
12331                 UINT32_C(0xf)
12332         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
12333         /* PBL pointer is physical start address. */
12334         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
12335                 UINT32_C(0x0)
12336         /* PBL pointer points to PTE table. */
12337         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
12338                 UINT32_C(0x1)
12339         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12340         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
12341                 UINT32_C(0x2)
12342         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
12343                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
12344         /* Stat page size. */
12345         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
12346                 UINT32_C(0xf0)
12347         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
12348         /* 4KB. */
12349         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
12350                 (UINT32_C(0x0) << 4)
12351         /* 8KB. */
12352         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
12353                 (UINT32_C(0x1) << 4)
12354         /* 64KB. */
12355         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
12356                 (UINT32_C(0x2) << 4)
12357         /* 2MB. */
12358         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
12359                 (UINT32_C(0x3) << 4)
12360         /* 8MB. */
12361         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
12362                 (UINT32_C(0x4) << 4)
12363         /* 1GB. */
12364         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
12365                 (UINT32_C(0x5) << 4)
12366         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
12367                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
12368         /* TQM slow path page size and level. */
12369         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
12370         /* TQM slow path PBL indirect levels. */
12371         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
12372                 UINT32_C(0xf)
12373         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
12374         /* PBL pointer is physical start address. */
12375         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
12376                 UINT32_C(0x0)
12377         /* PBL pointer points to PTE table. */
12378         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
12379                 UINT32_C(0x1)
12380         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12381         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
12382                 UINT32_C(0x2)
12383         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
12384                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
12385         /* TQM slow path page size. */
12386         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
12387                 UINT32_C(0xf0)
12388         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
12389         /* 4KB. */
12390         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
12391                 (UINT32_C(0x0) << 4)
12392         /* 8KB. */
12393         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
12394                 (UINT32_C(0x1) << 4)
12395         /* 64KB. */
12396         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
12397                 (UINT32_C(0x2) << 4)
12398         /* 2MB. */
12399         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
12400                 (UINT32_C(0x3) << 4)
12401         /* 8MB. */
12402         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
12403                 (UINT32_C(0x4) << 4)
12404         /* 1GB. */
12405         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
12406                 (UINT32_C(0x5) << 4)
12407         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
12408                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
12409         /* TQM ring 0 page size and level. */
12410         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
12411         /* TQM ring 0 PBL indirect levels. */
12412         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
12413                 UINT32_C(0xf)
12414         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
12415         /* PBL pointer is physical start address. */
12416         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
12417                 UINT32_C(0x0)
12418         /* PBL pointer points to PTE table. */
12419         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
12420                 UINT32_C(0x1)
12421         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12422         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
12423                 UINT32_C(0x2)
12424         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
12425                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
12426         /* TQM ring 0 page size. */
12427         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
12428                 UINT32_C(0xf0)
12429         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
12430         /* 4KB. */
12431         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
12432                 (UINT32_C(0x0) << 4)
12433         /* 8KB. */
12434         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
12435                 (UINT32_C(0x1) << 4)
12436         /* 64KB. */
12437         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
12438                 (UINT32_C(0x2) << 4)
12439         /* 2MB. */
12440         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
12441                 (UINT32_C(0x3) << 4)
12442         /* 8MB. */
12443         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
12444                 (UINT32_C(0x4) << 4)
12445         /* 1GB. */
12446         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
12447                 (UINT32_C(0x5) << 4)
12448         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
12449                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
12450         /* TQM ring 1 page size and level. */
12451         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
12452         /* TQM ring 1 PBL indirect levels. */
12453         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
12454                 UINT32_C(0xf)
12455         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
12456         /* PBL pointer is physical start address. */
12457         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
12458                 UINT32_C(0x0)
12459         /* PBL pointer points to PTE table. */
12460         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
12461                 UINT32_C(0x1)
12462         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12463         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
12464                 UINT32_C(0x2)
12465         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
12466                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
12467         /* TQM ring 1 page size. */
12468         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
12469                 UINT32_C(0xf0)
12470         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
12471         /* 4KB. */
12472         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
12473                 (UINT32_C(0x0) << 4)
12474         /* 8KB. */
12475         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
12476                 (UINT32_C(0x1) << 4)
12477         /* 64KB. */
12478         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
12479                 (UINT32_C(0x2) << 4)
12480         /* 2MB. */
12481         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
12482                 (UINT32_C(0x3) << 4)
12483         /* 8MB. */
12484         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
12485                 (UINT32_C(0x4) << 4)
12486         /* 1GB. */
12487         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
12488                 (UINT32_C(0x5) << 4)
12489         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
12490                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
12491         /* TQM ring 2 page size and level. */
12492         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
12493         /* TQM ring 2 PBL indirect levels. */
12494         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
12495                 UINT32_C(0xf)
12496         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
12497         /* PBL pointer is physical start address. */
12498         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
12499                 UINT32_C(0x0)
12500         /* PBL pointer points to PTE table. */
12501         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
12502                 UINT32_C(0x1)
12503         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12504         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
12505                 UINT32_C(0x2)
12506         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
12507                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
12508         /* TQM ring 2 page size. */
12509         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
12510                 UINT32_C(0xf0)
12511         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
12512         /* 4KB. */
12513         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
12514                 (UINT32_C(0x0) << 4)
12515         /* 8KB. */
12516         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
12517                 (UINT32_C(0x1) << 4)
12518         /* 64KB. */
12519         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
12520                 (UINT32_C(0x2) << 4)
12521         /* 2MB. */
12522         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
12523                 (UINT32_C(0x3) << 4)
12524         /* 8MB. */
12525         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
12526                 (UINT32_C(0x4) << 4)
12527         /* 1GB. */
12528         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
12529                 (UINT32_C(0x5) << 4)
12530         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
12531                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
12532         /* TQM ring 3 page size and level. */
12533         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
12534         /* TQM ring 3 PBL indirect levels. */
12535         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
12536                 UINT32_C(0xf)
12537         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
12538         /* PBL pointer is physical start address. */
12539         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
12540                 UINT32_C(0x0)
12541         /* PBL pointer points to PTE table. */
12542         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
12543                 UINT32_C(0x1)
12544         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12545         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
12546                 UINT32_C(0x2)
12547         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
12548                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
12549         /* TQM ring 3 page size. */
12550         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
12551                 UINT32_C(0xf0)
12552         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
12553         /* 4KB. */
12554         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
12555                 (UINT32_C(0x0) << 4)
12556         /* 8KB. */
12557         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
12558                 (UINT32_C(0x1) << 4)
12559         /* 64KB. */
12560         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
12561                 (UINT32_C(0x2) << 4)
12562         /* 2MB. */
12563         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
12564                 (UINT32_C(0x3) << 4)
12565         /* 8MB. */
12566         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
12567                 (UINT32_C(0x4) << 4)
12568         /* 1GB. */
12569         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
12570                 (UINT32_C(0x5) << 4)
12571         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
12572                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
12573         /* TQM ring 4 page size and level. */
12574         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
12575         /* TQM ring 4 PBL indirect levels. */
12576         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
12577                 UINT32_C(0xf)
12578         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
12579         /* PBL pointer is physical start address. */
12580         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
12581                 UINT32_C(0x0)
12582         /* PBL pointer points to PTE table. */
12583         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
12584                 UINT32_C(0x1)
12585         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12586         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
12587                 UINT32_C(0x2)
12588         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
12589                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
12590         /* TQM ring 4 page size. */
12591         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
12592                 UINT32_C(0xf0)
12593         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
12594         /* 4KB. */
12595         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
12596                 (UINT32_C(0x0) << 4)
12597         /* 8KB. */
12598         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
12599                 (UINT32_C(0x1) << 4)
12600         /* 64KB. */
12601         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
12602                 (UINT32_C(0x2) << 4)
12603         /* 2MB. */
12604         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
12605                 (UINT32_C(0x3) << 4)
12606         /* 8MB. */
12607         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
12608                 (UINT32_C(0x4) << 4)
12609         /* 1GB. */
12610         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
12611                 (UINT32_C(0x5) << 4)
12612         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
12613                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
12614         /* TQM ring 5 page size and level. */
12615         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
12616         /* TQM ring 5 PBL indirect levels. */
12617         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
12618                 UINT32_C(0xf)
12619         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
12620         /* PBL pointer is physical start address. */
12621         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
12622                 UINT32_C(0x0)
12623         /* PBL pointer points to PTE table. */
12624         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
12625                 UINT32_C(0x1)
12626         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12627         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
12628                 UINT32_C(0x2)
12629         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
12630                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
12631         /* TQM ring 5 page size. */
12632         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
12633                 UINT32_C(0xf0)
12634         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
12635         /* 4KB. */
12636         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
12637                 (UINT32_C(0x0) << 4)
12638         /* 8KB. */
12639         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
12640                 (UINT32_C(0x1) << 4)
12641         /* 64KB. */
12642         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
12643                 (UINT32_C(0x2) << 4)
12644         /* 2MB. */
12645         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
12646                 (UINT32_C(0x3) << 4)
12647         /* 8MB. */
12648         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
12649                 (UINT32_C(0x4) << 4)
12650         /* 1GB. */
12651         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
12652                 (UINT32_C(0x5) << 4)
12653         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
12654                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
12655         /* TQM ring 6 page size and level. */
12656         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
12657         /* TQM ring 6 PBL indirect levels. */
12658         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
12659                 UINT32_C(0xf)
12660         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
12661         /* PBL pointer is physical start address. */
12662         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
12663                 UINT32_C(0x0)
12664         /* PBL pointer points to PTE table. */
12665         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
12666                 UINT32_C(0x1)
12667         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12668         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
12669                 UINT32_C(0x2)
12670         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
12671                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
12672         /* TQM ring 6 page size. */
12673         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
12674                 UINT32_C(0xf0)
12675         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
12676         /* 4KB. */
12677         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
12678                 (UINT32_C(0x0) << 4)
12679         /* 8KB. */
12680         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
12681                 (UINT32_C(0x1) << 4)
12682         /* 64KB. */
12683         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
12684                 (UINT32_C(0x2) << 4)
12685         /* 2MB. */
12686         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
12687                 (UINT32_C(0x3) << 4)
12688         /* 8MB. */
12689         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
12690                 (UINT32_C(0x4) << 4)
12691         /* 1GB. */
12692         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
12693                 (UINT32_C(0x5) << 4)
12694         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
12695                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
12696         /* TQM ring 7 page size and level. */
12697         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
12698         /* TQM ring 7 PBL indirect levels. */
12699         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
12700                 UINT32_C(0xf)
12701         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
12702         /* PBL pointer is physical start address. */
12703         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
12704                 UINT32_C(0x0)
12705         /* PBL pointer points to PTE table. */
12706         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
12707                 UINT32_C(0x1)
12708         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12709         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
12710                 UINT32_C(0x2)
12711         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
12712                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
12713         /* TQM ring 7 page size. */
12714         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
12715                 UINT32_C(0xf0)
12716         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
12717         /* 4KB. */
12718         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
12719                 (UINT32_C(0x0) << 4)
12720         /* 8KB. */
12721         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
12722                 (UINT32_C(0x1) << 4)
12723         /* 64KB. */
12724         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
12725                 (UINT32_C(0x2) << 4)
12726         /* 2MB. */
12727         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
12728                 (UINT32_C(0x3) << 4)
12729         /* 8MB. */
12730         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
12731                 (UINT32_C(0x4) << 4)
12732         /* 1GB. */
12733         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
12734                 (UINT32_C(0x5) << 4)
12735         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
12736                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
12737         /* MR/AV page size and level. */
12738         uint8_t mrav_pg_size_mrav_lvl;
12739         /* MR/AV PBL indirect levels. */
12740         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
12741                 UINT32_C(0xf)
12742         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
12743         /* PBL pointer is physical start address. */
12744         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
12745                 UINT32_C(0x0)
12746         /* PBL pointer points to PTE table. */
12747         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
12748                 UINT32_C(0x1)
12749         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12750         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
12751                 UINT32_C(0x2)
12752         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
12753                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
12754         /* MR/AV page size. */
12755         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
12756                 UINT32_C(0xf0)
12757         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
12758         /* 4KB. */
12759         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
12760                 (UINT32_C(0x0) << 4)
12761         /* 8KB. */
12762         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
12763                 (UINT32_C(0x1) << 4)
12764         /* 64KB. */
12765         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
12766                 (UINT32_C(0x2) << 4)
12767         /* 2MB. */
12768         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
12769                 (UINT32_C(0x3) << 4)
12770         /* 8MB. */
12771         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
12772                 (UINT32_C(0x4) << 4)
12773         /* 1GB. */
12774         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
12775                 (UINT32_C(0x5) << 4)
12776         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
12777                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
12778         /* Timer page size and level. */
12779         uint8_t tim_pg_size_tim_lvl;
12780         /* Timer PBL indirect levels. */
12781         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
12782                 UINT32_C(0xf)
12783         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
12784         /* PBL pointer is physical start address. */
12785         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
12786                 UINT32_C(0x0)
12787         /* PBL pointer points to PTE table. */
12788         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
12789                 UINT32_C(0x1)
12790         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
12791         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
12792                 UINT32_C(0x2)
12793         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
12794                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
12795         /* Timer page size. */
12796         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
12797                 UINT32_C(0xf0)
12798         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
12799         /* 4KB. */
12800         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
12801                 (UINT32_C(0x0) << 4)
12802         /* 8KB. */
12803         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
12804                 (UINT32_C(0x1) << 4)
12805         /* 64KB. */
12806         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
12807                 (UINT32_C(0x2) << 4)
12808         /* 2MB. */
12809         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
12810                 (UINT32_C(0x3) << 4)
12811         /* 8MB. */
12812         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
12813                 (UINT32_C(0x4) << 4)
12814         /* 1GB. */
12815         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
12816                 (UINT32_C(0x5) << 4)
12817         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
12818                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
12819         /* QP page directory. */
12820         uint64_t        qpc_page_dir;
12821         /* SRQ page directory. */
12822         uint64_t        srq_page_dir;
12823         /* CQ page directory. */
12824         uint64_t        cq_page_dir;
12825         /* VNIC page directory. */
12826         uint64_t        vnic_page_dir;
12827         /* Stat page directory. */
12828         uint64_t        stat_page_dir;
12829         /* TQM slowpath page directory. */
12830         uint64_t        tqm_sp_page_dir;
12831         /* TQM ring 0 page directory. */
12832         uint64_t        tqm_ring0_page_dir;
12833         /* TQM ring 1 page directory. */
12834         uint64_t        tqm_ring1_page_dir;
12835         /* TQM ring 2 page directory. */
12836         uint64_t        tqm_ring2_page_dir;
12837         /* TQM ring 3 page directory. */
12838         uint64_t        tqm_ring3_page_dir;
12839         /* TQM ring 4 page directory. */
12840         uint64_t        tqm_ring4_page_dir;
12841         /* TQM ring 5 page directory. */
12842         uint64_t        tqm_ring5_page_dir;
12843         /* TQM ring 6 page directory. */
12844         uint64_t        tqm_ring6_page_dir;
12845         /* TQM ring 7 page directory. */
12846         uint64_t        tqm_ring7_page_dir;
12847         /* MR/AV page directory. */
12848         uint64_t        mrav_page_dir;
12849         /* Timer page directory. */
12850         uint64_t        tim_page_dir;
12851         /* Number of QPs. */
12852         uint32_t        qp_num_entries;
12853         /* Number of SRQs. */
12854         uint32_t        srq_num_entries;
12855         /* Number of CQs. */
12856         uint32_t        cq_num_entries;
12857         /* Number of Stats. */
12858         uint32_t        stat_num_entries;
12859         /*
12860          * Number of TQM slowpath entries.
12861          *
12862          * TQM slowpath rings should be sized as follows:
12863          *
12864          * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
12865          *
12866          * Where:
12867          *   num_vnics is the number of VNICs allocated in the VNIC backing store
12868          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
12869          *   num_roce_qps is the number of RoCE QPs in the QP backing store
12870          *   tqm_min_size is tqm_min_entries_per_ring reported by
12871          *     HWRM_FUNC_BACKING_STORE_QCAPS
12872          *
12873          * Note that TQM ring sizes cannot be extended while the system is
12874          * operational. If a PF driver needs to extend a TQM ring, it needs
12875          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12876          * the backing store.
12877          */
12878         uint32_t        tqm_sp_num_entries;
12879         /*
12880          * Number of TQM ring 0 entries.
12881          *
12882          * TQM fastpath rings should be sized large enough to accommodate the
12883          * maximum number of QPs (either L2 or RoCE, or both if shared)
12884          * that can be enqueued to the TQM ring.
12885          *
12886          * Note that TQM ring sizes cannot be extended while the system is
12887          * operational. If a PF driver needs to extend a TQM ring, it needs
12888          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12889          * the backing store.
12890          */
12891         uint32_t        tqm_ring0_num_entries;
12892         /*
12893          * Number of TQM ring 1 entries.
12894          *
12895          * TQM fastpath rings should be sized large enough to accommodate the
12896          * maximum number of QPs (either L2 or RoCE, or both if shared)
12897          * that can be enqueued to the TQM ring.
12898          *
12899          * Note that TQM ring sizes cannot be extended while the system is
12900          * operational. If a PF driver needs to extend a TQM ring, it needs
12901          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12902          * the backing store.
12903          */
12904         uint32_t        tqm_ring1_num_entries;
12905         /*
12906          * Number of TQM ring 2 entries.
12907          *
12908          * TQM fastpath rings should be sized large enough to accommodate the
12909          * maximum number of QPs (either L2 or RoCE, or both if shared)
12910          * that can be enqueued to the TQM ring.
12911          *
12912          * Note that TQM ring sizes cannot be extended while the system is
12913          * operational. If a PF driver needs to extend a TQM ring, it needs
12914          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12915          * the backing store.
12916          */
12917         uint32_t        tqm_ring2_num_entries;
12918         /*
12919          * Number of TQM ring 3 entries.
12920          *
12921          * TQM fastpath rings should be sized large enough to accommodate the
12922          * maximum number of QPs (either L2 or RoCE, or both if shared)
12923          * that can be enqueued to the TQM ring.
12924          *
12925          * Note that TQM ring sizes cannot be extended while the system is
12926          * operational. If a PF driver needs to extend a TQM ring, it needs
12927          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12928          * the backing store.
12929          */
12930         uint32_t        tqm_ring3_num_entries;
12931         /*
12932          * Number of TQM ring 4 entries.
12933          *
12934          * TQM fastpath rings should be sized large enough to accommodate the
12935          * maximum number of QPs (either L2 or RoCE, or both if shared)
12936          * that can be enqueued to the TQM ring.
12937          *
12938          * Note that TQM ring sizes cannot be extended while the system is
12939          * operational. If a PF driver needs to extend a TQM ring, it needs
12940          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12941          * the backing store.
12942          */
12943         uint32_t        tqm_ring4_num_entries;
12944         /*
12945          * Number of TQM ring 5 entries.
12946          *
12947          * TQM fastpath rings should be sized large enough to accommodate the
12948          * maximum number of QPs (either L2 or RoCE, or both if shared)
12949          * that can be enqueued to the TQM ring.
12950          *
12951          * Note that TQM ring sizes cannot be extended while the system is
12952          * operational. If a PF driver needs to extend a TQM ring, it needs
12953          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12954          * the backing store.
12955          */
12956         uint32_t        tqm_ring5_num_entries;
12957         /*
12958          * Number of TQM ring 6 entries.
12959          *
12960          * TQM fastpath rings should be sized large enough to accommodate the
12961          * maximum number of QPs (either L2 or RoCE, or both if shared)
12962          * that can be enqueued to the TQM ring.
12963          *
12964          * Note that TQM ring sizes cannot be extended while the system is
12965          * operational. If a PF driver needs to extend a TQM ring, it needs
12966          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12967          * the backing store.
12968          */
12969         uint32_t        tqm_ring6_num_entries;
12970         /*
12971          * Number of TQM ring 7 entries.
12972          *
12973          * TQM fastpath rings should be sized large enough to accommodate the
12974          * maximum number of QPs (either L2 or RoCE, or both if shared)
12975          * that can be enqueued to the TQM ring.
12976          *
12977          * Note that TQM ring sizes cannot be extended while the system is
12978          * operational. If a PF driver needs to extend a TQM ring, it needs
12979          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
12980          * the backing store.
12981          */
12982         uint32_t        tqm_ring7_num_entries;
12983         /*
12984          * If the MR/AV split reservation flag is not set, then this field
12985          * represents the total number of MR plus AV entries. For versions
12986          * of firmware that support the split reservation, when it is not
12987          * specified half of the entries will be reserved for MRs and the
12988          * other half for AVs.
12989          *
12990          * If the MR/AV split reservation flag is set, then this
12991          * field is logically divided into two 16b fields. Bits `[31:16]`
12992          * represents the `mr_num_entries` and bits `[15:0]` represents
12993          * `av_num_entries`. The granularity of these values is defined by
12994          * the `mrav_num_entries_unit` field returned by the
12995          * `backing_store_qcaps` command.
12996          */
12997         uint32_t        mrav_num_entries;
12998         /* Number of Timer entries. */
12999         uint32_t        tim_num_entries;
13000         /* Number of entries to reserve for QP1 */
13001         uint16_t        qp_num_qp1_entries;
13002         /* Number of entries to reserve for L2 */
13003         uint16_t        qp_num_l2_entries;
13004         /* Number of bytes that have been allocated for each context entry. */
13005         uint16_t        qp_entry_size;
13006         /* Number of entries to reserve for L2 */
13007         uint16_t        srq_num_l2_entries;
13008         /* Number of bytes that have been allocated for each context entry. */
13009         uint16_t        srq_entry_size;
13010         /* Number of entries to reserve for L2 */
13011         uint16_t        cq_num_l2_entries;
13012         /* Number of bytes that have been allocated for each context entry. */
13013         uint16_t        cq_entry_size;
13014         /* Number of entries to reserve for VNIC entries */
13015         uint16_t        vnic_num_vnic_entries;
13016         /* Number of entries to reserve for Ring table entries */
13017         uint16_t        vnic_num_ring_table_entries;
13018         /* Number of bytes that have been allocated for each context entry. */
13019         uint16_t        vnic_entry_size;
13020         /* Number of bytes that have been allocated for each context entry. */
13021         uint16_t        stat_entry_size;
13022         /* Number of bytes that have been allocated for each context entry. */
13023         uint16_t        tqm_entry_size;
13024         /* Number of bytes that have been allocated for each context entry. */
13025         uint16_t        mrav_entry_size;
13026         /* Number of bytes that have been allocated for each context entry. */
13027         uint16_t        tim_entry_size;
13028 } __rte_packed;
13029
13030 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
13031 struct hwrm_func_backing_store_cfg_output {
13032         /* The specific error status for the command. */
13033         uint16_t        error_code;
13034         /* The HWRM command request type. */
13035         uint16_t        req_type;
13036         /* The sequence ID from the original command. */
13037         uint16_t        seq_id;
13038         /* The length of the response data in number of bytes. */
13039         uint16_t        resp_len;
13040         uint8_t unused_0[7];
13041         /*
13042          * This field is used in Output records to indicate that the output
13043          * is completely written to RAM.  This field should be read as '1'
13044          * to indicate that the output has been completely written.
13045          * When writing a command completion or response to an internal processor,
13046          * the order of writes has to be such that this field is written last.
13047          */
13048         uint8_t valid;
13049 } __rte_packed;
13050
13051 /********************************
13052  * hwrm_func_backing_store_qcfg *
13053  ********************************/
13054
13055
13056 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
13057 struct hwrm_func_backing_store_qcfg_input {
13058         /* The HWRM command request type. */
13059         uint16_t        req_type;
13060         /*
13061          * The completion ring to send the completion event on. This should
13062          * be the NQ ID returned from the `nq_alloc` HWRM command.
13063          */
13064         uint16_t        cmpl_ring;
13065         /*
13066          * The sequence ID is used by the driver for tracking multiple
13067          * commands. This ID is treated as opaque data by the firmware and
13068          * the value is returned in the `hwrm_resp_hdr` upon completion.
13069          */
13070         uint16_t        seq_id;
13071         /*
13072          * The target ID of the command:
13073          * * 0x0-0xFFF8 - The function ID
13074          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13075          * * 0xFFFD - Reserved for user-space HWRM interface
13076          * * 0xFFFF - HWRM
13077          */
13078         uint16_t        target_id;
13079         /*
13080          * A physical address pointer pointing to a host buffer that the
13081          * command's response data will be written. This can be either a host
13082          * physical address (HPA) or a guest physical address (GPA) and must
13083          * point to a physically contiguous block of memory.
13084          */
13085         uint64_t        resp_addr;
13086 } __rte_packed;
13087
13088 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
13089 struct hwrm_func_backing_store_qcfg_output {
13090         /* The specific error status for the command. */
13091         uint16_t        error_code;
13092         /* The HWRM command request type. */
13093         uint16_t        req_type;
13094         /* The sequence ID from the original command. */
13095         uint16_t        seq_id;
13096         /* The length of the response data in number of bytes. */
13097         uint16_t        resp_len;
13098         uint32_t        flags;
13099         /*
13100          * When set, the firmware only uses on-chip resources and does not
13101          * expect any backing store to be provided by the host driver. This
13102          * mode provides minimal L2 functionality (e.g. limited L2 resources,
13103          * no RoCE).
13104          */
13105         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
13106                 UINT32_C(0x1)
13107         /*
13108          * When set, the 32b `mrav_num_entries` field is logically divided
13109          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
13110          */
13111         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT \
13112                 UINT32_C(0x2)
13113         uint8_t unused_0[4];
13114         /*
13115          * This bit must be '1' for the qp fields to be
13116          * configured.
13117          */
13118         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \
13119                 UINT32_C(0x1)
13120         /*
13121          * This bit must be '1' for the srq fields to be
13122          * configured.
13123          */
13124         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \
13125                 UINT32_C(0x2)
13126         /*
13127          * This bit must be '1' for the cq fields to be
13128          * configured.
13129          */
13130         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \
13131                 UINT32_C(0x4)
13132         /*
13133          * This bit must be '1' for the vnic fields to be
13134          * configured.
13135          */
13136         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \
13137                 UINT32_C(0x8)
13138         /*
13139          * This bit must be '1' for the stat fields to be
13140          * configured.
13141          */
13142         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \
13143                 UINT32_C(0x10)
13144         /*
13145          * This bit must be '1' for the tqm_sp fields to be
13146          * configured.
13147          */
13148         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \
13149                 UINT32_C(0x20)
13150         /*
13151          * This bit must be '1' for the tqm_ring0 fields to be
13152          * configured.
13153          */
13154         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \
13155                 UINT32_C(0x40)
13156         /*
13157          * This bit must be '1' for the tqm_ring1 fields to be
13158          * configured.
13159          */
13160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \
13161                 UINT32_C(0x80)
13162         /*
13163          * This bit must be '1' for the tqm_ring2 fields to be
13164          * configured.
13165          */
13166         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \
13167                 UINT32_C(0x100)
13168         /*
13169          * This bit must be '1' for the tqm_ring3 fields to be
13170          * configured.
13171          */
13172         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \
13173                 UINT32_C(0x200)
13174         /*
13175          * This bit must be '1' for the tqm_ring4 fields to be
13176          * configured.
13177          */
13178         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \
13179                 UINT32_C(0x400)
13180         /*
13181          * This bit must be '1' for the tqm_ring5 fields to be
13182          * configured.
13183          */
13184         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \
13185                 UINT32_C(0x800)
13186         /*
13187          * This bit must be '1' for the tqm_ring6 fields to be
13188          * configured.
13189          */
13190         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \
13191                 UINT32_C(0x1000)
13192         /*
13193          * This bit must be '1' for the tqm_ring7 fields to be
13194          * configured.
13195          */
13196         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \
13197                 UINT32_C(0x2000)
13198         /*
13199          * This bit must be '1' for the mrav fields to be
13200          * configured.
13201          */
13202         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \
13203                 UINT32_C(0x4000)
13204         /*
13205          * This bit must be '1' for the tim fields to be
13206          * configured.
13207          */
13208         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \
13209                 UINT32_C(0x8000)
13210         /* QPC page size and level. */
13211         uint8_t qpc_pg_size_qpc_lvl;
13212         /* QPC PBL indirect levels. */
13213         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
13214                 UINT32_C(0xf)
13215         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
13216         /* PBL pointer is physical start address. */
13217         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
13218                 UINT32_C(0x0)
13219         /* PBL pointer points to PTE table. */
13220         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
13221                 UINT32_C(0x1)
13222         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13223         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
13224                 UINT32_C(0x2)
13225         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
13226                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
13227         /* QPC page size. */
13228         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
13229                 UINT32_C(0xf0)
13230         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
13231         /* 4KB. */
13232         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
13233                 (UINT32_C(0x0) << 4)
13234         /* 8KB. */
13235         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
13236                 (UINT32_C(0x1) << 4)
13237         /* 64KB. */
13238         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
13239                 (UINT32_C(0x2) << 4)
13240         /* 2MB. */
13241         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
13242                 (UINT32_C(0x3) << 4)
13243         /* 8MB. */
13244         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
13245                 (UINT32_C(0x4) << 4)
13246         /* 1GB. */
13247         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
13248                 (UINT32_C(0x5) << 4)
13249         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
13250                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
13251         /* SRQ page size and level. */
13252         uint8_t srq_pg_size_srq_lvl;
13253         /* SRQ PBL indirect levels. */
13254         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
13255                 UINT32_C(0xf)
13256         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
13257         /* PBL pointer is physical start address. */
13258         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
13259                 UINT32_C(0x0)
13260         /* PBL pointer points to PTE table. */
13261         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
13262                 UINT32_C(0x1)
13263         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13264         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
13265                 UINT32_C(0x2)
13266         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
13267                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
13268         /* SRQ page size. */
13269         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
13270                 UINT32_C(0xf0)
13271         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
13272         /* 4KB. */
13273         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
13274                 (UINT32_C(0x0) << 4)
13275         /* 8KB. */
13276         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
13277                 (UINT32_C(0x1) << 4)
13278         /* 64KB. */
13279         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
13280                 (UINT32_C(0x2) << 4)
13281         /* 2MB. */
13282         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
13283                 (UINT32_C(0x3) << 4)
13284         /* 8MB. */
13285         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
13286                 (UINT32_C(0x4) << 4)
13287         /* 1GB. */
13288         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
13289                 (UINT32_C(0x5) << 4)
13290         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
13291                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
13292         /* CQ page size and level. */
13293         uint8_t cq_pg_size_cq_lvl;
13294         /* CQ PBL indirect levels. */
13295         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
13296                 UINT32_C(0xf)
13297         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
13298         /* PBL pointer is physical start address. */
13299         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
13300                 UINT32_C(0x0)
13301         /* PBL pointer points to PTE table. */
13302         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
13303                 UINT32_C(0x1)
13304         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13305         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
13306                 UINT32_C(0x2)
13307         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
13308                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
13309         /* CQ page size. */
13310         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
13311                 UINT32_C(0xf0)
13312         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
13313         /* 4KB. */
13314         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
13315                 (UINT32_C(0x0) << 4)
13316         /* 8KB. */
13317         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
13318                 (UINT32_C(0x1) << 4)
13319         /* 64KB. */
13320         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
13321                 (UINT32_C(0x2) << 4)
13322         /* 2MB. */
13323         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
13324                 (UINT32_C(0x3) << 4)
13325         /* 8MB. */
13326         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
13327                 (UINT32_C(0x4) << 4)
13328         /* 1GB. */
13329         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
13330                 (UINT32_C(0x5) << 4)
13331         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
13332                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
13333         /* VNIC page size and level. */
13334         uint8_t vnic_pg_size_vnic_lvl;
13335         /* VNIC PBL indirect levels. */
13336         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
13337                 UINT32_C(0xf)
13338         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
13339         /* PBL pointer is physical start address. */
13340         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
13341                 UINT32_C(0x0)
13342         /* PBL pointer points to PTE table. */
13343         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
13344                 UINT32_C(0x1)
13345         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13346         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
13347                 UINT32_C(0x2)
13348         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
13349                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
13350         /* VNIC page size. */
13351         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
13352                 UINT32_C(0xf0)
13353         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
13354         /* 4KB. */
13355         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
13356                 (UINT32_C(0x0) << 4)
13357         /* 8KB. */
13358         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
13359                 (UINT32_C(0x1) << 4)
13360         /* 64KB. */
13361         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
13362                 (UINT32_C(0x2) << 4)
13363         /* 2MB. */
13364         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
13365                 (UINT32_C(0x3) << 4)
13366         /* 8MB. */
13367         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
13368                 (UINT32_C(0x4) << 4)
13369         /* 1GB. */
13370         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
13371                 (UINT32_C(0x5) << 4)
13372         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
13373                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
13374         /* Stat page size and level. */
13375         uint8_t stat_pg_size_stat_lvl;
13376         /* Stat PBL indirect levels. */
13377         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
13378                 UINT32_C(0xf)
13379         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
13380         /* PBL pointer is physical start address. */
13381         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
13382                 UINT32_C(0x0)
13383         /* PBL pointer points to PTE table. */
13384         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
13385                 UINT32_C(0x1)
13386         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13387         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
13388                 UINT32_C(0x2)
13389         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
13390                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
13391         /* Stat page size. */
13392         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
13393                 UINT32_C(0xf0)
13394         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
13395         /* 4KB. */
13396         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
13397                 (UINT32_C(0x0) << 4)
13398         /* 8KB. */
13399         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
13400                 (UINT32_C(0x1) << 4)
13401         /* 64KB. */
13402         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
13403                 (UINT32_C(0x2) << 4)
13404         /* 2MB. */
13405         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
13406                 (UINT32_C(0x3) << 4)
13407         /* 8MB. */
13408         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
13409                 (UINT32_C(0x4) << 4)
13410         /* 1GB. */
13411         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
13412                 (UINT32_C(0x5) << 4)
13413         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
13414                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
13415         /* TQM slow path page size and level. */
13416         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
13417         /* TQM slow path PBL indirect levels. */
13418         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
13419                 UINT32_C(0xf)
13420         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
13421         /* PBL pointer is physical start address. */
13422         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
13423                 UINT32_C(0x0)
13424         /* PBL pointer points to PTE table. */
13425         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
13426                 UINT32_C(0x1)
13427         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13428         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
13429                 UINT32_C(0x2)
13430         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
13431                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
13432         /* TQM slow path page size. */
13433         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
13434                 UINT32_C(0xf0)
13435         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
13436         /* 4KB. */
13437         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
13438                 (UINT32_C(0x0) << 4)
13439         /* 8KB. */
13440         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
13441                 (UINT32_C(0x1) << 4)
13442         /* 64KB. */
13443         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
13444                 (UINT32_C(0x2) << 4)
13445         /* 2MB. */
13446         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
13447                 (UINT32_C(0x3) << 4)
13448         /* 8MB. */
13449         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
13450                 (UINT32_C(0x4) << 4)
13451         /* 1GB. */
13452         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
13453                 (UINT32_C(0x5) << 4)
13454         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
13455                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
13456         /* TQM ring 0 page size and level. */
13457         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
13458         /* TQM ring 0 PBL indirect levels. */
13459         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
13460                 UINT32_C(0xf)
13461         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
13462         /* PBL pointer is physical start address. */
13463         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
13464                 UINT32_C(0x0)
13465         /* PBL pointer points to PTE table. */
13466         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
13467                 UINT32_C(0x1)
13468         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13469         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
13470                 UINT32_C(0x2)
13471         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
13472                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
13473         /* TQM ring 0 page size. */
13474         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
13475                 UINT32_C(0xf0)
13476         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
13477         /* 4KB. */
13478         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
13479                 (UINT32_C(0x0) << 4)
13480         /* 8KB. */
13481         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
13482                 (UINT32_C(0x1) << 4)
13483         /* 64KB. */
13484         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
13485                 (UINT32_C(0x2) << 4)
13486         /* 2MB. */
13487         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
13488                 (UINT32_C(0x3) << 4)
13489         /* 8MB. */
13490         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
13491                 (UINT32_C(0x4) << 4)
13492         /* 1GB. */
13493         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
13494                 (UINT32_C(0x5) << 4)
13495         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
13496                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
13497         /* TQM ring 1 page size and level. */
13498         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
13499         /* TQM ring 1 PBL indirect levels. */
13500         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
13501                 UINT32_C(0xf)
13502         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
13503         /* PBL pointer is physical start address. */
13504         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
13505                 UINT32_C(0x0)
13506         /* PBL pointer points to PTE table. */
13507         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
13508                 UINT32_C(0x1)
13509         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13510         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
13511                 UINT32_C(0x2)
13512         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
13513                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
13514         /* TQM ring 1 page size. */
13515         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
13516                 UINT32_C(0xf0)
13517         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
13518         /* 4KB. */
13519         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
13520                 (UINT32_C(0x0) << 4)
13521         /* 8KB. */
13522         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
13523                 (UINT32_C(0x1) << 4)
13524         /* 64KB. */
13525         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
13526                 (UINT32_C(0x2) << 4)
13527         /* 2MB. */
13528         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
13529                 (UINT32_C(0x3) << 4)
13530         /* 8MB. */
13531         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
13532                 (UINT32_C(0x4) << 4)
13533         /* 1GB. */
13534         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
13535                 (UINT32_C(0x5) << 4)
13536         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
13537                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
13538         /* TQM ring 2 page size and level. */
13539         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
13540         /* TQM ring 2 PBL indirect levels. */
13541         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
13542                 UINT32_C(0xf)
13543         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
13544         /* PBL pointer is physical start address. */
13545         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
13546                 UINT32_C(0x0)
13547         /* PBL pointer points to PTE table. */
13548         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
13549                 UINT32_C(0x1)
13550         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13551         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
13552                 UINT32_C(0x2)
13553         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
13554                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
13555         /* TQM ring 2 page size. */
13556         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
13557                 UINT32_C(0xf0)
13558         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
13559         /* 4KB. */
13560         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
13561                 (UINT32_C(0x0) << 4)
13562         /* 8KB. */
13563         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
13564                 (UINT32_C(0x1) << 4)
13565         /* 64KB. */
13566         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
13567                 (UINT32_C(0x2) << 4)
13568         /* 2MB. */
13569         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
13570                 (UINT32_C(0x3) << 4)
13571         /* 8MB. */
13572         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
13573                 (UINT32_C(0x4) << 4)
13574         /* 1GB. */
13575         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
13576                 (UINT32_C(0x5) << 4)
13577         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
13578                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
13579         /* TQM ring 3 page size and level. */
13580         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
13581         /* TQM ring 3 PBL indirect levels. */
13582         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
13583                 UINT32_C(0xf)
13584         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
13585         /* PBL pointer is physical start address. */
13586         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
13587                 UINT32_C(0x0)
13588         /* PBL pointer points to PTE table. */
13589         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
13590                 UINT32_C(0x1)
13591         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13592         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
13593                 UINT32_C(0x2)
13594         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
13595                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
13596         /* TQM ring 3 page size. */
13597         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
13598                 UINT32_C(0xf0)
13599         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
13600         /* 4KB. */
13601         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
13602                 (UINT32_C(0x0) << 4)
13603         /* 8KB. */
13604         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
13605                 (UINT32_C(0x1) << 4)
13606         /* 64KB. */
13607         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
13608                 (UINT32_C(0x2) << 4)
13609         /* 2MB. */
13610         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
13611                 (UINT32_C(0x3) << 4)
13612         /* 8MB. */
13613         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
13614                 (UINT32_C(0x4) << 4)
13615         /* 1GB. */
13616         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
13617                 (UINT32_C(0x5) << 4)
13618         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
13619                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
13620         /* TQM ring 4 page size and level. */
13621         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
13622         /* TQM ring 4 PBL indirect levels. */
13623         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
13624                 UINT32_C(0xf)
13625         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
13626         /* PBL pointer is physical start address. */
13627         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
13628                 UINT32_C(0x0)
13629         /* PBL pointer points to PTE table. */
13630         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
13631                 UINT32_C(0x1)
13632         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13633         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
13634                 UINT32_C(0x2)
13635         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
13636                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
13637         /* TQM ring 4 page size. */
13638         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
13639                 UINT32_C(0xf0)
13640         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
13641         /* 4KB. */
13642         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
13643                 (UINT32_C(0x0) << 4)
13644         /* 8KB. */
13645         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
13646                 (UINT32_C(0x1) << 4)
13647         /* 64KB. */
13648         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
13649                 (UINT32_C(0x2) << 4)
13650         /* 2MB. */
13651         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
13652                 (UINT32_C(0x3) << 4)
13653         /* 8MB. */
13654         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
13655                 (UINT32_C(0x4) << 4)
13656         /* 1GB. */
13657         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
13658                 (UINT32_C(0x5) << 4)
13659         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
13660                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
13661         /* TQM ring 5 page size and level. */
13662         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
13663         /* TQM ring 5 PBL indirect levels. */
13664         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
13665                 UINT32_C(0xf)
13666         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
13667         /* PBL pointer is physical start address. */
13668         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
13669                 UINT32_C(0x0)
13670         /* PBL pointer points to PTE table. */
13671         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
13672                 UINT32_C(0x1)
13673         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13674         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
13675                 UINT32_C(0x2)
13676         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
13677                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
13678         /* TQM ring 5 page size. */
13679         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
13680                 UINT32_C(0xf0)
13681         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
13682         /* 4KB. */
13683         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
13684                 (UINT32_C(0x0) << 4)
13685         /* 8KB. */
13686         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
13687                 (UINT32_C(0x1) << 4)
13688         /* 64KB. */
13689         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
13690                 (UINT32_C(0x2) << 4)
13691         /* 2MB. */
13692         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
13693                 (UINT32_C(0x3) << 4)
13694         /* 8MB. */
13695         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
13696                 (UINT32_C(0x4) << 4)
13697         /* 1GB. */
13698         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
13699                 (UINT32_C(0x5) << 4)
13700         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
13701                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
13702         /* TQM ring 6 page size and level. */
13703         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
13704         /* TQM ring 6 PBL indirect levels. */
13705         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
13706                 UINT32_C(0xf)
13707         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
13708         /* PBL pointer is physical start address. */
13709         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
13710                 UINT32_C(0x0)
13711         /* PBL pointer points to PTE table. */
13712         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
13713                 UINT32_C(0x1)
13714         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13715         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
13716                 UINT32_C(0x2)
13717         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
13718                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
13719         /* TQM ring 6 page size. */
13720         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
13721                 UINT32_C(0xf0)
13722         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
13723         /* 4KB. */
13724         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
13725                 (UINT32_C(0x0) << 4)
13726         /* 8KB. */
13727         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
13728                 (UINT32_C(0x1) << 4)
13729         /* 64KB. */
13730         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
13731                 (UINT32_C(0x2) << 4)
13732         /* 2MB. */
13733         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
13734                 (UINT32_C(0x3) << 4)
13735         /* 8MB. */
13736         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
13737                 (UINT32_C(0x4) << 4)
13738         /* 1GB. */
13739         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
13740                 (UINT32_C(0x5) << 4)
13741         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
13742                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
13743         /* TQM ring 7 page size and level. */
13744         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
13745         /* TQM ring 7 PBL indirect levels. */
13746         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
13747                 UINT32_C(0xf)
13748         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
13749         /* PBL pointer is physical start address. */
13750         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
13751                 UINT32_C(0x0)
13752         /* PBL pointer points to PTE table. */
13753         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
13754                 UINT32_C(0x1)
13755         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13756         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
13757                 UINT32_C(0x2)
13758         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
13759                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
13760         /* TQM ring 7 page size. */
13761         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
13762                 UINT32_C(0xf0)
13763         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
13764         /* 4KB. */
13765         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
13766                 (UINT32_C(0x0) << 4)
13767         /* 8KB. */
13768         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
13769                 (UINT32_C(0x1) << 4)
13770         /* 64KB. */
13771         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
13772                 (UINT32_C(0x2) << 4)
13773         /* 2MB. */
13774         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
13775                 (UINT32_C(0x3) << 4)
13776         /* 8MB. */
13777         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
13778                 (UINT32_C(0x4) << 4)
13779         /* 1GB. */
13780         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
13781                 (UINT32_C(0x5) << 4)
13782         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
13783                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
13784         /* MR/AV page size and level. */
13785         uint8_t mrav_pg_size_mrav_lvl;
13786         /* MR/AV PBL indirect levels. */
13787         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
13788                 UINT32_C(0xf)
13789         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
13790         /* PBL pointer is physical start address. */
13791         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
13792                 UINT32_C(0x0)
13793         /* PBL pointer points to PTE table. */
13794         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
13795                 UINT32_C(0x1)
13796         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13797         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
13798                 UINT32_C(0x2)
13799         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
13800                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
13801         /* MR/AV page size. */
13802         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
13803                 UINT32_C(0xf0)
13804         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
13805         /* 4KB. */
13806         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
13807                 (UINT32_C(0x0) << 4)
13808         /* 8KB. */
13809         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
13810                 (UINT32_C(0x1) << 4)
13811         /* 64KB. */
13812         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
13813                 (UINT32_C(0x2) << 4)
13814         /* 2MB. */
13815         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
13816                 (UINT32_C(0x3) << 4)
13817         /* 8MB. */
13818         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
13819                 (UINT32_C(0x4) << 4)
13820         /* 1GB. */
13821         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
13822                 (UINT32_C(0x5) << 4)
13823         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
13824                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
13825         /* Timer page size and level. */
13826         uint8_t tim_pg_size_tim_lvl;
13827         /* Timer PBL indirect levels. */
13828         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
13829                 UINT32_C(0xf)
13830         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
13831         /* PBL pointer is physical start address. */
13832         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
13833                 UINT32_C(0x0)
13834         /* PBL pointer points to PTE table. */
13835         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
13836                 UINT32_C(0x1)
13837         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
13838         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
13839                 UINT32_C(0x2)
13840         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
13841                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
13842         /* Timer page size. */
13843         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
13844                 UINT32_C(0xf0)
13845         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
13846         /* 4KB. */
13847         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
13848                 (UINT32_C(0x0) << 4)
13849         /* 8KB. */
13850         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
13851                 (UINT32_C(0x1) << 4)
13852         /* 64KB. */
13853         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
13854                 (UINT32_C(0x2) << 4)
13855         /* 2MB. */
13856         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
13857                 (UINT32_C(0x3) << 4)
13858         /* 8MB. */
13859         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
13860                 (UINT32_C(0x4) << 4)
13861         /* 1GB. */
13862         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
13863                 (UINT32_C(0x5) << 4)
13864         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
13865                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
13866         /* QP page directory. */
13867         uint64_t        qpc_page_dir;
13868         /* SRQ page directory. */
13869         uint64_t        srq_page_dir;
13870         /* CQ page directory. */
13871         uint64_t        cq_page_dir;
13872         /* VNIC page directory. */
13873         uint64_t        vnic_page_dir;
13874         /* Stat page directory. */
13875         uint64_t        stat_page_dir;
13876         /* TQM slowpath page directory. */
13877         uint64_t        tqm_sp_page_dir;
13878         /* TQM ring 0 page directory. */
13879         uint64_t        tqm_ring0_page_dir;
13880         /* TQM ring 1 page directory. */
13881         uint64_t        tqm_ring1_page_dir;
13882         /* TQM ring 2 page directory. */
13883         uint64_t        tqm_ring2_page_dir;
13884         /* TQM ring 3 page directory. */
13885         uint64_t        tqm_ring3_page_dir;
13886         /* TQM ring 4 page directory. */
13887         uint64_t        tqm_ring4_page_dir;
13888         /* TQM ring 5 page directory. */
13889         uint64_t        tqm_ring5_page_dir;
13890         /* TQM ring 6 page directory. */
13891         uint64_t        tqm_ring6_page_dir;
13892         /* TQM ring 7 page directory. */
13893         uint64_t        tqm_ring7_page_dir;
13894         /* MR/AV page directory. */
13895         uint64_t        mrav_page_dir;
13896         /* Timer page directory. */
13897         uint64_t        tim_page_dir;
13898         /* Number of entries to reserve for QP1 */
13899         uint16_t        qp_num_qp1_entries;
13900         /* Number of entries to reserve for L2 */
13901         uint16_t        qp_num_l2_entries;
13902         /* Number of QPs. */
13903         uint32_t        qp_num_entries;
13904         /* Number of SRQs. */
13905         uint32_t        srq_num_entries;
13906         /* Number of entries to reserve for L2 */
13907         uint16_t        srq_num_l2_entries;
13908         /* Number of entries to reserve for L2 */
13909         uint16_t        cq_num_l2_entries;
13910         /* Number of CQs. */
13911         uint32_t        cq_num_entries;
13912         /* Number of entries to reserve for VNIC entries */
13913         uint16_t        vnic_num_vnic_entries;
13914         /* Number of entries to reserve for Ring table entries */
13915         uint16_t        vnic_num_ring_table_entries;
13916         /* Number of Stats. */
13917         uint32_t        stat_num_entries;
13918         /* Number of TQM slowpath entries. */
13919         uint32_t        tqm_sp_num_entries;
13920         /* Number of TQM ring 0 entries. */
13921         uint32_t        tqm_ring0_num_entries;
13922         /* Number of TQM ring 1 entries. */
13923         uint32_t        tqm_ring1_num_entries;
13924         /* Number of TQM ring 2 entries. */
13925         uint32_t        tqm_ring2_num_entries;
13926         /* Number of TQM ring 3 entries. */
13927         uint32_t        tqm_ring3_num_entries;
13928         /* Number of TQM ring 4 entries. */
13929         uint32_t        tqm_ring4_num_entries;
13930         /* Number of TQM ring 5 entries. */
13931         uint32_t        tqm_ring5_num_entries;
13932         /* Number of TQM ring 6 entries. */
13933         uint32_t        tqm_ring6_num_entries;
13934         /* Number of TQM ring 7 entries. */
13935         uint32_t        tqm_ring7_num_entries;
13936         /*
13937          * If the MR/AV split reservation flag is not set, then this field
13938          * represents the total number of MR plus AV entries. For versions
13939          * of firmware that support the split reservation, when it is not
13940          * specified half of the entries will be reserved for MRs and the
13941          * other half for AVs.
13942          *
13943          * If the MR/AV split reservation flag is set, then this
13944          * field is logically divided into two 16b fields. Bits `[31:16]`
13945          * represents the `mr_num_entries` and bits `[15:0]` represents
13946          * `av_num_entries`. The granularity of these values is defined by
13947          * the `mrav_num_entries_unit` field returned by the
13948          * `backing_store_qcaps` command.
13949          */
13950         uint32_t        mrav_num_entries;
13951         /* Number of Timer entries. */
13952         uint32_t        tim_num_entries;
13953         uint8_t unused_1[7];
13954         /*
13955          * This field is used in Output records to indicate that the output
13956          * is completely written to RAM.  This field should be read as 1
13957          * to indicate that the output has been completely written.
13958          * When writing a command completion or response to an internal
13959          * processor, the order of writes has to be such that this field
13960          * is written last.
13961          */
13962         uint8_t valid;
13963 } __rte_packed;
13964
13965 /****************************
13966  * hwrm_error_recovery_qcfg *
13967  ****************************/
13968
13969
13970 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
13971 struct hwrm_error_recovery_qcfg_input {
13972         /* The HWRM command request type. */
13973         uint16_t        req_type;
13974         /*
13975          * The completion ring to send the completion event on. This should
13976          * be the NQ ID returned from the `nq_alloc` HWRM command.
13977          */
13978         uint16_t        cmpl_ring;
13979         /*
13980          * The sequence ID is used by the driver for tracking multiple
13981          * commands. This ID is treated as opaque data by the firmware and
13982          * the value is returned in the `hwrm_resp_hdr` upon completion.
13983          */
13984         uint16_t        seq_id;
13985         /*
13986          * The target ID of the command:
13987          * * 0x0-0xFFF8 - The function ID
13988          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13989          * * 0xFFFD - Reserved for user-space HWRM interface
13990          * * 0xFFFF - HWRM
13991          */
13992         uint16_t        target_id;
13993         /*
13994          * A physical address pointer pointing to a host buffer that the
13995          * command's response data will be written. This can be either a host
13996          * physical address (HPA) or a guest physical address (GPA) and must
13997          * point to a physically contiguous block of memory.
13998          */
13999         uint64_t        resp_addr;
14000         uint8_t unused_0[8];
14001 } __rte_packed;
14002
14003 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
14004 struct hwrm_error_recovery_qcfg_output {
14005         /* The specific error status for the command. */
14006         uint16_t        error_code;
14007         /* The HWRM command request type. */
14008         uint16_t        req_type;
14009         /* The sequence ID from the original command. */
14010         uint16_t        seq_id;
14011         /* The length of the response data in number of bytes. */
14012         uint16_t        resp_len;
14013         uint32_t        flags;
14014         /*
14015          * When this flag is set to 1, error recovery will be initiated
14016          * through master function driver.
14017          */
14018         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST       UINT32_C(0x1)
14019         /*
14020          * When this flag is set to 1, error recovery will be performed
14021          * through Co processor.
14022          */
14023         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU     UINT32_C(0x2)
14024         /*
14025          * Driver Polling frequency. This value is in units of 100msec.
14026          * Typical value would be 10 to indicate 1sec.
14027          * Drivers can poll FW health status, Heartbeat, reset_counter with
14028          * this frequency.
14029          */
14030         uint32_t        driver_polling_freq;
14031         /*
14032          * This value is in units of 100msec.
14033          * Typical value would be 30 to indicate 3sec.
14034          * Master function wait period from detecting a fatal error to
14035          * initiating reset. In this time period Master PF expects every
14036          * active driver will detect fatal error.
14037          */
14038         uint32_t        master_func_wait_period;
14039         /*
14040          * This value is in units of 100msec.
14041          * Typical value would be 50 to indicate 5sec.
14042          * Normal function wait period from fatal error detection to
14043          * polling FW health status. In this time period, drivers should not
14044          * do any PCIe MMIO transaction and should not send any HWRM commands.
14045          */
14046         uint32_t        normal_func_wait_period;
14047         /*
14048          * This value is in units of 100msec.
14049          * Typical value would be 20 to indicate 2sec.
14050          * This field indicates that, master function wait period after chip
14051          * reset. After this time, master function should reinitialize with
14052          * FW.
14053          */
14054         uint32_t        master_func_wait_period_after_reset;
14055         /*
14056          * This value is in units of 100msec.
14057          * Typical value would be 60 to indicate 6sec.
14058          * This field is applicable to both master and normal functions.
14059          * Even after chip reset, if FW status not changed to ready,
14060          * then all the functions can poll for this much time and bailout.
14061          */
14062         uint32_t        max_bailout_time_after_reset;
14063         /*
14064          * FW health status register.
14065          * Lower 2 bits indicates address space location and upper 30 bits
14066          * indicates upper 30bits of the register address.
14067          * A value of 0xFFFF-FFFF indicates this register does not exist.
14068          */
14069         uint32_t        fw_health_status_reg;
14070         /* Lower 2 bits indicates address space location. */
14071         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK \
14072                 UINT32_C(0x3)
14073         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT \
14074                 0
14075         /*
14076          * If value is 0, this register is located in PCIe config space.
14077          * Drivers have to map appropriate window to access this
14078          * register.
14079          */
14080         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG \
14081                 UINT32_C(0x0)
14082         /*
14083          * If value is 1, this register is located in GRC address space.
14084          * Drivers have to map appropriate window to access this
14085          * register.
14086          */
14087         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC \
14088                 UINT32_C(0x1)
14089         /*
14090          * If value is 2, this register is located in first BAR address
14091          * space. Drivers have to map appropriate window to access this
14092          * register.
14093          */
14094         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0 \
14095                 UINT32_C(0x2)
14096         /*
14097          * If value is 3, this register is located in second BAR address
14098          * space. Drivers have to map appropriate window to access this
14099          * Drivers have to map appropriate window to access this
14100          * register.
14101          */
14102         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 \
14103                 UINT32_C(0x3)
14104         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST \
14105                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
14106         /* Upper 30bits of the register address. */
14107         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK \
14108                 UINT32_C(0xfffffffc)
14109         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT \
14110                 2
14111         /*
14112          * FW HeartBeat register.
14113          * Lower 2 bits indicates address space location and upper 30 bits
14114          * indicates actual address.
14115          * A value of 0xFFFF-FFFF indicates this register does not exist.
14116          */
14117         uint32_t        fw_heartbeat_reg;
14118         /* Lower 2 bits indicates address space location. */
14119         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK \
14120                 UINT32_C(0x3)
14121         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT \
14122                 0
14123         /*
14124          * If value is 0, this register is located in PCIe config space.
14125          * Drivers have to map appropriate window to access this
14126          * register.
14127          */
14128         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG \
14129                 UINT32_C(0x0)
14130         /*
14131          * If value is 1, this register is located in GRC address space.
14132          * Drivers have to map appropriate window to access this
14133          * register.
14134          */
14135         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC \
14136                 UINT32_C(0x1)
14137         /*
14138          * If value is 2, this register is located in first BAR address
14139          * space. Drivers have to map appropriate window to access this
14140          * register.
14141          */
14142         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 \
14143                 UINT32_C(0x2)
14144         /*
14145          * If value is 3, this register is located in second BAR address
14146          * space. Drivers have to map appropriate window to access this
14147          * register.
14148          */
14149         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 \
14150                 UINT32_C(0x3)
14151         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST \
14152                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
14153         /* Upper 30bits of the register address. */
14154         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK \
14155                 UINT32_C(0xfffffffc)
14156         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT \
14157                 2
14158         /*
14159          * FW reset counter.
14160          * Lower 2 bits indicates address space location and upper 30 bits
14161          * indicates actual address.
14162          * A value of 0xFFFF-FFFF indicates this register does not exist.
14163          */
14164         uint32_t        fw_reset_cnt_reg;
14165         /* Lower 2 bits indicates address space location. */
14166         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK \
14167                 UINT32_C(0x3)
14168         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT \
14169                 0
14170         /*
14171          * If value is 0, this register is located in PCIe config space.
14172          * Drivers have to map appropriate window to access this
14173          * register.
14174          */
14175         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG \
14176                 UINT32_C(0x0)
14177         /*
14178          * If value is 1, this register is located in GRC address space.
14179          * Drivers have to map appropriate window to access this
14180          * register.
14181          */
14182         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC \
14183                 UINT32_C(0x1)
14184         /*
14185          * If value is 2, this register is located in first BAR address
14186          * space. Drivers have to map appropriate window to access this
14187          * register.
14188          */
14189         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 \
14190                 UINT32_C(0x2)
14191         /*
14192          * If value is 3, this register is located in second BAR address
14193          * space. Drivers have to map appropriate window to access this
14194          * register.
14195          */
14196         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 \
14197                 UINT32_C(0x3)
14198         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST \
14199                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
14200         /* Upper 30bits of the register address. */
14201         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK \
14202                 UINT32_C(0xfffffffc)
14203         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT \
14204                 2
14205         /*
14206          * Reset Inprogress Register address for PFs.
14207          * Lower 2 bits indicates address space location and upper 30 bits
14208          * indicates actual address.
14209          * A value of 0xFFFF-FFFF indicates this register does not exist.
14210          */
14211         uint32_t        reset_inprogress_reg;
14212         /* Lower 2 bits indicates address space location. */
14213         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK \
14214                 UINT32_C(0x3)
14215         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT \
14216                 0
14217         /*
14218          * If value is 0, this register is located in PCIe config space.
14219          * Drivers have to map appropriate window to access this
14220          * register.
14221          */
14222         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG \
14223                 UINT32_C(0x0)
14224         /*
14225          * If value is 1, this register is located in GRC address space.
14226          * Drivers have to map appropriate window to access this
14227          * register.
14228          */
14229         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC \
14230                 UINT32_C(0x1)
14231         /*
14232          * If value is 2, this register is located in first BAR address
14233          * space. Drivers have to map appropriate window to access this
14234          * register.
14235          */
14236         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 \
14237                 UINT32_C(0x2)
14238         /*
14239          * If value is 3, this register is located in second BAR address
14240          * space. Drivers have to map appropriate window to access this
14241          * register.
14242          */
14243         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 \
14244                 UINT32_C(0x3)
14245         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST \
14246                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
14247         /* Upper 30bits of the register address. */
14248         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK \
14249                 UINT32_C(0xfffffffc)
14250         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT \
14251                 2
14252         /* This field indicates the mask value for reset_inprogress_reg. */
14253         uint32_t        reset_inprogress_reg_mask;
14254         uint8_t unused_0[3];
14255         /*
14256          * Array of registers and value count to reset the Chip
14257          * Each array count has reset_reg, reset_reg_val, delay_after_reset
14258          * in TLV format. Depending upon Chip type, number of reset registers
14259          * will vary. Drivers have to write reset_reg_val in the reset_reg
14260          * location in the same sequence in order to recover from a fatal
14261          * error.
14262          */
14263         uint8_t reg_array_cnt;
14264         /*
14265          * Reset register.
14266          * Lower 2 bits indicates address space location and upper 30 bits
14267          * indicates actual address.
14268          * A value of 0xFFFF-FFFF indicates this register does not exist.
14269          */
14270         uint32_t        reset_reg[16];
14271         /* Lower 2 bits indicates address space location. */
14272         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK \
14273                 UINT32_C(0x3)
14274         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT     0
14275         /*
14276          * If value is 0, this register is located in PCIe config space.
14277          * Drivers have to map appropriate window to access this
14278          * register.
14279          */
14280         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG \
14281                 UINT32_C(0x0)
14282         /*
14283          * If value is 1, this register is located in GRC address space.
14284          * Drivers have to map appropriate window to access this
14285          * register.
14286          */
14287         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC \
14288                 UINT32_C(0x1)
14289         /*
14290          * If value is 2, this register is located in first BAR address
14291          * space. Drivers have to map appropriate window to access this
14292          * register.
14293          */
14294         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 \
14295                 UINT32_C(0x2)
14296         /*
14297          * If value is 3, this register is located in second BAR address
14298          * space. Drivers have to map appropriate window to access this
14299          * register.
14300          */
14301         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 \
14302                 UINT32_C(0x3)
14303         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST \
14304                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
14305         /* Upper 30bits of the register address. */
14306         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK \
14307                 UINT32_C(0xfffffffc)
14308         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT           2
14309         /* Value to be written in reset_reg to reset the controller. */
14310         uint32_t        reset_reg_val[16];
14311         /*
14312          * This value is in units of 1msec.
14313          * Typical value would be 10 to indicate 10msec.
14314          * Some of the operations like Core reset require delay before
14315          * accessing PCIE MMIO register space.
14316          * If this value is non-zero, drivers have to wait for
14317          * this much time after writing reset_reg_val in reset_reg.
14318          */
14319         uint8_t delay_after_reset[16];
14320         /*
14321          * Error recovery counter.
14322          * Lower 2 bits indicates address space location and upper 30 bits
14323          * indicates actual address.
14324          * A value of 0xFFFF-FFFF indicates this register does not exist.
14325          */
14326         uint32_t        err_recovery_cnt_reg;
14327         /* Lower 2 bits indicates address space location. */
14328         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_MASK \
14329                 UINT32_C(0x3)
14330         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_SFT \
14331                 0
14332         /*
14333          * If value is 0, this register is located in PCIe config space.
14334          * Drivers have to map appropriate window to access this
14335          * register.
14336          */
14337         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_PCIE_CFG \
14338                 UINT32_C(0x0)
14339         /*
14340          * If value is 1, this register is located in GRC address space.
14341          * Drivers have to map appropriate window to access this
14342          * register.
14343          */
14344         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_GRC \
14345                 UINT32_C(0x1)
14346         /*
14347          * If value is 2, this register is located in first BAR address
14348          * space. Drivers have to map appropriate window to access this
14349          * register.
14350          */
14351         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR0 \
14352                 UINT32_C(0x2)
14353         /*
14354          * If value is 3, this register is located in second BAR address
14355          * space. Drivers have to map appropriate window to access this
14356          * register.
14357          */
14358         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1 \
14359                 UINT32_C(0x3)
14360         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_LAST \
14361                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1
14362         /* Upper 30bits of the register address. */
14363         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_MASK \
14364                 UINT32_C(0xfffffffc)
14365         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SFT \
14366                 2
14367         uint8_t unused_1[3];
14368         /*
14369          * This field is used in Output records to indicate that the output
14370          * is completely written to RAM.  This field should be read as '1'
14371          * to indicate that the output has been completely written.
14372          * When writing a command completion or response to an internal
14373          * processor, the order of writes has to be such that this field
14374          * is written last.
14375          */
14376         uint8_t valid;
14377 } __rte_packed;
14378
14379 /***********************
14380  * hwrm_func_vlan_qcfg *
14381  ***********************/
14382
14383
14384 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
14385 struct hwrm_func_vlan_qcfg_input {
14386         /* The HWRM command request type. */
14387         uint16_t        req_type;
14388         /*
14389          * The completion ring to send the completion event on. This should
14390          * be the NQ ID returned from the `nq_alloc` HWRM command.
14391          */
14392         uint16_t        cmpl_ring;
14393         /*
14394          * The sequence ID is used by the driver for tracking multiple
14395          * commands. This ID is treated as opaque data by the firmware and
14396          * the value is returned in the `hwrm_resp_hdr` upon completion.
14397          */
14398         uint16_t        seq_id;
14399         /*
14400          * The target ID of the command:
14401          * * 0x0-0xFFF8 - The function ID
14402          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14403          * * 0xFFFD - Reserved for user-space HWRM interface
14404          * * 0xFFFF - HWRM
14405          */
14406         uint16_t        target_id;
14407         /*
14408          * A physical address pointer pointing to a host buffer that the
14409          * command's response data will be written. This can be either a host
14410          * physical address (HPA) or a guest physical address (GPA) and must
14411          * point to a physically contiguous block of memory.
14412          */
14413         uint64_t        resp_addr;
14414         /*
14415          * Function ID of the function that is being
14416          * configured.
14417          * If set to 0xFF... (All Fs), then the configuration is
14418          * for the requesting function.
14419          */
14420         uint16_t        fid;
14421         uint8_t unused_0[6];
14422 } __rte_packed;
14423
14424 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
14425 struct hwrm_func_vlan_qcfg_output {
14426         /* The specific error status for the command. */
14427         uint16_t        error_code;
14428         /* The HWRM command request type. */
14429         uint16_t        req_type;
14430         /* The sequence ID from the original command. */
14431         uint16_t        seq_id;
14432         /* The length of the response data in number of bytes. */
14433         uint16_t        resp_len;
14434         uint64_t        unused_0;
14435         /* S-TAG VLAN identifier configured for the function. */
14436         uint16_t        stag_vid;
14437         /* S-TAG PCP value configured for the function. */
14438         uint8_t stag_pcp;
14439         uint8_t unused_1;
14440         /*
14441          * S-TAG TPID value configured for the function. This field is specified in
14442          * network byte order.
14443          */
14444         uint16_t        stag_tpid;
14445         /* C-TAG VLAN identifier configured for the function. */
14446         uint16_t        ctag_vid;
14447         /* C-TAG PCP value configured for the function. */
14448         uint8_t ctag_pcp;
14449         uint8_t unused_2;
14450         /*
14451          * C-TAG TPID value configured for the function. This field is specified in
14452          * network byte order.
14453          */
14454         uint16_t        ctag_tpid;
14455         /* Future use. */
14456         uint32_t        rsvd2;
14457         /* Future use. */
14458         uint32_t        rsvd3;
14459         uint8_t unused_3[3];
14460         /*
14461          * This field is used in Output records to indicate that the output
14462          * is completely written to RAM.  This field should be read as '1'
14463          * to indicate that the output has been completely written.
14464          * When writing a command completion or response to an internal processor,
14465          * the order of writes has to be such that this field is written last.
14466          */
14467         uint8_t valid;
14468 } __rte_packed;
14469
14470 /**********************
14471  * hwrm_func_vlan_cfg *
14472  **********************/
14473
14474
14475 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
14476 struct hwrm_func_vlan_cfg_input {
14477         /* The HWRM command request type. */
14478         uint16_t        req_type;
14479         /*
14480          * The completion ring to send the completion event on. This should
14481          * be the NQ ID returned from the `nq_alloc` HWRM command.
14482          */
14483         uint16_t        cmpl_ring;
14484         /*
14485          * The sequence ID is used by the driver for tracking multiple
14486          * commands. This ID is treated as opaque data by the firmware and
14487          * the value is returned in the `hwrm_resp_hdr` upon completion.
14488          */
14489         uint16_t        seq_id;
14490         /*
14491          * The target ID of the command:
14492          * * 0x0-0xFFF8 - The function ID
14493          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14494          * * 0xFFFD - Reserved for user-space HWRM interface
14495          * * 0xFFFF - HWRM
14496          */
14497         uint16_t        target_id;
14498         /*
14499          * A physical address pointer pointing to a host buffer that the
14500          * command's response data will be written. This can be either a host
14501          * physical address (HPA) or a guest physical address (GPA) and must
14502          * point to a physically contiguous block of memory.
14503          */
14504         uint64_t        resp_addr;
14505         /*
14506          * Function ID of the function that is being
14507          * configured.
14508          * If set to 0xFF... (All Fs), then the configuration is
14509          * for the requesting function.
14510          */
14511         uint16_t        fid;
14512         uint8_t unused_0[2];
14513         uint32_t        enables;
14514         /*
14515          * This bit must be '1' for the stag_vid field to be
14516          * configured.
14517          */
14518         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
14519         /*
14520          * This bit must be '1' for the ctag_vid field to be
14521          * configured.
14522          */
14523         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
14524         /*
14525          * This bit must be '1' for the stag_pcp field to be
14526          * configured.
14527          */
14528         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
14529         /*
14530          * This bit must be '1' for the ctag_pcp field to be
14531          * configured.
14532          */
14533         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
14534         /*
14535          * This bit must be '1' for the stag_tpid field to be
14536          * configured.
14537          */
14538         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
14539         /*
14540          * This bit must be '1' for the ctag_tpid field to be
14541          * configured.
14542          */
14543         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
14544         /* S-TAG VLAN identifier configured for the function. */
14545         uint16_t        stag_vid;
14546         /* S-TAG PCP value configured for the function. */
14547         uint8_t stag_pcp;
14548         uint8_t unused_1;
14549         /*
14550          * S-TAG TPID value configured for the function. This field is specified in
14551          * network byte order.
14552          */
14553         uint16_t        stag_tpid;
14554         /* C-TAG VLAN identifier configured for the function. */
14555         uint16_t        ctag_vid;
14556         /* C-TAG PCP value configured for the function. */
14557         uint8_t ctag_pcp;
14558         uint8_t unused_2;
14559         /*
14560          * C-TAG TPID value configured for the function. This field is specified in
14561          * network byte order.
14562          */
14563         uint16_t        ctag_tpid;
14564         /* Future use. */
14565         uint32_t        rsvd1;
14566         /* Future use. */
14567         uint32_t        rsvd2;
14568         uint8_t unused_3[4];
14569 } __rte_packed;
14570
14571 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
14572 struct hwrm_func_vlan_cfg_output {
14573         /* The specific error status for the command. */
14574         uint16_t        error_code;
14575         /* The HWRM command request type. */
14576         uint16_t        req_type;
14577         /* The sequence ID from the original command. */
14578         uint16_t        seq_id;
14579         /* The length of the response data in number of bytes. */
14580         uint16_t        resp_len;
14581         uint8_t unused_0[7];
14582         /*
14583          * This field is used in Output records to indicate that the output
14584          * is completely written to RAM.  This field should be read as '1'
14585          * to indicate that the output has been completely written.
14586          * When writing a command completion or response to an internal processor,
14587          * the order of writes has to be such that this field is written last.
14588          */
14589         uint8_t valid;
14590 } __rte_packed;
14591
14592 /*******************************
14593  * hwrm_func_vf_vnic_ids_query *
14594  *******************************/
14595
14596
14597 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
14598 struct hwrm_func_vf_vnic_ids_query_input {
14599         /* The HWRM command request type. */
14600         uint16_t        req_type;
14601         /*
14602          * The completion ring to send the completion event on. This should
14603          * be the NQ ID returned from the `nq_alloc` HWRM command.
14604          */
14605         uint16_t        cmpl_ring;
14606         /*
14607          * The sequence ID is used by the driver for tracking multiple
14608          * commands. This ID is treated as opaque data by the firmware and
14609          * the value is returned in the `hwrm_resp_hdr` upon completion.
14610          */
14611         uint16_t        seq_id;
14612         /*
14613          * The target ID of the command:
14614          * * 0x0-0xFFF8 - The function ID
14615          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14616          * * 0xFFFD - Reserved for user-space HWRM interface
14617          * * 0xFFFF - HWRM
14618          */
14619         uint16_t        target_id;
14620         /*
14621          * A physical address pointer pointing to a host buffer that the
14622          * command's response data will be written. This can be either a host
14623          * physical address (HPA) or a guest physical address (GPA) and must
14624          * point to a physically contiguous block of memory.
14625          */
14626         uint64_t        resp_addr;
14627         /*
14628          * This value is used to identify a Virtual Function (VF).
14629          * The scope of VF ID is local within a PF.
14630          */
14631         uint16_t        vf_id;
14632         uint8_t unused_0[2];
14633         /* Max number of vnic ids in vnic id table */
14634         uint32_t        max_vnic_id_cnt;
14635         /* This is the address for VF VNIC ID table */
14636         uint64_t        vnic_id_tbl_addr;
14637 } __rte_packed;
14638
14639 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
14640 struct hwrm_func_vf_vnic_ids_query_output {
14641         /* The specific error status for the command. */
14642         uint16_t        error_code;
14643         /* The HWRM command request type. */
14644         uint16_t        req_type;
14645         /* The sequence ID from the original command. */
14646         uint16_t        seq_id;
14647         /* The length of the response data in number of bytes. */
14648         uint16_t        resp_len;
14649         /*
14650          * Actual number of vnic ids
14651          *
14652          * Each VNIC ID is written as a 32-bit number.
14653          */
14654         uint32_t        vnic_id_cnt;
14655         uint8_t unused_0[3];
14656         /*
14657          * This field is used in Output records to indicate that the output
14658          * is completely written to RAM.  This field should be read as '1'
14659          * to indicate that the output has been completely written.
14660          * When writing a command completion or response to an internal processor,
14661          * the order of writes has to be such that this field is written last.
14662          */
14663         uint8_t valid;
14664 } __rte_packed;
14665
14666 /***********************
14667  * hwrm_func_vf_bw_cfg *
14668  ***********************/
14669
14670
14671 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
14672 struct hwrm_func_vf_bw_cfg_input {
14673         /* The HWRM command request type. */
14674         uint16_t        req_type;
14675         /*
14676          * The completion ring to send the completion event on. This should
14677          * be the NQ ID returned from the `nq_alloc` HWRM command.
14678          */
14679         uint16_t        cmpl_ring;
14680         /*
14681          * The sequence ID is used by the driver for tracking multiple
14682          * commands. This ID is treated as opaque data by the firmware and
14683          * the value is returned in the `hwrm_resp_hdr` upon completion.
14684          */
14685         uint16_t        seq_id;
14686         /*
14687          * The target ID of the command:
14688          * * 0x0-0xFFF8 - The function ID
14689          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14690          * * 0xFFFD - Reserved for user-space HWRM interface
14691          * * 0xFFFF - HWRM
14692          */
14693         uint16_t        target_id;
14694         /*
14695          * A physical address pointer pointing to a host buffer that the
14696          * command's response data will be written. This can be either a host
14697          * physical address (HPA) or a guest physical address (GPA) and must
14698          * point to a physically contiguous block of memory.
14699          */
14700         uint64_t        resp_addr;
14701         /*
14702          * The number of VF functions that are being configured.
14703          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
14704          */
14705         uint16_t        num_vfs;
14706         uint16_t        unused[3];
14707         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
14708         uint16_t        vfn[48];
14709         /* The physical VF id the adjustment will be made to. */
14710         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
14711         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
14712         /*
14713          * This field configures the rate scale percentage of the VF as specified
14714          * by the physical VF id.
14715          */
14716         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
14717         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
14718         /* 0% of the max tx rate */
14719         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
14720                 (UINT32_C(0x0) << 12)
14721         /* 6.66% of the max tx rate */
14722         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
14723                 (UINT32_C(0x1) << 12)
14724         /* 13.33% of the max tx rate */
14725         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
14726                 (UINT32_C(0x2) << 12)
14727         /* 20% of the max tx rate */
14728         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
14729                 (UINT32_C(0x3) << 12)
14730         /* 26.66% of the max tx rate */
14731         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
14732                 (UINT32_C(0x4) << 12)
14733         /* 33% of the max tx rate */
14734         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
14735                 (UINT32_C(0x5) << 12)
14736         /* 40% of the max tx rate */
14737         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
14738                 (UINT32_C(0x6) << 12)
14739         /* 46.66% of the max tx rate */
14740         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
14741                 (UINT32_C(0x7) << 12)
14742         /* 53.33% of the max tx rate */
14743         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
14744                 (UINT32_C(0x8) << 12)
14745         /* 60% of the max tx rate */
14746         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
14747                 (UINT32_C(0x9) << 12)
14748         /* 66.66% of the max tx rate */
14749         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
14750                 (UINT32_C(0xa) << 12)
14751         /* 53.33% of the max tx rate */
14752         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
14753                 (UINT32_C(0xb) << 12)
14754         /* 80% of the max tx rate */
14755         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
14756                 (UINT32_C(0xc) << 12)
14757         /* 86.66% of the max tx rate */
14758         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
14759                 (UINT32_C(0xd) << 12)
14760         /* 93.33% of the max tx rate */
14761         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
14762                 (UINT32_C(0xe) << 12)
14763         /* 100% of the max tx rate */
14764         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
14765                 (UINT32_C(0xf) << 12)
14766         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
14767                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
14768 } __rte_packed;
14769
14770 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
14771 struct hwrm_func_vf_bw_cfg_output {
14772         /* The specific error status for the command. */
14773         uint16_t        error_code;
14774         /* The HWRM command request type. */
14775         uint16_t        req_type;
14776         /* The sequence ID from the original command. */
14777         uint16_t        seq_id;
14778         /* The length of the response data in number of bytes. */
14779         uint16_t        resp_len;
14780         uint8_t unused_0[7];
14781         /*
14782          * This field is used in Output records to indicate that the output
14783          * is completely written to RAM.  This field should be read as '1'
14784          * to indicate that the output has been completely written.
14785          * When writing a command completion or response to an internal processor,
14786          * the order of writes has to be such that this field is written last.
14787          */
14788         uint8_t valid;
14789 } __rte_packed;
14790
14791 /************************
14792  * hwrm_func_vf_bw_qcfg *
14793  ************************/
14794
14795
14796 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
14797 struct hwrm_func_vf_bw_qcfg_input {
14798         /* The HWRM command request type. */
14799         uint16_t        req_type;
14800         /*
14801          * The completion ring to send the completion event on. This should
14802          * be the NQ ID returned from the `nq_alloc` HWRM command.
14803          */
14804         uint16_t        cmpl_ring;
14805         /*
14806          * The sequence ID is used by the driver for tracking multiple
14807          * commands. This ID is treated as opaque data by the firmware and
14808          * the value is returned in the `hwrm_resp_hdr` upon completion.
14809          */
14810         uint16_t        seq_id;
14811         /*
14812          * The target ID of the command:
14813          * * 0x0-0xFFF8 - The function ID
14814          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14815          * * 0xFFFD - Reserved for user-space HWRM interface
14816          * * 0xFFFF - HWRM
14817          */
14818         uint16_t        target_id;
14819         /*
14820          * A physical address pointer pointing to a host buffer that the
14821          * command's response data will be written. This can be either a host
14822          * physical address (HPA) or a guest physical address (GPA) and must
14823          * point to a physically contiguous block of memory.
14824          */
14825         uint64_t        resp_addr;
14826         /*
14827          * The number of VF functions that are being queried.
14828          * The inline response space allows the host to query up to 50 VFs'
14829          * rate scale percentage
14830          */
14831         uint16_t        num_vfs;
14832         uint16_t        unused[3];
14833         /* These 16-bit fields contain the VF fid */
14834         uint16_t        vfn[48];
14835         /* The physical VF id of interest */
14836         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
14837         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
14838 } __rte_packed;
14839
14840 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
14841 struct hwrm_func_vf_bw_qcfg_output {
14842         /* The specific error status for the command. */
14843         uint16_t        error_code;
14844         /* The HWRM command request type. */
14845         uint16_t        req_type;
14846         /* The sequence ID from the original command. */
14847         uint16_t        seq_id;
14848         /* The length of the response data in number of bytes. */
14849         uint16_t        resp_len;
14850         /*
14851          * The number of VF functions that are being queried.
14852          * The inline response space allows the host to query up to 50 VFs' rate
14853          * scale percentage
14854          */
14855         uint16_t        num_vfs;
14856         uint16_t        unused[3];
14857         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
14858         uint16_t        vfn[48];
14859         /* The physical VF id the adjustment will be made to. */
14860         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
14861         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
14862         /*
14863          * This field configures the rate scale percentage of the VF as specified
14864          * by the physical VF id.
14865          */
14866         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
14867         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
14868         /* 0% of the max tx rate */
14869         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
14870                 (UINT32_C(0x0) << 12)
14871         /* 6.66% of the max tx rate */
14872         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
14873                 (UINT32_C(0x1) << 12)
14874         /* 13.33% of the max tx rate */
14875         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
14876                 (UINT32_C(0x2) << 12)
14877         /* 20% of the max tx rate */
14878         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
14879                 (UINT32_C(0x3) << 12)
14880         /* 26.66% of the max tx rate */
14881         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
14882                 (UINT32_C(0x4) << 12)
14883         /* 33% of the max tx rate */
14884         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
14885                 (UINT32_C(0x5) << 12)
14886         /* 40% of the max tx rate */
14887         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
14888                 (UINT32_C(0x6) << 12)
14889         /* 46.66% of the max tx rate */
14890         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
14891                 (UINT32_C(0x7) << 12)
14892         /* 53.33% of the max tx rate */
14893         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
14894                 (UINT32_C(0x8) << 12)
14895         /* 60% of the max tx rate */
14896         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
14897                 (UINT32_C(0x9) << 12)
14898         /* 66.66% of the max tx rate */
14899         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
14900                 (UINT32_C(0xa) << 12)
14901         /* 53.33% of the max tx rate */
14902         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
14903                 (UINT32_C(0xb) << 12)
14904         /* 80% of the max tx rate */
14905         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
14906                 (UINT32_C(0xc) << 12)
14907         /* 86.66% of the max tx rate */
14908         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
14909                 (UINT32_C(0xd) << 12)
14910         /* 93.33% of the max tx rate */
14911         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
14912                 (UINT32_C(0xe) << 12)
14913         /* 100% of the max tx rate */
14914         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
14915                 (UINT32_C(0xf) << 12)
14916         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
14917                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
14918         uint8_t unused_0[7];
14919         /*
14920          * This field is used in Output records to indicate that the output
14921          * is completely written to RAM.  This field should be read as '1'
14922          * to indicate that the output has been completely written.
14923          * When writing a command completion or response to an internal processor,
14924          * the order of writes has to be such that this field is written last.
14925          */
14926         uint8_t valid;
14927 } __rte_packed;
14928
14929 /***************************
14930  * hwrm_func_drv_if_change *
14931  ***************************/
14932
14933
14934 /* hwrm_func_drv_if_change_input (size:192b/24B) */
14935 struct hwrm_func_drv_if_change_input {
14936         /* The HWRM command request type. */
14937         uint16_t        req_type;
14938         /*
14939          * The completion ring to send the completion event on. This should
14940          * be the NQ ID returned from the `nq_alloc` HWRM command.
14941          */
14942         uint16_t        cmpl_ring;
14943         /*
14944          * The sequence ID is used by the driver for tracking multiple
14945          * commands. This ID is treated as opaque data by the firmware and
14946          * the value is returned in the `hwrm_resp_hdr` upon completion.
14947          */
14948         uint16_t        seq_id;
14949         /*
14950          * The target ID of the command:
14951          * * 0x0-0xFFF8 - The function ID
14952          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14953          * * 0xFFFD - Reserved for user-space HWRM interface
14954          * * 0xFFFF - HWRM
14955          */
14956         uint16_t        target_id;
14957         /*
14958          * A physical address pointer pointing to a host buffer that the
14959          * command's response data will be written. This can be either a host
14960          * physical address (HPA) or a guest physical address (GPA) and must
14961          * point to a physically contiguous block of memory.
14962          */
14963         uint64_t        resp_addr;
14964         uint32_t        flags;
14965         /*
14966          * When this bit is '1', the function driver is indicating
14967          * that the IF state is changing to UP state.  The call should
14968          * be made at the beginning of the driver's open call before
14969          * resources are allocated.  After making the call, the driver
14970          * should check the response to see if any resources may have
14971          * changed (see the response below).  If the driver fails
14972          * the open call, the driver should make this call again with
14973          * this bit cleared to indicate that the IF state is not UP.
14974          * During the driver's close call when the IF state is changing
14975          * to DOWN, the driver should make this call with the bit cleared
14976          * after all resources have been freed.
14977          */
14978         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
14979         uint32_t        unused;
14980 } __rte_packed;
14981
14982 /* hwrm_func_drv_if_change_output (size:128b/16B) */
14983 struct hwrm_func_drv_if_change_output {
14984         /* The specific error status for the command. */
14985         uint16_t        error_code;
14986         /* The HWRM command request type. */
14987         uint16_t        req_type;
14988         /* The sequence ID from the original command. */
14989         uint16_t        seq_id;
14990         /* The length of the response data in number of bytes. */
14991         uint16_t        resp_len;
14992         uint32_t        flags;
14993         /*
14994          * When this bit is '1', it indicates that the resources reserved
14995          * for this function may have changed.  The driver should check
14996          * resource capabilities and reserve resources again before
14997          * allocating resources.
14998          */
14999         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
15000                 UINT32_C(0x1)
15001         /*
15002          * When this bit is '1', it indicates that the firmware got changed / reset.
15003          * The driver should do complete re-initialization when that bit is set.
15004          */
15005         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE \
15006                 UINT32_C(0x2)
15007         uint8_t unused_0[3];
15008         /*
15009          * This field is used in Output records to indicate that the output
15010          * is completely written to RAM.  This field should be read as '1'
15011          * to indicate that the output has been completely written.
15012          * When writing a command completion or response to an internal processor,
15013          * the order of writes has to be such that this field is written last.
15014          */
15015         uint8_t valid;
15016 } __rte_packed;
15017
15018 /*******************************
15019  * hwrm_func_host_pf_ids_query *
15020  *******************************/
15021
15022
15023 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
15024 struct hwrm_func_host_pf_ids_query_input {
15025         /* The HWRM command request type. */
15026         uint16_t        req_type;
15027         /*
15028          * The completion ring to send the completion event on. This should
15029          * be the NQ ID returned from the `nq_alloc` HWRM command.
15030          */
15031         uint16_t        cmpl_ring;
15032         /*
15033          * The sequence ID is used by the driver for tracking multiple
15034          * commands. This ID is treated as opaque data by the firmware and
15035          * the value is returned in the `hwrm_resp_hdr` upon completion.
15036          */
15037         uint16_t        seq_id;
15038         /*
15039          * The target ID of the command:
15040          * * 0x0-0xFFF8 - The function ID
15041          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15042          * * 0xFFFD - Reserved for user-space HWRM interface
15043          * * 0xFFFF - HWRM
15044          */
15045         uint16_t        target_id;
15046         /*
15047          * A physical address pointer pointing to a host buffer that the
15048          * command's response data will be written. This can be either a host
15049          * physical address (HPA) or a guest physical address (GPA) and must
15050          * point to a physically contiguous block of memory.
15051          */
15052         uint64_t        resp_addr;
15053         uint8_t host;
15054         /*
15055          * # If this bit is set to '1', the query will contain PF(s)
15056          * belongs to SOC host.
15057          */
15058         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC      UINT32_C(0x1)
15059         /*
15060          * # If this bit is set to '1', the query will contain PF(s)
15061          * belongs to EP0 host.
15062          */
15063         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0     UINT32_C(0x2)
15064         /*
15065          * # If this bit is set to '1', the query will contain PF(s)
15066          * belongs to EP1 host.
15067          */
15068         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1     UINT32_C(0x4)
15069         /*
15070          * # If this bit is set to '1', the query will contain PF(s)
15071          * belongs to EP2 host.
15072          */
15073         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2     UINT32_C(0x8)
15074         /*
15075          * # If this bit is set to '1', the query will contain PF(s)
15076          * belongs to EP3 host.
15077          */
15078         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3     UINT32_C(0x10)
15079         /*
15080          * This provides a filter of what PF(s) will be returned in the
15081          * query..
15082          */
15083         uint8_t filter;
15084         /*
15085          * all available PF(s) belong to the host(s) (defined in the
15086          * host field). This includes the hidden PFs.
15087          */
15088         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
15089         /*
15090          * all available PF(s) belong to the host(s) (defined in the
15091          * host field) that is available for L2 traffic.
15092          */
15093         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
15094         /*
15095          * all available PF(s) belong to the host(s) (defined in the
15096          * host field) that is available for ROCE traffic.
15097          */
15098         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
15099         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
15100                 HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
15101         uint8_t unused_1[6];
15102 } __rte_packed;
15103
15104 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
15105 struct hwrm_func_host_pf_ids_query_output {
15106         /* The specific error status for the command. */
15107         uint16_t        error_code;
15108         /* The HWRM command request type. */
15109         uint16_t        req_type;
15110         /* The sequence ID from the original command. */
15111         uint16_t        seq_id;
15112         /* The length of the response data in number of bytes. */
15113         uint16_t        resp_len;
15114         /* This provides the first PF ID of the device. */
15115         uint16_t        first_pf_id;
15116         uint16_t        pf_ordinal_mask;
15117         /*
15118          * When this bit is '1', it indicates first PF belongs to one of
15119          * the hosts defined in the input request.
15120          */
15121         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 \
15122                 UINT32_C(0x1)
15123         /*
15124          * When this bit is '1', it indicates 2nd PF belongs to one of the
15125          * hosts defined in the input request.
15126          */
15127         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 \
15128                 UINT32_C(0x2)
15129         /*
15130          * When this bit is '1', it indicates 3rd PF belongs to one of the
15131          * hosts defined in the input request.
15132          */
15133         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 \
15134                 UINT32_C(0x4)
15135         /*
15136          * When this bit is '1', it indicates 4th PF belongs to one of the
15137          * hosts defined in the input request.
15138          */
15139         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 \
15140                 UINT32_C(0x8)
15141         /*
15142          * When this bit is '1', it indicates 5th PF belongs to one of the
15143          * hosts defined in the input request.
15144          */
15145         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 \
15146                 UINT32_C(0x10)
15147         /*
15148          * When this bit is '1', it indicates 6th PF belongs to one of the
15149          * hosts defined in the input request.
15150          */
15151         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 \
15152                 UINT32_C(0x20)
15153         /*
15154          * When this bit is '1', it indicates 7th PF belongs to one of the
15155          * hosts defined in the input request.
15156          */
15157         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 \
15158                 UINT32_C(0x40)
15159         /*
15160          * When this bit is '1', it indicates 8th PF belongs to one of the
15161          * hosts defined in the input request.
15162          */
15163         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 \
15164                 UINT32_C(0x80)
15165         /*
15166          * When this bit is '1', it indicates 9th PF belongs to one of the
15167          * hosts defined in the input request.
15168          */
15169         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 \
15170                 UINT32_C(0x100)
15171         /*
15172          * When this bit is '1', it indicates 10th PF belongs to one of the
15173          * hosts defined in the input request.
15174          */
15175         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 \
15176                 UINT32_C(0x200)
15177         /*
15178          * When this bit is '1', it indicates 11th PF belongs to one of the
15179          * hosts defined in the input request.
15180          */
15181         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 \
15182                 UINT32_C(0x400)
15183         /*
15184          * When this bit is '1', it indicates 12th PF belongs to one of the
15185          * hosts defined in the input request.
15186          */
15187         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 \
15188                 UINT32_C(0x800)
15189         /*
15190          * When this bit is '1', it indicates 13th PF belongs to one of the
15191          * hosts defined in the input request.
15192          */
15193         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 \
15194                 UINT32_C(0x1000)
15195         /*
15196          * When this bit is '1', it indicates 14th PF belongs to one of the
15197          * hosts defined in the input request.
15198          */
15199         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 \
15200                 UINT32_C(0x2000)
15201         /*
15202          * When this bit is '1', it indicates 15th PF belongs to one of the
15203          * hosts defined in the input request.
15204          */
15205         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 \
15206                 UINT32_C(0x4000)
15207         /*
15208          * When this bit is '1', it indicates 16th PF belongs to one of the
15209          * hosts defined in the input request.
15210          */
15211         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 \
15212                 UINT32_C(0x8000)
15213         uint8_t unused_1[3];
15214         /*
15215          * This field is used in Output records to indicate that the output
15216          * is completely written to RAM.  This field should be read as '1'
15217          * to indicate that the output has been completely written.
15218          * When writing a command completion or response to an internal processor,
15219          * the order of writes has to be such that this field is written last.
15220          */
15221         uint8_t valid;
15222 } __rte_packed;
15223
15224 /*********************
15225  * hwrm_port_phy_cfg *
15226  *********************/
15227
15228
15229 /* hwrm_port_phy_cfg_input (size:448b/56B) */
15230 struct hwrm_port_phy_cfg_input {
15231         /* The HWRM command request type. */
15232         uint16_t        req_type;
15233         /*
15234          * The completion ring to send the completion event on. This should
15235          * be the NQ ID returned from the `nq_alloc` HWRM command.
15236          */
15237         uint16_t        cmpl_ring;
15238         /*
15239          * The sequence ID is used by the driver for tracking multiple
15240          * commands. This ID is treated as opaque data by the firmware and
15241          * the value is returned in the `hwrm_resp_hdr` upon completion.
15242          */
15243         uint16_t        seq_id;
15244         /*
15245          * The target ID of the command:
15246          * * 0x0-0xFFF8 - The function ID
15247          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15248          * * 0xFFFD - Reserved for user-space HWRM interface
15249          * * 0xFFFF - HWRM
15250          */
15251         uint16_t        target_id;
15252         /*
15253          * A physical address pointer pointing to a host buffer that the
15254          * command's response data will be written. This can be either a host
15255          * physical address (HPA) or a guest physical address (GPA) and must
15256          * point to a physically contiguous block of memory.
15257          */
15258         uint64_t        resp_addr;
15259         uint32_t        flags;
15260         /*
15261          * When this bit is set to '1', the PHY for the port shall
15262          * be reset.
15263          *
15264          * # If this bit is set to 1, then the HWRM shall reset the
15265          * PHY after applying PHY configuration changes specified
15266          * in this command.
15267          * # In order to guarantee that PHY configuration changes
15268          * specified in this command take effect, the HWRM
15269          * client should set this flag to 1.
15270          * # If this bit is not set to 1, then the HWRM may reset
15271          * the PHY depending on the current PHY configuration and
15272          * settings specified in this command.
15273          */
15274         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
15275                 UINT32_C(0x1)
15276         /* deprecated bit.  Do not use!!! */
15277         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
15278                 UINT32_C(0x2)
15279         /*
15280          * When this bit is set to '1', and the force_pam4_link_speed
15281          * bit in the 'enables' field is '0', the link shall be forced
15282          * to the force_link_speed value.
15283          *
15284          * When this bit is set to '1', and the force_pam4_link_speed
15285          * bit in the 'enables' field is '1', the link shall be forced
15286          * to the force_pam4_link_speed value.
15287          *
15288          * When this bit is set to '1', the HWRM client should
15289          * not enable any of the auto negotiation related
15290          * fields represented by auto_XXX fields in this command.
15291          * When this bit is set to '1' and the HWRM client has
15292          * enabled a auto_XXX field in this command, then the
15293          * HWRM shall ignore the enabled auto_XXX field.
15294          *
15295          * When this bit is set to zero, the link
15296          * shall be allowed to autoneg.
15297          */
15298         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
15299                 UINT32_C(0x4)
15300         /*
15301          * When this bit is set to '1', the auto-negotiation process
15302          * shall be restarted on the link.
15303          */
15304         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
15305                 UINT32_C(0x8)
15306         /*
15307          * When this bit is set to '1', Energy Efficient Ethernet
15308          * (EEE) is requested to be enabled on this link.
15309          * If EEE is not supported on this port, then this flag
15310          * shall be ignored by the HWRM.
15311          */
15312         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
15313                 UINT32_C(0x10)
15314         /*
15315          * When this bit is set to '1', Energy Efficient Ethernet
15316          * (EEE) is requested to be disabled on this link.
15317          * If EEE is not supported on this port, then this flag
15318          * shall be ignored by the HWRM.
15319          */
15320         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
15321                 UINT32_C(0x20)
15322         /*
15323          * When this bit is set to '1' and EEE is enabled on this
15324          * link, then TX LPI is requested to be enabled on the link.
15325          * If EEE is not supported on this port, then this flag
15326          * shall be ignored by the HWRM.
15327          * If EEE is disabled on this port, then this flag shall be
15328          * ignored by the HWRM.
15329          */
15330         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
15331                 UINT32_C(0x40)
15332         /*
15333          * When this bit is set to '1' and EEE is enabled on this
15334          * link, then TX LPI is requested to be disabled on the link.
15335          * If EEE is not supported on this port, then this flag
15336          * shall be ignored by the HWRM.
15337          * If EEE is disabled on this port, then this flag shall be
15338          * ignored by the HWRM.
15339          */
15340         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
15341                 UINT32_C(0x80)
15342         /*
15343          * When set to 1, then the HWRM shall enable FEC autonegotitation
15344          * on this port if supported.  When enabled, at least one of the
15345          * FEC modes must be advertised by enabling the fec_clause_74_enable,
15346          * fec_clause_91_enable, fec_rs544_1xn_enable, or fec_rs544_2xn_enable
15347          * flag.  If none of the FEC mode is currently enabled, the HWRM
15348          * shall choose a default advertisement setting.
15349          * The default advertisement setting can be queried by calling
15350          * hwrm_port_phy_qcfg.  Note that the link speed must be
15351          * in autonegotiation mode for FEC autonegotiation to take effect.
15352          * When set to 0, then this flag shall be ignored.
15353          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
15354          * flag.
15355          */
15356         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
15357                 UINT32_C(0x100)
15358         /*
15359          * When set to 1, then the HWRM shall disable FEC autonegotiation
15360          * on this port if supported.
15361          * When set to 0, then this flag shall be ignored.
15362          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
15363          * flag.
15364          */
15365         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
15366                 UINT32_C(0x200)
15367         /*
15368          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
15369          * on this port if supported, by advertising FEC CLAUSE 74 if
15370          * FEC autonegotiation is enabled or force enabled otherwise.
15371          * When set to 0, then this flag shall be ignored.
15372          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
15373          * flag.
15374          */
15375         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
15376                 UINT32_C(0x400)
15377         /*
15378          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
15379          * on this port if supported, by not advertising FEC CLAUSE 74 if
15380          * FEC autonegotiation is enabled or force disabled otherwise.
15381          * When set to 0, then this flag shall be ignored.
15382          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
15383          * flag.
15384          */
15385         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
15386                 UINT32_C(0x800)
15387         /*
15388          * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon)
15389          * on this port if supported, by advertising FEC CLAUSE 91 if
15390          * FEC autonegotiation is enabled or force enabled otherwise.
15391          * When set to 0, then this flag shall be ignored.
15392          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
15393          * flag.
15394          */
15395         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
15396                 UINT32_C(0x1000)
15397         /*
15398          * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon)
15399          * on this port if supported, by not advertising FEC CLAUSE 91 if
15400          * FEC autonegotiation is enabled or force disabled otherwise.
15401          * When set to 0, then this flag shall be ignored.
15402          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
15403          * flag.
15404          */
15405         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
15406                 UINT32_C(0x2000)
15407         /*
15408          * When this bit is set to '1', the link shall be forced to
15409          * be taken down.
15410          *
15411          * # When this bit is set to '1", all other
15412          * command input settings related to the link speed shall
15413          * be ignored.
15414          * Once the link state is forced down, it can be
15415          * explicitly cleared from that state by setting this flag
15416          * to '0'.
15417          * # If this flag is set to '0', then the link shall be
15418          * cleared from forced down state if the link is in forced
15419          * down state.
15420          * There may be conditions (e.g. out-of-band or sideband
15421          * configuration changes for the link) outside the scope
15422          * of the HWRM implementation that may clear forced down
15423          * link state.
15424          */
15425         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
15426                 UINT32_C(0x4000)
15427         /*
15428          * When set to 1, then the HWRM shall enable FEC RS544_1XN
15429          * on this port if supported, by advertising FEC RS544_1XN if
15430          * FEC autonegotiation is enabled or force enabled otherwise.
15431          * When set to 0, then this flag shall be ignored.
15432          * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
15433          * flag.
15434          */
15435         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_ENABLE \
15436                 UINT32_C(0x8000)
15437         /*
15438          * When set to 1, then the HWRM shall disable FEC RS544_1XN
15439          * on this port if supported, by not advertising FEC RS544_1XN if
15440          * FEC autonegotiation is enabled or force disabled otherwise.
15441          * When set to 0, then this flag shall be ignored.
15442          * If FEC RS544_1XN  is not supported, then the HWRM shall ignore this
15443          * flag.
15444          */
15445         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_DISABLE \
15446                 UINT32_C(0x10000)
15447         /*
15448          * When set to 1, then the HWRM shall enable FEC RS544_2XN
15449          * on this port if supported, by advertising FEC RS544_2XN if
15450          * FEC autonegotiation is enabled or force enabled otherwise.
15451          * When set to 0, then this flag shall be ignored.
15452          * If FEC RS544_2XN is not supported, then the HWRM shall ignore this
15453          * flag.
15454          */
15455         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_2XN_ENABLE \
15456                 UINT32_C(0x20000)
15457         /*
15458          * When set to 1, then the HWRM shall disable FEC RS544_2XN
15459          * on this port if supported, by not advertising FEC RS544_2XN if
15460          * FEC autonegotiation is enabled or force disabled otherwise.
15461          * When set to 0, then this flag shall be ignored.
15462          * If FEC RS544_2XN  is not supported, then the HWRM shall ignore this
15463          * flag.
15464          */
15465         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_2XN_DISABLE \
15466                 UINT32_C(0x40000)
15467         uint32_t        enables;
15468         /*
15469          * This bit must be '1' for the auto_mode field to be
15470          * configured.
15471          */
15472         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
15473                 UINT32_C(0x1)
15474         /*
15475          * This bit must be '1' for the auto_duplex field to be
15476          * configured.
15477          */
15478         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
15479                 UINT32_C(0x2)
15480         /*
15481          * This bit must be '1' for the auto_pause field to be
15482          * configured.
15483          */
15484         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
15485                 UINT32_C(0x4)
15486         /*
15487          * This bit must be '1' for the auto_link_speed field to be
15488          * configured.
15489          */
15490         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
15491                 UINT32_C(0x8)
15492         /*
15493          * This bit must be '1' for the auto_link_speed_mask field to be
15494          * configured.
15495          */
15496         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
15497                 UINT32_C(0x10)
15498         /*
15499          * This bit must be '1' for the wirespeed field to be
15500          * configured.
15501          */
15502         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
15503                 UINT32_C(0x20)
15504         /*
15505          * This bit must be '1' for the lpbk field to be
15506          * configured.
15507          */
15508         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
15509                 UINT32_C(0x40)
15510         /*
15511          * This bit must be '1' for the preemphasis field to be
15512          * configured.
15513          */
15514         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
15515                 UINT32_C(0x80)
15516         /*
15517          * This bit must be '1' for the force_pause field to be
15518          * configured.
15519          */
15520         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
15521                 UINT32_C(0x100)
15522         /*
15523          * This bit must be '1' for the eee_link_speed_mask field to be
15524          * configured.
15525          */
15526         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
15527                 UINT32_C(0x200)
15528         /*
15529          * This bit must be '1' for the tx_lpi_timer field to be
15530          * configured.
15531          */
15532         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
15533                 UINT32_C(0x400)
15534         /* Port ID of port that is to be configured. */
15535         uint16_t        port_id;
15536         /*
15537          * This is the speed that will be used if the force
15538          * bit is '1'.  If unsupported speed is selected, an error
15539          * will be generated.
15540          */
15541         uint16_t        force_link_speed;
15542         /* 100Mb link speed */
15543         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
15544         /* 1Gb link speed */
15545         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
15546         /* 2Gb link speed */
15547         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
15548         /* 25Gb link speed */
15549         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
15550         /* 10Gb link speed */
15551         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
15552         /* 20Mb link speed */
15553         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
15554         /* 25Gb link speed */
15555         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
15556         /* 40Gb link speed */
15557         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
15558         /* 50Gb link speed */
15559         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
15560         /* 100Gb link speed */
15561         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
15562         /* 200Gb link speed */
15563         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_200GB UINT32_C(0x7d0)
15564         /* 10Mb link speed */
15565         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
15566         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
15567                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
15568         /*
15569          * This value is used to identify what autoneg mode is
15570          * used when the link speed is not being forced.
15571          */
15572         uint8_t auto_mode;
15573         /* Disable autoneg or autoneg disabled. No speeds are selected. */
15574         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
15575         /* Select all possible speeds for autoneg mode. */
15576         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
15577         /*
15578          * Select only the auto_link_speed speed for autoneg mode. This mode has
15579          * been DEPRECATED. An HWRM client should not use this mode.
15580          */
15581         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
15582         /*
15583          * Select the auto_link_speed or any speed below that speed for autoneg.
15584          * This mode has been DEPRECATED. An HWRM client should not use this mode.
15585          */
15586         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
15587         /*
15588          * Select the speeds based on the corresponding link speed mask value
15589          * that is provided.
15590          */
15591         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
15592         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
15593                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
15594         /*
15595          * This is the duplex setting that will be used if the autoneg_mode
15596          * is "one_speed" or "one_or_below".
15597          */
15598         uint8_t auto_duplex;
15599         /* Half Duplex will be requested. */
15600         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
15601         /* Full duplex will be requested. */
15602         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
15603         /* Both Half and Full dupex will be requested. */
15604         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
15605         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
15606                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
15607         /*
15608          * This value is used to configure the pause that will be
15609          * used for autonegotiation.
15610          * Add text on the usage of auto_pause and force_pause.
15611          */
15612         uint8_t auto_pause;
15613         /*
15614          * When this bit is '1', Generation of tx pause messages
15615          * has been requested. Disabled otherwise.
15616          */
15617         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
15618                 UINT32_C(0x1)
15619         /*
15620          * When this bit is '1', Reception of rx pause messages
15621          * has been requested. Disabled otherwise.
15622          */
15623         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
15624                 UINT32_C(0x2)
15625         /*
15626          * When set to 1, the advertisement of pause is enabled.
15627          *
15628          * # When the auto_mode is not set to none and this flag is
15629          * set to 1, then the auto_pause bits on this port are being
15630          * advertised and autoneg pause results are being interpreted.
15631          * # When the auto_mode is not set to none and this
15632          * flag is set to 0, the pause is forced as indicated in
15633          * force_pause, and also advertised as auto_pause bits, but
15634          * the autoneg results are not interpreted since the pause
15635          * configuration is being forced.
15636          * # When the auto_mode is set to none and this flag is set to
15637          * 1, auto_pause bits should be ignored and should be set to 0.
15638          */
15639         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
15640                 UINT32_C(0x4)
15641         uint8_t unused_0;
15642         /*
15643          * This is the speed that will be used if the autoneg_mode
15644          * is "one_speed" or "one_or_below".  If an unsupported speed
15645          * is selected, an error will be generated.
15646          */
15647         uint16_t        auto_link_speed;
15648         /* 100Mb link speed */
15649         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
15650         /* 1Gb link speed */
15651         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
15652         /* 2Gb link speed */
15653         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
15654         /* 25Gb link speed */
15655         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
15656         /* 10Gb link speed */
15657         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
15658         /* 20Mb link speed */
15659         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
15660         /* 25Gb link speed */
15661         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
15662         /* 40Gb link speed */
15663         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
15664         /* 50Gb link speed */
15665         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
15666         /* 100Gb link speed */
15667         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
15668         /* 200Gb link speed */
15669         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
15670         /* 10Mb link speed */
15671         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
15672         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
15673                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
15674         /*
15675          * This is a mask of link speeds that will be used if
15676          * autoneg_mode is "mask".  If unsupported speed is enabled
15677          * an error will be generated.
15678          */
15679         uint16_t        auto_link_speed_mask;
15680         /* 100Mb link speed (Half-duplex) */
15681         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
15682                 UINT32_C(0x1)
15683         /* 100Mb link speed (Full-duplex) */
15684         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
15685                 UINT32_C(0x2)
15686         /* 1Gb link speed (Half-duplex) */
15687         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
15688                 UINT32_C(0x4)
15689         /* 1Gb link speed (Full-duplex) */
15690         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
15691                 UINT32_C(0x8)
15692         /* 2Gb link speed */
15693         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
15694                 UINT32_C(0x10)
15695         /* 25Gb link speed */
15696         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
15697                 UINT32_C(0x20)
15698         /* 10Gb link speed */
15699         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
15700                 UINT32_C(0x40)
15701         /* 20Gb link speed */
15702         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
15703                 UINT32_C(0x80)
15704         /* 25Gb link speed */
15705         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
15706                 UINT32_C(0x100)
15707         /* 40Gb link speed */
15708         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
15709                 UINT32_C(0x200)
15710         /* 50Gb link speed */
15711         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
15712                 UINT32_C(0x400)
15713         /* 100Gb link speed */
15714         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
15715                 UINT32_C(0x800)
15716         /* 10Mb link speed (Half-duplex) */
15717         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
15718                 UINT32_C(0x1000)
15719         /* 10Mb link speed (Full-duplex) */
15720         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
15721                 UINT32_C(0x2000)
15722         /* 200Gb link speed */
15723         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_200GB \
15724                 UINT32_C(0x4000)
15725         /* This value controls the wirespeed feature. */
15726         uint8_t wirespeed;
15727         /* Wirespeed feature is disabled. */
15728         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
15729         /* Wirespeed feature is enabled. */
15730         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
15731         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
15732                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
15733         /* This value controls the loopback setting for the PHY. */
15734         uint8_t lpbk;
15735         /* No loopback is selected.  Normal operation. */
15736         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
15737         /*
15738          * The HW will be configured with local loopback such that
15739          * host data is sent back to the host without modification.
15740          */
15741         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
15742         /*
15743          * The HW will be configured with remote loopback such that
15744          * port logic will send packets back out the transmitter that
15745          * are received.
15746          */
15747         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
15748         /*
15749          * The HW will be configured with external loopback such that
15750          * host data is sent on the transmitter and based on the external
15751          * loopback connection the data will be received without modification.
15752          */
15753         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
15754         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
15755                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
15756         /*
15757          * This value is used to configure the pause that will be
15758          * used for force mode.
15759          */
15760         uint8_t force_pause;
15761         /*
15762          * When this bit is '1', Generation of tx pause messages
15763          * is supported. Disabled otherwise.
15764          */
15765         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
15766         /*
15767          * When this bit is '1', Reception of rx pause messages
15768          * is supported. Disabled otherwise.
15769          */
15770         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
15771         uint8_t unused_1;
15772         /*
15773          * This value controls the pre-emphasis to be used for the
15774          * link.  Driver should not set this value (use
15775          * enable.preemphasis = 0) unless driver is sure of setting.
15776          * Normally HWRM FW will determine proper pre-emphasis.
15777          */
15778         uint32_t        preemphasis;
15779         /*
15780          * Setting for link speed mask that is used to
15781          * advertise speeds during autonegotiation when EEE is enabled.
15782          * This field is valid only when EEE is enabled.
15783          * The speeds specified in this field shall be a subset of
15784          * speeds specified in auto_link_speed_mask.
15785          * If EEE is enabled,then at least one speed shall be provided
15786          * in this mask.
15787          */
15788         uint16_t        eee_link_speed_mask;
15789         /* Reserved */
15790         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
15791                 UINT32_C(0x1)
15792         /* 100Mb link speed (Full-duplex) */
15793         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
15794                 UINT32_C(0x2)
15795         /* Reserved */
15796         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
15797                 UINT32_C(0x4)
15798         /* 1Gb link speed (Full-duplex) */
15799         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
15800                 UINT32_C(0x8)
15801         /* Reserved */
15802         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
15803                 UINT32_C(0x10)
15804         /* Reserved */
15805         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
15806                 UINT32_C(0x20)
15807         /* 10Gb link speed */
15808         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
15809                 UINT32_C(0x40)
15810         /*
15811          * This is the speed that will be used if the force and force_pam4
15812          * bits are '1'.  If unsupported speed is selected, an error
15813          * will be generated.
15814          */
15815         uint16_t        force_pam4_link_speed;
15816         /* 50Gb link speed */
15817         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB \
15818                 UINT32_C(0x1f4)
15819         /* 100Gb link speed */
15820         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB \
15821                 UINT32_C(0x3e8)
15822         /* 200Gb link speed */
15823         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB \
15824                 UINT32_C(0x7d0)
15825         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_LAST \
15826                 HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB
15827         /*
15828          * Requested setting of TX LPI timer in microseconds.
15829          * This field is valid only when EEE is enabled and TX LPI is
15830          * enabled.
15831          */
15832         uint32_t        tx_lpi_timer;
15833         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
15834         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
15835         uint32_t        unused_3;
15836 } __rte_packed;
15837
15838 /* hwrm_port_phy_cfg_output (size:128b/16B) */
15839 struct hwrm_port_phy_cfg_output {
15840         /* The specific error status for the command. */
15841         uint16_t        error_code;
15842         /* The HWRM command request type. */
15843         uint16_t        req_type;
15844         /* The sequence ID from the original command. */
15845         uint16_t        seq_id;
15846         /* The length of the response data in number of bytes. */
15847         uint16_t        resp_len;
15848         uint8_t unused_0[7];
15849         /*
15850          * This field is used in Output records to indicate that the output
15851          * is completely written to RAM.  This field should be read as '1'
15852          * to indicate that the output has been completely written.
15853          * When writing a command completion or response to an internal processor,
15854          * the order of writes has to be such that this field is written last.
15855          */
15856         uint8_t valid;
15857 } __rte_packed;
15858
15859 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
15860 struct hwrm_port_phy_cfg_cmd_err {
15861         /*
15862          * command specific error codes that goes to
15863          * the cmd_err field in Common HWRM Error Response.
15864          */
15865         uint8_t code;
15866         /* Unknown error */
15867         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
15868         /* Unable to complete operation due to invalid speed */
15869         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
15870         /*
15871          * retry the command since the phy is not ready.
15872          * retry count is returned in opaque_0.
15873          * This is only valid for the first command and
15874          * this value will not change for successive calls.
15875          * but if a 0 is returned at any time then this should
15876          * be treated as an un recoverable failure,
15877          *
15878          * retry interval in milli seconds is returned in opaque_1.
15879          * This specifies the time that user should wait before
15880          * issuing the next port_phy_cfg command.
15881          */
15882         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
15883         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
15884                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
15885         uint8_t unused_0[7];
15886 } __rte_packed;
15887
15888 /**********************
15889  * hwrm_port_phy_qcfg *
15890  **********************/
15891
15892
15893 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
15894 struct hwrm_port_phy_qcfg_input {
15895         /* The HWRM command request type. */
15896         uint16_t        req_type;
15897         /*
15898          * The completion ring to send the completion event on. This should
15899          * be the NQ ID returned from the `nq_alloc` HWRM command.
15900          */
15901         uint16_t        cmpl_ring;
15902         /*
15903          * The sequence ID is used by the driver for tracking multiple
15904          * commands. This ID is treated as opaque data by the firmware and
15905          * the value is returned in the `hwrm_resp_hdr` upon completion.
15906          */
15907         uint16_t        seq_id;
15908         /*
15909          * The target ID of the command:
15910          * * 0x0-0xFFF8 - The function ID
15911          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15912          * * 0xFFFD - Reserved for user-space HWRM interface
15913          * * 0xFFFF - HWRM
15914          */
15915         uint16_t        target_id;
15916         /*
15917          * A physical address pointer pointing to a host buffer that the
15918          * command's response data will be written. This can be either a host
15919          * physical address (HPA) or a guest physical address (GPA) and must
15920          * point to a physically contiguous block of memory.
15921          */
15922         uint64_t        resp_addr;
15923         /* Port ID of port that is to be queried. */
15924         uint16_t        port_id;
15925         uint8_t unused_0[6];
15926 } __rte_packed;
15927
15928 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
15929 struct hwrm_port_phy_qcfg_output {
15930         /* The specific error status for the command. */
15931         uint16_t        error_code;
15932         /* The HWRM command request type. */
15933         uint16_t        req_type;
15934         /* The sequence ID from the original command. */
15935         uint16_t        seq_id;
15936         /* The length of the response data in number of bytes. */
15937         uint16_t        resp_len;
15938         /* This value indicates the current link status. */
15939         uint8_t link;
15940         /* There is no link or cable detected. */
15941         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
15942         /* There is no link, but a cable has been detected. */
15943         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
15944         /* There is a link. */
15945         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
15946         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
15947                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
15948         uint8_t unused_0;
15949         /* This value indicates the current link speed of the connection. */
15950         uint16_t        link_speed;
15951         /* 100Mb link speed */
15952         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
15953         /* 1Gb link speed */
15954         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
15955         /* 2Gb link speed */
15956         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
15957         /* 25Gb link speed */
15958         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
15959         /* 10Gb link speed */
15960         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
15961         /* 20Mb link speed */
15962         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
15963         /* 25Gb link speed */
15964         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
15965         /* 40Gb link speed */
15966         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
15967         /* 50Gb link speed */
15968         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
15969         /* 100Gb link speed */
15970         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
15971         /* 200Gb link speed */
15972         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
15973         /* 10Mb link speed */
15974         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
15975         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
15976                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
15977         /*
15978          * This value is indicates the duplex of the current
15979          * configuration.
15980          */
15981         uint8_t duplex_cfg;
15982         /* Half Duplex connection. */
15983         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
15984         /* Full duplex connection. */
15985         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
15986         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
15987                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
15988         /*
15989          * This value is used to indicate the current
15990          * pause configuration. When autoneg is enabled, this value
15991          * represents the autoneg results of pause configuration.
15992          */
15993         uint8_t pause;
15994         /*
15995          * When this bit is '1', Generation of tx pause messages
15996          * is supported. Disabled otherwise.
15997          */
15998         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
15999         /*
16000          * When this bit is '1', Reception of rx pause messages
16001          * is supported. Disabled otherwise.
16002          */
16003         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
16004         /*
16005          * The supported speeds for the port. This is a bit mask.
16006          * For each speed that is supported, the corrresponding
16007          * bit will be set to '1'.
16008          */
16009         uint16_t        support_speeds;
16010         /* 100Mb link speed (Half-duplex) */
16011         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
16012                 UINT32_C(0x1)
16013         /* 100Mb link speed (Full-duplex) */
16014         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
16015                 UINT32_C(0x2)
16016         /* 1Gb link speed (Half-duplex) */
16017         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
16018                 UINT32_C(0x4)
16019         /* 1Gb link speed (Full-duplex) */
16020         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
16021                 UINT32_C(0x8)
16022         /* 2Gb link speed */
16023         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
16024                 UINT32_C(0x10)
16025         /* 25Gb link speed */
16026         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
16027                 UINT32_C(0x20)
16028         /* 10Gb link speed */
16029         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
16030                 UINT32_C(0x40)
16031         /* 20Gb link speed */
16032         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
16033                 UINT32_C(0x80)
16034         /* 25Gb link speed */
16035         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
16036                 UINT32_C(0x100)
16037         /* 40Gb link speed */
16038         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
16039                 UINT32_C(0x200)
16040         /* 50Gb link speed */
16041         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
16042                 UINT32_C(0x400)
16043         /* 100Gb link speed */
16044         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
16045                 UINT32_C(0x800)
16046         /* 10Mb link speed (Half-duplex) */
16047         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
16048                 UINT32_C(0x1000)
16049         /* 10Mb link speed (Full-duplex) */
16050         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
16051                 UINT32_C(0x2000)
16052         /* 200Gb link speed */
16053         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_200GB \
16054                 UINT32_C(0x4000)
16055         /*
16056          * Current setting of forced link speed.
16057          * When the link speed is not being forced, this
16058          * value shall be set to 0.
16059          */
16060         uint16_t        force_link_speed;
16061         /* 100Mb link speed */
16062         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
16063         /* 1Gb link speed */
16064         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
16065         /* 2Gb link speed */
16066         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
16067         /* 25Gb link speed */
16068         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
16069         /* 10Gb link speed */
16070         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
16071         /* 20Mb link speed */
16072         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
16073         /* 25Gb link speed */
16074         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
16075         /* 40Gb link speed */
16076         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
16077                 UINT32_C(0x190)
16078         /* 50Gb link speed */
16079         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
16080                 UINT32_C(0x1f4)
16081         /* 100Gb link speed */
16082         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
16083                 UINT32_C(0x3e8)
16084         /* 200Gb link speed */
16085         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_200GB \
16086                 UINT32_C(0x7d0)
16087         /* 10Mb link speed */
16088         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
16089                 UINT32_C(0xffff)
16090         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
16091                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
16092         /* Current setting of auto negotiation mode. */
16093         uint8_t auto_mode;
16094         /* Disable autoneg or autoneg disabled. No speeds are selected. */
16095         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
16096         /* Select all possible speeds for autoneg mode. */
16097         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
16098         /*
16099          * Select only the auto_link_speed speed for autoneg mode. This mode has
16100          * been DEPRECATED. An HWRM client should not use this mode.
16101          */
16102         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
16103         /*
16104          * Select the auto_link_speed or any speed below that speed for autoneg.
16105          * This mode has been DEPRECATED. An HWRM client should not use this mode.
16106          */
16107         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
16108         /*
16109          * Select the speeds based on the corresponding link speed mask value
16110          * that is provided.
16111          */
16112         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
16113         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
16114                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
16115         /*
16116          * Current setting of pause autonegotiation.
16117          * Move autoneg_pause flag here.
16118          */
16119         uint8_t auto_pause;
16120         /*
16121          * When this bit is '1', Generation of tx pause messages
16122          * has been requested. Disabled otherwise.
16123          */
16124         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
16125                 UINT32_C(0x1)
16126         /*
16127          * When this bit is '1', Reception of rx pause messages
16128          * has been requested. Disabled otherwise.
16129          */
16130         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
16131                 UINT32_C(0x2)
16132         /*
16133          * When set to 1, the advertisement of pause is enabled.
16134          *
16135          * # When the auto_mode is not set to none and this flag is
16136          * set to 1, then the auto_pause bits on this port are being
16137          * advertised and autoneg pause results are being interpreted.
16138          * # When the auto_mode is not set to none and this
16139          * flag is set to 0, the pause is forced as indicated in
16140          * force_pause, and also advertised as auto_pause bits, but
16141          * the autoneg results are not interpreted since the pause
16142          * configuration is being forced.
16143          * # When the auto_mode is set to none and this flag is set to
16144          * 1, auto_pause bits should be ignored and should be set to 0.
16145          */
16146         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
16147                 UINT32_C(0x4)
16148         /*
16149          * Current setting for auto_link_speed. This field is only
16150          * valid when auto_mode is set to "one_speed" or "one_or_below".
16151          */
16152         uint16_t        auto_link_speed;
16153         /* 100Mb link speed */
16154         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
16155         /* 1Gb link speed */
16156         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
16157         /* 2Gb link speed */
16158         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
16159         /* 25Gb link speed */
16160         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
16161         /* 10Gb link speed */
16162         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
16163         /* 20Mb link speed */
16164         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
16165         /* 25Gb link speed */
16166         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
16167         /* 40Gb link speed */
16168         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
16169         /* 50Gb link speed */
16170         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
16171         /* 100Gb link speed */
16172         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
16173         /* 200Gb link speed */
16174         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
16175         /* 10Mb link speed */
16176         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
16177                 UINT32_C(0xffff)
16178         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
16179                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
16180         /*
16181          * Current setting for auto_link_speed_mask that is used to
16182          * advertise speeds during autonegotiation.
16183          * This field is only valid when auto_mode is set to "mask".
16184          * The speeds specified in this field shall be a subset of
16185          * supported speeds on this port.
16186          */
16187         uint16_t        auto_link_speed_mask;
16188         /* 100Mb link speed (Half-duplex) */
16189         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
16190                 UINT32_C(0x1)
16191         /* 100Mb link speed (Full-duplex) */
16192         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
16193                 UINT32_C(0x2)
16194         /* 1Gb link speed (Half-duplex) */
16195         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
16196                 UINT32_C(0x4)
16197         /* 1Gb link speed (Full-duplex) */
16198         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
16199                 UINT32_C(0x8)
16200         /* 2Gb link speed */
16201         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
16202                 UINT32_C(0x10)
16203         /* 25Gb link speed */
16204         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
16205                 UINT32_C(0x20)
16206         /* 10Gb link speed */
16207         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
16208                 UINT32_C(0x40)
16209         /* 20Gb link speed */
16210         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
16211                 UINT32_C(0x80)
16212         /* 25Gb link speed */
16213         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
16214                 UINT32_C(0x100)
16215         /* 40Gb link speed */
16216         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
16217                 UINT32_C(0x200)
16218         /* 50Gb link speed */
16219         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
16220                 UINT32_C(0x400)
16221         /* 100Gb link speed */
16222         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
16223                 UINT32_C(0x800)
16224         /* 10Mb link speed (Half-duplex) */
16225         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
16226                 UINT32_C(0x1000)
16227         /* 10Mb link speed (Full-duplex) */
16228         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
16229                 UINT32_C(0x2000)
16230         /* 200Gb link speed */
16231         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_200GB \
16232                 UINT32_C(0x4000)
16233         /* Current setting for wirespeed. */
16234         uint8_t wirespeed;
16235         /* Wirespeed feature is disabled. */
16236         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
16237         /* Wirespeed feature is enabled. */
16238         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
16239         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
16240                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
16241         /* Current setting for loopback. */
16242         uint8_t lpbk;
16243         /* No loopback is selected.  Normal operation. */
16244         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
16245         /*
16246          * The HW will be configured with local loopback such that
16247          * host data is sent back to the host without modification.
16248          */
16249         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
16250         /*
16251          * The HW will be configured with remote loopback such that
16252          * port logic will send packets back out the transmitter that
16253          * are received.
16254          */
16255         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
16256         /*
16257          * The HW will be configured with external loopback such that
16258          * host data is sent on the transmitter and based on the external
16259          * loopback connection the data will be received without modification.
16260          */
16261         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
16262         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
16263                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
16264         /*
16265          * Current setting of forced pause.
16266          * When the pause configuration is not being forced, then
16267          * this value shall be set to 0.
16268          */
16269         uint8_t force_pause;
16270         /*
16271          * When this bit is '1', Generation of tx pause messages
16272          * is supported. Disabled otherwise.
16273          */
16274         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
16275         /*
16276          * When this bit is '1', Reception of rx pause messages
16277          * is supported. Disabled otherwise.
16278          */
16279         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
16280         /*
16281          * This value indicates the current status of the optics module on
16282          * this port.
16283          */
16284         uint8_t module_status;
16285         /* Module is inserted and accepted */
16286         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
16287                 UINT32_C(0x0)
16288         /* Module is rejected and transmit side Laser is disabled. */
16289         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
16290                 UINT32_C(0x1)
16291         /* Module mismatch warning. */
16292         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
16293                 UINT32_C(0x2)
16294         /* Module is rejected and powered down. */
16295         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
16296                 UINT32_C(0x3)
16297         /* Module is not inserted. */
16298         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
16299                 UINT32_C(0x4)
16300         /* Module is powered down because of over current fault. */
16301         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT \
16302                 UINT32_C(0x5)
16303         /* Module status is not applicable. */
16304         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
16305                 UINT32_C(0xff)
16306         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
16307                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
16308         /* Current setting for preemphasis. */
16309         uint32_t        preemphasis;
16310         /* This field represents the major version of the PHY. */
16311         uint8_t phy_maj;
16312         /* This field represents the minor version of the PHY. */
16313         uint8_t phy_min;
16314         /* This field represents the build version of the PHY. */
16315         uint8_t phy_bld;
16316         /* This value represents a PHY type. */
16317         uint8_t phy_type;
16318         /* Unknown */
16319         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
16320                 UINT32_C(0x0)
16321         /* BASE-CR */
16322         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
16323                 UINT32_C(0x1)
16324         /* BASE-KR4 (Deprecated) */
16325         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
16326                 UINT32_C(0x2)
16327         /* BASE-LR */
16328         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
16329                 UINT32_C(0x3)
16330         /* BASE-SR */
16331         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
16332                 UINT32_C(0x4)
16333         /* BASE-KR2 (Deprecated) */
16334         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
16335                 UINT32_C(0x5)
16336         /* BASE-KX */
16337         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
16338                 UINT32_C(0x6)
16339         /* BASE-KR */
16340         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
16341                 UINT32_C(0x7)
16342         /* BASE-T */
16343         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
16344                 UINT32_C(0x8)
16345         /* EEE capable BASE-T */
16346         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
16347                 UINT32_C(0x9)
16348         /* SGMII connected external PHY */
16349         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
16350                 UINT32_C(0xa)
16351         /* 25G_BASECR_CA_L */
16352         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
16353                 UINT32_C(0xb)
16354         /* 25G_BASECR_CA_S */
16355         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
16356                 UINT32_C(0xc)
16357         /* 25G_BASECR_CA_N */
16358         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
16359                 UINT32_C(0xd)
16360         /* 25G_BASESR */
16361         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
16362                 UINT32_C(0xe)
16363         /* 100G_BASECR4 */
16364         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
16365                 UINT32_C(0xf)
16366         /* 100G_BASESR4 */
16367         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
16368                 UINT32_C(0x10)
16369         /* 100G_BASELR4 */
16370         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
16371                 UINT32_C(0x11)
16372         /* 100G_BASEER4 */
16373         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
16374                 UINT32_C(0x12)
16375         /* 100G_BASESR10 */
16376         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
16377                 UINT32_C(0x13)
16378         /* 40G_BASECR4 */
16379         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
16380                 UINT32_C(0x14)
16381         /* 40G_BASESR4 */
16382         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
16383                 UINT32_C(0x15)
16384         /* 40G_BASELR4 */
16385         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
16386                 UINT32_C(0x16)
16387         /* 40G_BASEER4 */
16388         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
16389                 UINT32_C(0x17)
16390         /* 40G_ACTIVE_CABLE */
16391         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
16392                 UINT32_C(0x18)
16393         /* 1G_baseT */
16394         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
16395                 UINT32_C(0x19)
16396         /* 1G_baseSX */
16397         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
16398                 UINT32_C(0x1a)
16399         /* 1G_baseCX */
16400         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
16401                 UINT32_C(0x1b)
16402         /* 100G_BASECR4 */
16403         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
16404                 UINT32_C(0x1c)
16405         /* 100G_BASESR4 */
16406         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
16407                 UINT32_C(0x1d)
16408         /* 100G_BASELR4 */
16409         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
16410                 UINT32_C(0x1e)
16411         /* 100G_BASEER4 */
16412         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
16413                 UINT32_C(0x1f)
16414         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
16415                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
16416         /* This value represents a media type. */
16417         uint8_t media_type;
16418         /* Unknown */
16419         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
16420         /* Twisted Pair */
16421         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
16422         /* Direct Attached Copper */
16423         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
16424         /* Fiber */
16425         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
16426         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
16427                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
16428         /* This value represents a transceiver type. */
16429         uint8_t xcvr_pkg_type;
16430         /* PHY and MAC are in the same package */
16431         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
16432                 UINT32_C(0x1)
16433         /* PHY and MAC are in different packages */
16434         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
16435                 UINT32_C(0x2)
16436         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
16437                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
16438         uint8_t eee_config_phy_addr;
16439         /* This field represents PHY address. */
16440         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
16441                 UINT32_C(0x1f)
16442         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
16443         /*
16444          * This field represents flags related to EEE configuration.
16445          * These EEE configuration flags are valid only when the
16446          * auto_mode is not set to none (in other words autonegotiation
16447          * is enabled).
16448          */
16449         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
16450                 UINT32_C(0xe0)
16451         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
16452         /*
16453          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
16454          * Speeds for autoneg with EEE mode enabled
16455          * are based on eee_link_speed_mask.
16456          */
16457         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
16458                 UINT32_C(0x20)
16459         /*
16460          * This flag is valid only when eee_enabled is set to 1.
16461          *
16462          * # If eee_enabled is set to 0, then EEE mode is disabled
16463          * and this flag shall be ignored.
16464          * # If eee_enabled is set to 1 and this flag is set to 1,
16465          * then Energy Efficient Ethernet (EEE) mode is enabled
16466          * and in use.
16467          * # If eee_enabled is set to 1 and this flag is set to 0,
16468          * then Energy Efficient Ethernet (EEE) mode is enabled
16469          * but is currently not in use.
16470          */
16471         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
16472                 UINT32_C(0x40)
16473         /*
16474          * This flag is valid only when eee_enabled is set to 1.
16475          *
16476          * # If eee_enabled is set to 0, then EEE mode is disabled
16477          * and this flag shall be ignored.
16478          * # If eee_enabled is set to 1 and this flag is set to 1,
16479          * then Energy Efficient Ethernet (EEE) mode is enabled
16480          * and TX LPI is enabled.
16481          * # If eee_enabled is set to 1 and this flag is set to 0,
16482          * then Energy Efficient Ethernet (EEE) mode is enabled
16483          * but TX LPI is disabled.
16484          */
16485         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
16486                 UINT32_C(0x80)
16487         /*
16488          * When set to 1, the parallel detection is used to determine
16489          * the speed of the link partner.
16490          *
16491          * Parallel detection is used when a autonegotiation capable
16492          * device is connected to a link parter that is not capable
16493          * of autonegotiation.
16494          */
16495         uint8_t parallel_detect;
16496         /*
16497          * When set to 1, the parallel detection is used to determine
16498          * the speed of the link partner.
16499          *
16500          * Parallel detection is used when a autonegotiation capable
16501          * device is connected to a link parter that is not capable
16502          * of autonegotiation.
16503          */
16504         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
16505         /*
16506          * The advertised speeds for the port by the link partner.
16507          * Each advertised speed will be set to '1'.
16508          */
16509         uint16_t        link_partner_adv_speeds;
16510         /* 100Mb link speed (Half-duplex) */
16511         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
16512                 UINT32_C(0x1)
16513         /* 100Mb link speed (Full-duplex) */
16514         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
16515                 UINT32_C(0x2)
16516         /* 1Gb link speed (Half-duplex) */
16517         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
16518                 UINT32_C(0x4)
16519         /* 1Gb link speed (Full-duplex) */
16520         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
16521                 UINT32_C(0x8)
16522         /* 2Gb link speed */
16523         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
16524                 UINT32_C(0x10)
16525         /* 25Gb link speed */
16526         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
16527                 UINT32_C(0x20)
16528         /* 10Gb link speed */
16529         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
16530                 UINT32_C(0x40)
16531         /* 20Gb link speed */
16532         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
16533                 UINT32_C(0x80)
16534         /* 25Gb link speed */
16535         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
16536                 UINT32_C(0x100)
16537         /* 40Gb link speed */
16538         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
16539                 UINT32_C(0x200)
16540         /* 50Gb link speed */
16541         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
16542                 UINT32_C(0x400)
16543         /* 100Gb link speed */
16544         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
16545                 UINT32_C(0x800)
16546         /* 10Mb link speed (Half-duplex) */
16547         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
16548                 UINT32_C(0x1000)
16549         /* 10Mb link speed (Full-duplex) */
16550         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
16551                 UINT32_C(0x2000)
16552         /*
16553          * The advertised autoneg for the port by the link partner.
16554          * This field is deprecated and should be set to 0.
16555          */
16556         uint8_t link_partner_adv_auto_mode;
16557         /* Disable autoneg or autoneg disabled. No speeds are selected. */
16558         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
16559                 UINT32_C(0x0)
16560         /* Select all possible speeds for autoneg mode. */
16561         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
16562                 UINT32_C(0x1)
16563         /*
16564          * Select only the auto_link_speed speed for autoneg mode. This mode has
16565          * been DEPRECATED. An HWRM client should not use this mode.
16566          */
16567         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
16568                 UINT32_C(0x2)
16569         /*
16570          * Select the auto_link_speed or any speed below that speed for autoneg.
16571          * This mode has been DEPRECATED. An HWRM client should not use this mode.
16572          */
16573         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
16574                 UINT32_C(0x3)
16575         /*
16576          * Select the speeds based on the corresponding link speed mask value
16577          * that is provided.
16578          */
16579         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
16580                 UINT32_C(0x4)
16581         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
16582                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
16583         /* The advertised pause settings on the port by the link partner. */
16584         uint8_t link_partner_adv_pause;
16585         /*
16586          * When this bit is '1', Generation of tx pause messages
16587          * is supported. Disabled otherwise.
16588          */
16589         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
16590                 UINT32_C(0x1)
16591         /*
16592          * When this bit is '1', Reception of rx pause messages
16593          * is supported. Disabled otherwise.
16594          */
16595         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
16596                 UINT32_C(0x2)
16597         /*
16598          * Current setting for link speed mask that is used to
16599          * advertise speeds during autonegotiation when EEE is enabled.
16600          * This field is valid only when eee_enabled flags is set to 1.
16601          * The speeds specified in this field shall be a subset of
16602          * speeds specified in auto_link_speed_mask.
16603          */
16604         uint16_t        adv_eee_link_speed_mask;
16605         /* Reserved */
16606         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
16607                 UINT32_C(0x1)
16608         /* 100Mb link speed (Full-duplex) */
16609         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
16610                 UINT32_C(0x2)
16611         /* Reserved */
16612         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
16613                 UINT32_C(0x4)
16614         /* 1Gb link speed (Full-duplex) */
16615         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
16616                 UINT32_C(0x8)
16617         /* Reserved */
16618         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
16619                 UINT32_C(0x10)
16620         /* Reserved */
16621         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
16622                 UINT32_C(0x20)
16623         /* 10Gb link speed */
16624         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
16625                 UINT32_C(0x40)
16626         /*
16627          * Current setting for link speed mask that is advertised by
16628          * the link partner when EEE is enabled.
16629          * This field is valid only when eee_enabled flags is set to 1.
16630          */
16631         uint16_t        link_partner_adv_eee_link_speed_mask;
16632         /* Reserved */
16633         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
16634                 UINT32_C(0x1)
16635         /* 100Mb link speed (Full-duplex) */
16636         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
16637                 UINT32_C(0x2)
16638         /* Reserved */
16639         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
16640                 UINT32_C(0x4)
16641         /* 1Gb link speed (Full-duplex) */
16642         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
16643                 UINT32_C(0x8)
16644         /* Reserved */
16645         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
16646                 UINT32_C(0x10)
16647         /* Reserved */
16648         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
16649                 UINT32_C(0x20)
16650         /* 10Gb link speed */
16651         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
16652                 UINT32_C(0x40)
16653         uint32_t        xcvr_identifier_type_tx_lpi_timer;
16654         /*
16655          * Current setting of TX LPI timer in microseconds.
16656          * This field is valid only when_eee_enabled flag is set to 1
16657          * and tx_lpi_enabled is set to 1.
16658          */
16659         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
16660                 UINT32_C(0xffffff)
16661         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
16662         /* This value represents transceiver identifier type. */
16663         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
16664                 UINT32_C(0xff000000)
16665         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
16666         /* Unknown */
16667         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
16668                 (UINT32_C(0x0) << 24)
16669         /* SFP/SFP+/SFP28 */
16670         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
16671                 (UINT32_C(0x3) << 24)
16672         /* QSFP+ */
16673         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
16674                 (UINT32_C(0xc) << 24)
16675         /* QSFP+ */
16676         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
16677                 (UINT32_C(0xd) << 24)
16678         /* QSFP28 */
16679         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
16680                 (UINT32_C(0x11) << 24)
16681         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
16682                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
16683         /*
16684          * This value represents the current configuration of
16685          * Forward Error Correction (FEC) on the port.
16686          */
16687         uint16_t        fec_cfg;
16688         /*
16689          * When set to 1, then FEC is not supported on this port. If this flag
16690          * is set to 1, then all other FEC configuration flags shall be ignored.
16691          * When set to 0, then FEC is supported as indicated by other
16692          * configuration flags.
16693          */
16694         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
16695                 UINT32_C(0x1)
16696         /*
16697          * When set to 1, then FEC autonegotiation is supported on this port.
16698          * When set to 0, then FEC autonegotiation is not supported on this port.
16699          */
16700         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
16701                 UINT32_C(0x2)
16702         /*
16703          * When set to 1, then FEC autonegotiation is enabled on this port.
16704          * When set to 0, then FEC autonegotiation is disabled if supported.
16705          * This flag should be ignored if FEC autonegotiation is not supported on this port.
16706          */
16707         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
16708                 UINT32_C(0x4)
16709         /*
16710          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
16711          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
16712          */
16713         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
16714                 UINT32_C(0x8)
16715         /*
16716          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
16717          * port. This means that FEC CLAUSE 74 is either advertised if
16718          * FEC autonegotiation is enabled or FEC CLAUSE 74 is force enabled.
16719          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
16720          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
16721          */
16722         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
16723                 UINT32_C(0x10)
16724         /*
16725          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port.
16726          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port.
16727          */
16728         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
16729                 UINT32_C(0x20)
16730         /*
16731          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this
16732          * port. This means that FEC CLAUSE 91 is either advertised if
16733          * FEC autonegotiation is enabled or FEC CLAUSE 91 is force enabled.
16734          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported.
16735          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
16736          */
16737         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
16738                 UINT32_C(0x40)
16739         /*
16740          * When set to 1, then FEC RS544_1XN is supported on this port.
16741          * When set to 0, then FEC RS544_1XN is not supported on this port.
16742          */
16743         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_SUPPORTED \
16744                 UINT32_C(0x80)
16745         /*
16746          * When set to 1, then RS544_1XN is enabled on this
16747          * port. This means that FEC RS544_1XN is either advertised if
16748          * FEC autonegotiation is enabled or FEC RS544_1XN is force enabled.
16749          * When set to 0, then FEC RS544_1XN is disabled if supported.
16750          * This flag should be ignored if FEC RS544_1XN is not supported on this port.
16751          */
16752         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ENABLED \
16753                 UINT32_C(0x100)
16754         /*
16755          * When set to 1, then FEC RS544_2XN is supported on this port.
16756          * When set to 0, then FEC RS544_2XN is not supported on this port.
16757          */
16758         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_2XN_SUPPORTED \
16759                 UINT32_C(0x200)
16760         /*
16761          * When set to 1, then RS544_2XN is enabled on this
16762          * port. This means that FEC RS544_2XN is either advertised if
16763          * FEC autonegotiation is enabled or FEC RS544_2XN is force enabled.
16764          * When set to 0, then FEC RS544_2XN is disabled if supported.
16765          * This flag should be ignored if FEC RS544_2XN is not supported on this port.
16766          */
16767         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_2XN_ENABLED \
16768                 UINT32_C(0x400)
16769         /*
16770          * When set to 1, then FEC CLAUSE 74 (Fire Code) is active on this
16771          * port, either successfully autonegoatiated or forced.
16772          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not active.
16773          * This flag is only valid when link is up on this port.
16774          * At most only one active FEC flags (fec_clause74_active,
16775          * fec_clause91_active, fec_rs544_1xn, fec_rs544_2xn) can be set.
16776          */
16777         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ACTIVE \
16778                 UINT32_C(0x800)
16779         /*
16780          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is active on this
16781          * port, either successfully autonegoatiated or forced.
16782          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not active.
16783          * This flag is only valid when link is up on this port.
16784          * At most only one active FEC flags (fec_clause74_active,
16785          * fec_clause91_active, fec_rs544_1xn, fec_rs544_2xn) can be set.
16786          */
16787         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ACTIVE \
16788                 UINT32_C(0x1000)
16789         /*
16790          * When set to 1, then FEC RS544_1XN is active on this
16791          * port, either successfully autonegoatiated or forced.
16792          * When set to 0, then FEC RS544_1XN is not active.
16793          * This flag is only valid when link is up on this port.
16794          * At most only one active FEC flags (fec_clause74_active,
16795          * fec_clause91_active, fec_rs544_1xn, fec_rs544_2xn) can be set.
16796          */
16797         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ACTIVE \
16798                 UINT32_C(0x2000)
16799         /*
16800          * When set to 1, then FEC RS544_2XN is active on this
16801          * port, either successfully autonegoatiated or forced.
16802          * When set to 0, then FEC RS544_2XN is not active.
16803          * This flag is only valid when link is up on this port.
16804          * At most only one active FEC flags (fec_clause74_active,
16805          * fec_clause91_active, fec_rs544_1xn, fec_rs544_2xn) can be set.
16806          */
16807         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_2XN_ACTIVE \
16808                 UINT32_C(0x4000)
16809         /*
16810          * This value is indicates the duplex of the current
16811          * connection state.
16812          */
16813         uint8_t duplex_state;
16814         /* Half Duplex connection. */
16815         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
16816         /* Full duplex connection. */
16817         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
16818         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
16819                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
16820         /* Option flags fields. */
16821         uint8_t option_flags;
16822         /* When this bit is '1', Media auto detect is enabled. */
16823         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
16824                 UINT32_C(0x1)
16825         /*
16826          * Up to 16 bytes of null padded ASCII string representing
16827          * PHY vendor.
16828          * If the string is set to null, then the vendor name is not
16829          * available.
16830          */
16831         char    phy_vendor_name[16];
16832         /*
16833          * Up to 16 bytes of null padded ASCII string that
16834          * identifies vendor specific part number of the PHY.
16835          * If the string is set to null, then the vendor specific
16836          * part number is not available.
16837          */
16838         char    phy_vendor_partnumber[16];
16839         uint8_t unused_2[7];
16840         /*
16841          * This field is used in Output records to indicate that the output
16842          * is completely written to RAM.  This field should be read as '1'
16843          * to indicate that the output has been completely written.
16844          * When writing a command completion or response to an internal processor,
16845          * the order of writes has to be such that this field is written last.
16846          */
16847         uint8_t valid;
16848 } __rte_packed;
16849
16850 /*********************
16851  * hwrm_port_mac_cfg *
16852  *********************/
16853
16854
16855 /* hwrm_port_mac_cfg_input (size:384b/48B) */
16856 struct hwrm_port_mac_cfg_input {
16857         /* The HWRM command request type. */
16858         uint16_t        req_type;
16859         /*
16860          * The completion ring to send the completion event on. This should
16861          * be the NQ ID returned from the `nq_alloc` HWRM command.
16862          */
16863         uint16_t        cmpl_ring;
16864         /*
16865          * The sequence ID is used by the driver for tracking multiple
16866          * commands. This ID is treated as opaque data by the firmware and
16867          * the value is returned in the `hwrm_resp_hdr` upon completion.
16868          */
16869         uint16_t        seq_id;
16870         /*
16871          * The target ID of the command:
16872          * * 0x0-0xFFF8 - The function ID
16873          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16874          * * 0xFFFD - Reserved for user-space HWRM interface
16875          * * 0xFFFF - HWRM
16876          */
16877         uint16_t        target_id;
16878         /*
16879          * A physical address pointer pointing to a host buffer that the
16880          * command's response data will be written. This can be either a host
16881          * physical address (HPA) or a guest physical address (GPA) and must
16882          * point to a physically contiguous block of memory.
16883          */
16884         uint64_t        resp_addr;
16885         /*
16886          * In this field, there are a number of CoS mappings related flags
16887          * that are used to configure CoS mappings and their corresponding
16888          * priorities in the hardware.
16889          * For the priorities of CoS mappings, the HWRM uses the following
16890          * priority order (high to low) by default:
16891          * # vlan pri
16892          * # ip_dscp
16893          * # tunnel_vlan_pri
16894          * # default cos
16895          *
16896          * A subset of CoS mappings can be enabled.
16897          * If a priority is not specified for an enabled CoS mapping, the
16898          * priority will be assigned in the above order for the enabled CoS
16899          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
16900          * enabled and their priorities are not specified, the following
16901          * priority order (high to low) will be used by the HWRM:
16902          * # vlan_pri
16903          * # ip_dscp
16904          * # default cos
16905          *
16906          * vlan_pri CoS mapping together with default CoS with lower priority
16907          * are enabled by default by the HWRM.
16908          */
16909         uint32_t        flags;
16910         /*
16911          * When this bit is '1', this command will configure
16912          * the MAC to match the current link state of the PHY.
16913          * If the link is not established on the PHY, then this
16914          * bit has no effect.
16915          */
16916         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
16917                 UINT32_C(0x1)
16918         /*
16919          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
16920          * is requested to be enabled.
16921          */
16922         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
16923                 UINT32_C(0x2)
16924         /*
16925          * When this bit is set to '1', tunnel VLAN PRI field to
16926          * CoS mapping is requested to be enabled.
16927          */
16928         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
16929                 UINT32_C(0x4)
16930         /*
16931          * When this bit is set to '1', the IP DSCP to CoS mapping is
16932          * requested to be enabled.
16933          */
16934         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
16935                 UINT32_C(0x8)
16936         /*
16937          * When this bit is '1', the HWRM is requested to
16938          * enable timestamp capture capability on the receive side
16939          * of this port.
16940          */
16941         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
16942                 UINT32_C(0x10)
16943         /*
16944          * When this bit is '1', the HWRM is requested to
16945          * disable timestamp capture capability on the receive side
16946          * of this port.
16947          */
16948         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
16949                 UINT32_C(0x20)
16950         /*
16951          * When this bit is '1', the HWRM is requested to
16952          * enable timestamp capture capability on the transmit side
16953          * of this port.
16954          */
16955         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
16956                 UINT32_C(0x40)
16957         /*
16958          * When this bit is '1', the HWRM is requested to
16959          * disable timestamp capture capability on the transmit side
16960          * of this port.
16961          */
16962         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
16963                 UINT32_C(0x80)
16964         /*
16965          * When this bit is '1', the Out-Of-Box WoL is requested to
16966          * be enabled on this port.
16967          */
16968         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
16969                 UINT32_C(0x100)
16970         /*
16971          * When this bit is '1', the Out-Of-Box WoL is requested to
16972          * be disabled on this port.
16973          */
16974         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
16975                 UINT32_C(0x200)
16976         /*
16977          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
16978          * is requested to be disabled.
16979          */
16980         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
16981                 UINT32_C(0x400)
16982         /*
16983          * When this bit is set to '1', tunnel VLAN PRI field to
16984          * CoS mapping is requested to be disabled.
16985          */
16986         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
16987                 UINT32_C(0x800)
16988         /*
16989          * When this bit is set to '1', the IP DSCP to CoS mapping is
16990          * requested to be disabled.
16991          */
16992         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
16993                 UINT32_C(0x1000)
16994         /*
16995          * When this bit is set to '1', and the ptp_tx_ts_capture_enable
16996          * bit is set, then the device uses one step Tx timestamping.
16997          * This bit is temporary and used for experimental purposes.
16998          */
16999         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS \
17000                 UINT32_C(0x2000)
17001         uint32_t        enables;
17002         /*
17003          * This bit must be '1' for the ipg field to be
17004          * configured.
17005          */
17006         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
17007                 UINT32_C(0x1)
17008         /*
17009          * This bit must be '1' for the lpbk field to be
17010          * configured.
17011          */
17012         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
17013                 UINT32_C(0x2)
17014         /*
17015          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
17016          * configured.
17017          */
17018         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
17019                 UINT32_C(0x4)
17020         /*
17021          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
17022          * configured.
17023          */
17024         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
17025                 UINT32_C(0x10)
17026         /*
17027          * This bit must be '1' for the dscp2cos_map_pri field to be
17028          * configured.
17029          */
17030         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
17031                 UINT32_C(0x20)
17032         /*
17033          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
17034          * configured.
17035          */
17036         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
17037                 UINT32_C(0x40)
17038         /*
17039          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
17040          * configured.
17041          */
17042         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
17043                 UINT32_C(0x80)
17044         /*
17045          * This bit must be '1' for the cos_field_cfg field to be
17046          * configured.
17047          */
17048         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
17049                 UINT32_C(0x100)
17050         /*
17051          * This bit must be '1' for the ptp_freq_adj_ppb field to be
17052          * configured.
17053          */
17054         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB \
17055                 UINT32_C(0x200)
17056         /* Port ID of port that is to be configured. */
17057         uint16_t        port_id;
17058         /*
17059          * This value is used to configure the minimum IPG that will
17060          * be sent between packets by this port.
17061          */
17062         uint8_t ipg;
17063         /* This value controls the loopback setting for the MAC. */
17064         uint8_t lpbk;
17065         /* No loopback is selected.  Normal operation. */
17066         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
17067         /*
17068          * The HW will be configured with local loopback such that
17069          * host data is sent back to the host without modification.
17070          */
17071         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
17072         /*
17073          * The HW will be configured with remote loopback such that
17074          * port logic will send packets back out the transmitter that
17075          * are received.
17076          */
17077         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
17078         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
17079                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
17080         /*
17081          * This value controls the priority setting of VLAN PRI to CoS
17082          * mapping based on VLAN Tags of inner packet headers of
17083          * tunneled packets or packet headers of non-tunneled packets.
17084          *
17085          * # Each XXX_pri variable shall have a unique priority value
17086          * when it is being specified.
17087          * # When comparing priorities of mappings, higher value
17088          * indicates higher priority.
17089          * For example, a value of 0-3 is returned where 0 is being
17090          * the lowest priority and 3 is being the highest priority.
17091          */
17092         uint8_t vlan_pri2cos_map_pri;
17093         /* Reserved field. */
17094         uint8_t reserved1;
17095         /*
17096          * This value controls the priority setting of VLAN PRI to CoS
17097          * mapping based on VLAN Tags of tunneled header.
17098          * This mapping only applies when tunneled headers
17099          * are present.
17100          *
17101          * # Each XXX_pri variable shall have a unique priority value
17102          * when it is being specified.
17103          * # When comparing priorities of mappings, higher value
17104          * indicates higher priority.
17105          * For example, a value of 0-3 is returned where 0 is being
17106          * the lowest priority and 3 is being the highest priority.
17107          */
17108         uint8_t tunnel_pri2cos_map_pri;
17109         /*
17110          * This value controls the priority setting of IP DSCP to CoS
17111          * mapping based on inner IP header of tunneled packets or
17112          * IP header of non-tunneled packets.
17113          *
17114          * # Each XXX_pri variable shall have a unique priority value
17115          * when it is being specified.
17116          * # When comparing priorities of mappings, higher value
17117          * indicates higher priority.
17118          * For example, a value of 0-3 is returned where 0 is being
17119          * the lowest priority and 3 is being the highest priority.
17120          */
17121         uint8_t dscp2pri_map_pri;
17122         /*
17123          * This is a 16-bit bit mask that is used to request a
17124          * specific configuration of time stamp capture of PTP messages
17125          * on the receive side of this port.
17126          * This field shall be ignored if the ptp_rx_ts_capture_enable
17127          * flag is not set in this command.
17128          * Otherwise, if bit 'i' is set, then the HWRM is being
17129          * requested to configure the receive side of the port to
17130          * capture the time stamp of every received PTP message
17131          * with messageType field value set to i.
17132          */
17133         uint16_t        rx_ts_capture_ptp_msg_type;
17134         /*
17135          * This is a 16-bit bit mask that is used to request a
17136          * specific configuration of time stamp capture of PTP messages
17137          * on the transmit side of this port.
17138          * This field shall be ignored if the ptp_tx_ts_capture_enable
17139          * flag is not set in this command.
17140          * Otherwise, if bit 'i' is set, then the HWRM is being
17141          * requested to configure the transmit side of the port to
17142          * capture the time stamp of every transmitted PTP message
17143          * with messageType field value set to i.
17144          */
17145         uint16_t        tx_ts_capture_ptp_msg_type;
17146         /* Configuration of CoS fields. */
17147         uint8_t cos_field_cfg;
17148         /* Reserved */
17149         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
17150                 UINT32_C(0x1)
17151         /*
17152          * This field is used to specify selection of VLAN PRI value
17153          * based on whether one or two VLAN Tags are present in
17154          * the inner packet headers of tunneled packets or
17155          * non-tunneled packets.
17156          * This field is valid only if inner VLAN PRI to CoS mapping
17157          * is enabled.
17158          * If VLAN PRI to CoS mapping is not enabled, then this
17159          * field shall be ignored.
17160          */
17161         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
17162                 UINT32_C(0x6)
17163         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
17164                 1
17165         /*
17166          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
17167          * present in the inner packet headers
17168          */
17169         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
17170                 (UINT32_C(0x0) << 1)
17171         /*
17172          * Select outer VLAN Tag PRI when 2 VLAN Tags are
17173          * present in the inner packet headers.
17174          * No VLAN PRI shall be selected for this configuration
17175          * if only one VLAN Tag is present in the inner
17176          * packet headers.
17177          */
17178         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
17179                 (UINT32_C(0x1) << 1)
17180         /*
17181          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
17182          * are present in the inner packet headers
17183          */
17184         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
17185                 (UINT32_C(0x2) << 1)
17186         /* Unspecified */
17187         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
17188                 (UINT32_C(0x3) << 1)
17189         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
17190                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
17191         /*
17192          * This field is used to specify selection of tunnel VLAN
17193          * PRI value based on whether one or two VLAN Tags are
17194          * present in tunnel headers.
17195          * This field is valid only if tunnel VLAN PRI to CoS mapping
17196          * is enabled.
17197          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
17198          * field shall be ignored.
17199          */
17200         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
17201                 UINT32_C(0x18)
17202         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
17203                 3
17204         /*
17205          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
17206          * present in the tunnel packet headers
17207          */
17208         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
17209                 (UINT32_C(0x0) << 3)
17210         /*
17211          * Select outer VLAN Tag PRI when 2 VLAN Tags are
17212          * present in the tunnel packet headers.
17213          * No tunnel VLAN PRI shall be selected for this
17214          * configuration if only one VLAN Tag is present in
17215          * the tunnel packet headers.
17216          */
17217         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
17218                 (UINT32_C(0x1) << 3)
17219         /*
17220          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
17221          * are present in the tunnel packet headers
17222          */
17223         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
17224                 (UINT32_C(0x2) << 3)
17225         /* Unspecified */
17226         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
17227                 (UINT32_C(0x3) << 3)
17228         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
17229                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
17230         /*
17231          * This field shall be used to provide default CoS value
17232          * that has been configured on this port.
17233          * This field is valid only if default CoS mapping
17234          * is enabled.
17235          * If default CoS mapping is not enabled, then this
17236          * field shall be ignored.
17237          */
17238         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
17239                 UINT32_C(0xe0)
17240         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
17241                 5
17242         uint8_t unused_0[3];
17243         /*
17244          * This signed field specifies by how much to adjust the frequency
17245          * of sync timer updates (measured in parts per billion).
17246          */
17247         int32_t ptp_freq_adj_ppb;
17248         uint8_t unused_1[4];
17249 } __rte_packed;
17250
17251 /* hwrm_port_mac_cfg_output (size:128b/16B) */
17252 struct hwrm_port_mac_cfg_output {
17253         /* The specific error status for the command. */
17254         uint16_t        error_code;
17255         /* The HWRM command request type. */
17256         uint16_t        req_type;
17257         /* The sequence ID from the original command. */
17258         uint16_t        seq_id;
17259         /* The length of the response data in number of bytes. */
17260         uint16_t        resp_len;
17261         /*
17262          * This is the configured maximum length of Ethernet packet
17263          * payload that is allowed to be received on the port.
17264          * This value does not include the number of bytes used by
17265          * Ethernet header and trailer (CRC).
17266          */
17267         uint16_t        mru;
17268         /*
17269          * This is the configured maximum length of Ethernet packet
17270          * payload that is allowed to be transmitted on the port.
17271          * This value does not include the number of bytes used by
17272          * Ethernet header and trailer (CRC).
17273          */
17274         uint16_t        mtu;
17275         /* Current configuration of the IPG value. */
17276         uint8_t ipg;
17277         /* Current value of the loopback value. */
17278         uint8_t lpbk;
17279         /* No loopback is selected.  Normal operation. */
17280         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
17281         /*
17282          * The HW will be configured with local loopback such that
17283          * host data is sent back to the host without modification.
17284          */
17285         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
17286         /*
17287          * The HW will be configured with remote loopback such that
17288          * port logic will send packets back out the transmitter that
17289          * are received.
17290          */
17291         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
17292         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
17293                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
17294         uint8_t unused_0;
17295         /*
17296          * This field is used in Output records to indicate that the output
17297          * is completely written to RAM.  This field should be read as '1'
17298          * to indicate that the output has been completely written.
17299          * When writing a command completion or response to an internal processor,
17300          * the order of writes has to be such that this field is written last.
17301          */
17302         uint8_t valid;
17303 } __rte_packed;
17304
17305 /**********************
17306  * hwrm_port_mac_qcfg *
17307  **********************/
17308
17309
17310 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
17311 struct hwrm_port_mac_qcfg_input {
17312         /* The HWRM command request type. */
17313         uint16_t        req_type;
17314         /*
17315          * The completion ring to send the completion event on. This should
17316          * be the NQ ID returned from the `nq_alloc` HWRM command.
17317          */
17318         uint16_t        cmpl_ring;
17319         /*
17320          * The sequence ID is used by the driver for tracking multiple
17321          * commands. This ID is treated as opaque data by the firmware and
17322          * the value is returned in the `hwrm_resp_hdr` upon completion.
17323          */
17324         uint16_t        seq_id;
17325         /*
17326          * The target ID of the command:
17327          * * 0x0-0xFFF8 - The function ID
17328          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17329          * * 0xFFFD - Reserved for user-space HWRM interface
17330          * * 0xFFFF - HWRM
17331          */
17332         uint16_t        target_id;
17333         /*
17334          * A physical address pointer pointing to a host buffer that the
17335          * command's response data will be written. This can be either a host
17336          * physical address (HPA) or a guest physical address (GPA) and must
17337          * point to a physically contiguous block of memory.
17338          */
17339         uint64_t        resp_addr;
17340         /* Port ID of port that is to be configured. */
17341         uint16_t        port_id;
17342         uint8_t unused_0[6];
17343 } __rte_packed;
17344
17345 /* hwrm_port_mac_qcfg_output (size:256b/32B) */
17346 struct hwrm_port_mac_qcfg_output {
17347         /* The specific error status for the command. */
17348         uint16_t        error_code;
17349         /* The HWRM command request type. */
17350         uint16_t        req_type;
17351         /* The sequence ID from the original command. */
17352         uint16_t        seq_id;
17353         /* The length of the response data in number of bytes. */
17354         uint16_t        resp_len;
17355         /*
17356          * This is the configured maximum length of Ethernet packet
17357          * payload that is allowed to be received on the port.
17358          * This value does not include the number of bytes used by the
17359          * Ethernet header and trailer (CRC).
17360          */
17361         uint16_t        mru;
17362         /*
17363          * This is the configured maximum length of Ethernet packet
17364          * payload that is allowed to be transmitted on the port.
17365          * This value does not include the number of bytes used by the
17366          * Ethernet header and trailer (CRC).
17367          */
17368         uint16_t        mtu;
17369         /*
17370          * The minimum IPG that will
17371          * be sent between packets by this port.
17372          */
17373         uint8_t ipg;
17374         /* The loopback setting for the MAC. */
17375         uint8_t lpbk;
17376         /* No loopback is selected.  Normal operation. */
17377         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
17378         /*
17379          * The HW will be configured with local loopback such that
17380          * host data is sent back to the host without modification.
17381          */
17382         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
17383         /*
17384          * The HW will be configured with remote loopback such that
17385          * port logic will send packets back out the transmitter that
17386          * are received.
17387          */
17388         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
17389         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
17390                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
17391         /*
17392          * Priority setting for VLAN PRI to CoS mapping.
17393          * # Each XXX_pri variable shall have a unique priority value
17394          * when it is being used.
17395          * # When comparing priorities of mappings, higher value
17396          * indicates higher priority.
17397          * For example, a value of 0-3 is returned where 0 is being
17398          * the lowest priority and 3 is being the highest priority.
17399          * # If the correspoding CoS mapping is not enabled, then this
17400          * field should be ignored.
17401          * # This value indicates the normalized priority value retained
17402          * in the HWRM.
17403          */
17404         uint8_t vlan_pri2cos_map_pri;
17405         /*
17406          * In this field, a number of CoS mappings related flags
17407          * are used to indicate configured CoS mappings.
17408          */
17409         uint8_t flags;
17410         /*
17411          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
17412          * is enabled.
17413          */
17414         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
17415                 UINT32_C(0x1)
17416         /*
17417          * When this bit is set to '1', tunnel VLAN PRI field to
17418          * CoS mapping is enabled.
17419          */
17420         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
17421                 UINT32_C(0x2)
17422         /*
17423          * When this bit is set to '1', the IP DSCP to CoS mapping is
17424          * enabled.
17425          */
17426         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
17427                 UINT32_C(0x4)
17428         /*
17429          * When this bit is '1', the Out-Of-Box WoL is enabled on this
17430          * port.
17431          */
17432         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
17433                 UINT32_C(0x8)
17434         /* When this bit is '1', PTP is enabled for RX on this port. */
17435         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
17436                 UINT32_C(0x10)
17437         /* When this bit is '1', PTP is enabled for TX on this port. */
17438         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
17439                 UINT32_C(0x20)
17440         /*
17441          * Priority setting for tunnel VLAN PRI to CoS mapping.
17442          * # Each XXX_pri variable shall have a unique priority value
17443          * when it is being used.
17444          * # When comparing priorities of mappings, higher value
17445          * indicates higher priority.
17446          * For example, a value of 0-3 is returned where 0 is being
17447          * the lowest priority and 3 is being the highest priority.
17448          * # If the correspoding CoS mapping is not enabled, then this
17449          * field should be ignored.
17450          * # This value indicates the normalized priority value retained
17451          * in the HWRM.
17452          */
17453         uint8_t tunnel_pri2cos_map_pri;
17454         /*
17455          * Priority setting for DSCP to PRI mapping.
17456          * # Each XXX_pri variable shall have a unique priority value
17457          * when it is being used.
17458          * # When comparing priorities of mappings, higher value
17459          * indicates higher priority.
17460          * For example, a value of 0-3 is returned where 0 is being
17461          * the lowest priority and 3 is being the highest priority.
17462          * # If the correspoding CoS mapping is not enabled, then this
17463          * field should be ignored.
17464          * # This value indicates the normalized priority value retained
17465          * in the HWRM.
17466          */
17467         uint8_t dscp2pri_map_pri;
17468         /*
17469          * This is a 16-bit bit mask that represents the
17470          * current configuration of time stamp capture of PTP messages
17471          * on the receive side of this port.
17472          * If bit 'i' is set, then the receive side of the port
17473          * is configured to capture the time stamp of every
17474          * received PTP message with messageType field value set
17475          * to i.
17476          * If all bits are set to 0 (i.e. field value set 0),
17477          * then the receive side of the port is not configured
17478          * to capture timestamp for PTP messages.
17479          * If all bits are set to 1, then the receive side of the
17480          * port is configured to capture timestamp for all PTP
17481          * messages.
17482          */
17483         uint16_t        rx_ts_capture_ptp_msg_type;
17484         /*
17485          * This is a 16-bit bit mask that represents the
17486          * current configuration of time stamp capture of PTP messages
17487          * on the transmit side of this port.
17488          * If bit 'i' is set, then the transmit side of the port
17489          * is configured to capture the time stamp of every
17490          * received PTP message with messageType field value set
17491          * to i.
17492          * If all bits are set to 0 (i.e. field value set 0),
17493          * then the transmit side of the port is not configured
17494          * to capture timestamp for PTP messages.
17495          * If all bits are set to 1, then the transmit side of the
17496          * port is configured to capture timestamp for all PTP
17497          * messages.
17498          */
17499         uint16_t        tx_ts_capture_ptp_msg_type;
17500         /* Configuration of CoS fields. */
17501         uint8_t cos_field_cfg;
17502         /* Reserved */
17503         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
17504                 UINT32_C(0x1)
17505         /*
17506          * This field is used for selecting VLAN PRI value
17507          * based on whether one or two VLAN Tags are present in
17508          * the inner packet headers of tunneled packets or
17509          * non-tunneled packets.
17510          */
17511         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
17512                 UINT32_C(0x6)
17513         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
17514                 1
17515         /*
17516          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
17517          * present in the inner packet headers
17518          */
17519         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
17520                 (UINT32_C(0x0) << 1)
17521         /*
17522          * Select outer VLAN Tag PRI when 2 VLAN Tags are
17523          * present in the inner packet headers.
17524          * No VLAN PRI is selected for this configuration
17525          * if only one VLAN Tag is present in the inner
17526          * packet headers.
17527          */
17528         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
17529                 (UINT32_C(0x1) << 1)
17530         /*
17531          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
17532          * are present in the inner packet headers
17533          */
17534         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
17535                 (UINT32_C(0x2) << 1)
17536         /* Unspecified */
17537         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
17538                 (UINT32_C(0x3) << 1)
17539         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
17540                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
17541         /*
17542          * This field is used for selecting tunnel VLAN PRI value
17543          * based on whether one or two VLAN Tags are present in
17544          * the tunnel headers of tunneled packets. This selection
17545          * does not apply to non-tunneled packets.
17546          */
17547         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
17548                 UINT32_C(0x18)
17549         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
17550                 3
17551         /*
17552          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
17553          * present in the tunnel packet headers
17554          */
17555         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
17556                 (UINT32_C(0x0) << 3)
17557         /*
17558          * Select outer VLAN Tag PRI when 2 VLAN Tags are
17559          * present in the tunnel packet headers.
17560          * No VLAN PRI is selected for this configuration
17561          * if only one VLAN Tag is present in the tunnel
17562          * packet headers.
17563          */
17564         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
17565                 (UINT32_C(0x1) << 3)
17566         /*
17567          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
17568          * are present in the tunnel packet headers
17569          */
17570         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
17571                 (UINT32_C(0x2) << 3)
17572         /* Unspecified */
17573         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
17574                 (UINT32_C(0x3) << 3)
17575         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
17576                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
17577         /*
17578          * This field is used to provide default CoS value that
17579          * has been configured on this port.
17580          */
17581         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
17582                 UINT32_C(0xe0)
17583         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
17584                 5
17585         uint8_t unused_1;
17586         uint16_t        port_svif_info;
17587         /*
17588          * This field specifies the source virtual interface of the port being
17589          * queried. Drivers can use this to program port svif field in the
17590          * L2 context table
17591          */
17592         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_MASK \
17593                 UINT32_C(0x7fff)
17594         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_SFT       0
17595         /* This field specifies whether port_svif is valid or not */
17596         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_VALID \
17597                 UINT32_C(0x8000)
17598         uint8_t unused_2[5];
17599         /*
17600          * This field is used in Output records to indicate that the output
17601          * is completely written to RAM.  This field should be read as '1'
17602          * to indicate that the output has been completely written.
17603          * When writing a command completion or response to an internal processor,
17604          * the order of writes has to be such that this field is written last.
17605          */
17606         uint8_t valid;
17607 } __rte_packed;
17608
17609 /**************************
17610  * hwrm_port_mac_ptp_qcfg *
17611  **************************/
17612
17613
17614 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
17615 struct hwrm_port_mac_ptp_qcfg_input {
17616         /* The HWRM command request type. */
17617         uint16_t        req_type;
17618         /*
17619          * The completion ring to send the completion event on. This should
17620          * be the NQ ID returned from the `nq_alloc` HWRM command.
17621          */
17622         uint16_t        cmpl_ring;
17623         /*
17624          * The sequence ID is used by the driver for tracking multiple
17625          * commands. This ID is treated as opaque data by the firmware and
17626          * the value is returned in the `hwrm_resp_hdr` upon completion.
17627          */
17628         uint16_t        seq_id;
17629         /*
17630          * The target ID of the command:
17631          * * 0x0-0xFFF8 - The function ID
17632          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17633          * * 0xFFFD - Reserved for user-space HWRM interface
17634          * * 0xFFFF - HWRM
17635          */
17636         uint16_t        target_id;
17637         /*
17638          * A physical address pointer pointing to a host buffer that the
17639          * command's response data will be written. This can be either a host
17640          * physical address (HPA) or a guest physical address (GPA) and must
17641          * point to a physically contiguous block of memory.
17642          */
17643         uint64_t        resp_addr;
17644         /* Port ID of port that is being queried. */
17645         uint16_t        port_id;
17646         uint8_t unused_0[6];
17647 } __rte_packed;
17648
17649 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
17650 struct hwrm_port_mac_ptp_qcfg_output {
17651         /* The specific error status for the command. */
17652         uint16_t        error_code;
17653         /* The HWRM command request type. */
17654         uint16_t        req_type;
17655         /* The sequence ID from the original command. */
17656         uint16_t        seq_id;
17657         /* The length of the response data in number of bytes. */
17658         uint16_t        resp_len;
17659         /*
17660          * In this field, a number of PTP related flags
17661          * are used to indicate configured PTP capabilities.
17662          */
17663         uint8_t flags;
17664         /*
17665          * When this bit is set to '1', the PTP related registers are
17666          * directly accessible by the host.
17667          */
17668         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
17669                 UINT32_C(0x1)
17670         /*
17671          * When this bit is set to '1', the device supports one-step
17672          * Tx timestamping.
17673          */
17674         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS \
17675                 UINT32_C(0x4)
17676         /*
17677          * When this bit is set to '1', the PTP information is accessible
17678          * via HWRM commands.
17679          */
17680         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
17681                 UINT32_C(0x8)
17682         uint8_t unused_0[3];
17683         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
17684         uint32_t        rx_ts_reg_off_lower;
17685         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
17686         uint32_t        rx_ts_reg_off_upper;
17687         /* Offset of the PTP register for the sequence ID for RX. */
17688         uint32_t        rx_ts_reg_off_seq_id;
17689         /* Offset of the first PTP source ID for RX. */
17690         uint32_t        rx_ts_reg_off_src_id_0;
17691         /* Offset of the second PTP source ID for RX. */
17692         uint32_t        rx_ts_reg_off_src_id_1;
17693         /* Offset of the third PTP source ID for RX. */
17694         uint32_t        rx_ts_reg_off_src_id_2;
17695         /* Offset of the domain ID for RX. */
17696         uint32_t        rx_ts_reg_off_domain_id;
17697         /* Offset of the PTP FIFO register for RX. */
17698         uint32_t        rx_ts_reg_off_fifo;
17699         /* Offset of the PTP advance FIFO register for RX. */
17700         uint32_t        rx_ts_reg_off_fifo_adv;
17701         /* PTP timestamp granularity for RX. */
17702         uint32_t        rx_ts_reg_off_granularity;
17703         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
17704         uint32_t        tx_ts_reg_off_lower;
17705         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
17706         uint32_t        tx_ts_reg_off_upper;
17707         /* Offset of the PTP register for the sequence ID for TX. */
17708         uint32_t        tx_ts_reg_off_seq_id;
17709         /* Offset of the PTP FIFO register for TX. */
17710         uint32_t        tx_ts_reg_off_fifo;
17711         /* PTP timestamp granularity for TX. */
17712         uint32_t        tx_ts_reg_off_granularity;
17713         uint8_t unused_1[7];
17714         /*
17715          * This field is used in Output records to indicate that the output
17716          * is completely written to RAM.  This field should be read as '1'
17717          * to indicate that the output has been completely written.
17718          * When writing a command completion or response to an internal processor,
17719          * the order of writes has to be such that this field is written last.
17720          */
17721         uint8_t valid;
17722 } __rte_packed;
17723
17724 /* Port Tx Statistics Format */
17725 /* tx_port_stats (size:3264b/408B) */
17726 struct tx_port_stats {
17727         /* Total Number of 64 Bytes frames transmitted */
17728         uint64_t        tx_64b_frames;
17729         /* Total Number of 65-127 Bytes frames transmitted */
17730         uint64_t        tx_65b_127b_frames;
17731         /* Total Number of 128-255 Bytes frames transmitted */
17732         uint64_t        tx_128b_255b_frames;
17733         /* Total Number of 256-511 Bytes frames transmitted */
17734         uint64_t        tx_256b_511b_frames;
17735         /* Total Number of 512-1023 Bytes frames transmitted */
17736         uint64_t        tx_512b_1023b_frames;
17737         /* Total Number of 1024-1518 Bytes frames transmitted */
17738         uint64_t        tx_1024b_1518b_frames;
17739         /*
17740          * Total Number of each good VLAN (exludes FCS errors)
17741          * frame transmitted which is 1519 to 1522 bytes in length
17742          * inclusive (excluding framing bits but including FCS bytes).
17743          */
17744         uint64_t        tx_good_vlan_frames;
17745         /* Total Number of 1519-2047 Bytes frames transmitted */
17746         uint64_t        tx_1519b_2047b_frames;
17747         /* Total Number of 2048-4095 Bytes frames transmitted */
17748         uint64_t        tx_2048b_4095b_frames;
17749         /* Total Number of 4096-9216 Bytes frames transmitted */
17750         uint64_t        tx_4096b_9216b_frames;
17751         /* Total Number of 9217-16383 Bytes frames transmitted */
17752         uint64_t        tx_9217b_16383b_frames;
17753         /* Total Number of good frames transmitted */
17754         uint64_t        tx_good_frames;
17755         /* Total Number of frames transmitted */
17756         uint64_t        tx_total_frames;
17757         /* Total number of unicast frames transmitted */
17758         uint64_t        tx_ucast_frames;
17759         /* Total number of multicast frames transmitted */
17760         uint64_t        tx_mcast_frames;
17761         /* Total number of broadcast frames transmitted */
17762         uint64_t        tx_bcast_frames;
17763         /* Total number of PAUSE control frames transmitted */
17764         uint64_t        tx_pause_frames;
17765         /*
17766          * Total number of PFC/per-priority PAUSE
17767          * control frames transmitted
17768          */
17769         uint64_t        tx_pfc_frames;
17770         /* Total number of jabber frames transmitted */
17771         uint64_t        tx_jabber_frames;
17772         /* Total number of frames transmitted with FCS error */
17773         uint64_t        tx_fcs_err_frames;
17774         /* Total number of control frames transmitted */
17775         uint64_t        tx_control_frames;
17776         /* Total number of over-sized frames transmitted */
17777         uint64_t        tx_oversz_frames;
17778         /* Total number of frames with single deferral */
17779         uint64_t        tx_single_dfrl_frames;
17780         /* Total number of frames with multiple deferrals */
17781         uint64_t        tx_multi_dfrl_frames;
17782         /* Total number of frames with single collision */
17783         uint64_t        tx_single_coll_frames;
17784         /* Total number of frames with multiple collisions */
17785         uint64_t        tx_multi_coll_frames;
17786         /* Total number of frames with late collisions */
17787         uint64_t        tx_late_coll_frames;
17788         /* Total number of frames with excessive collisions */
17789         uint64_t        tx_excessive_coll_frames;
17790         /* Total number of fragmented frames transmitted */
17791         uint64_t        tx_frag_frames;
17792         /* Total number of transmit errors */
17793         uint64_t        tx_err;
17794         /* Total number of single VLAN tagged frames transmitted */
17795         uint64_t        tx_tagged_frames;
17796         /* Total number of double VLAN tagged frames transmitted */
17797         uint64_t        tx_dbl_tagged_frames;
17798         /* Total number of runt frames transmitted */
17799         uint64_t        tx_runt_frames;
17800         /* Total number of TX FIFO under runs */
17801         uint64_t        tx_fifo_underruns;
17802         /*
17803          * Total number of PFC frames with PFC enabled bit for
17804          * Pri 0 transmitted
17805          */
17806         uint64_t        tx_pfc_ena_frames_pri0;
17807         /*
17808          * Total number of PFC frames with PFC enabled bit for
17809          * Pri 1 transmitted
17810          */
17811         uint64_t        tx_pfc_ena_frames_pri1;
17812         /*
17813          * Total number of PFC frames with PFC enabled bit for
17814          * Pri 2 transmitted
17815          */
17816         uint64_t        tx_pfc_ena_frames_pri2;
17817         /*
17818          * Total number of PFC frames with PFC enabled bit for
17819          * Pri 3 transmitted
17820          */
17821         uint64_t        tx_pfc_ena_frames_pri3;
17822         /*
17823          * Total number of PFC frames with PFC enabled bit for
17824          * Pri 4 transmitted
17825          */
17826         uint64_t        tx_pfc_ena_frames_pri4;
17827         /*
17828          * Total number of PFC frames with PFC enabled bit for
17829          * Pri 5 transmitted
17830          */
17831         uint64_t        tx_pfc_ena_frames_pri5;
17832         /*
17833          * Total number of PFC frames with PFC enabled bit for
17834          * Pri 6 transmitted
17835          */
17836         uint64_t        tx_pfc_ena_frames_pri6;
17837         /*
17838          * Total number of PFC frames with PFC enabled bit for
17839          * Pri 7 transmitted
17840          */
17841         uint64_t        tx_pfc_ena_frames_pri7;
17842         /* Total number of EEE LPI Events on TX */
17843         uint64_t        tx_eee_lpi_events;
17844         /* EEE LPI Duration Counter on TX */
17845         uint64_t        tx_eee_lpi_duration;
17846         /*
17847          * Total number of Link Level Flow Control (LLFC) messages
17848          * transmitted
17849          */
17850         uint64_t        tx_llfc_logical_msgs;
17851         /* Total number of HCFC messages transmitted */
17852         uint64_t        tx_hcfc_msgs;
17853         /* Total number of TX collisions */
17854         uint64_t        tx_total_collisions;
17855         /* Total number of transmitted bytes */
17856         uint64_t        tx_bytes;
17857         /* Total number of end-to-end HOL frames */
17858         uint64_t        tx_xthol_frames;
17859         /* Total Tx Drops per Port reported by STATS block */
17860         uint64_t        tx_stat_discard;
17861         /* Total Tx Error Drops per Port reported by STATS block */
17862         uint64_t        tx_stat_error;
17863 } __rte_packed;
17864
17865 /* Port Rx Statistics Format */
17866 /* rx_port_stats (size:4224b/528B) */
17867 struct rx_port_stats {
17868         /* Total Number of 64 Bytes frames received */
17869         uint64_t        rx_64b_frames;
17870         /* Total Number of 65-127 Bytes frames received */
17871         uint64_t        rx_65b_127b_frames;
17872         /* Total Number of 128-255 Bytes frames received */
17873         uint64_t        rx_128b_255b_frames;
17874         /* Total Number of 256-511 Bytes frames received */
17875         uint64_t        rx_256b_511b_frames;
17876         /* Total Number of 512-1023 Bytes frames received */
17877         uint64_t        rx_512b_1023b_frames;
17878         /* Total Number of 1024-1518 Bytes frames received */
17879         uint64_t        rx_1024b_1518b_frames;
17880         /*
17881          * Total Number of each good VLAN (exludes FCS errors)
17882          * frame received which is 1519 to 1522 bytes in length
17883          * inclusive (excluding framing bits but including FCS bytes).
17884          */
17885         uint64_t        rx_good_vlan_frames;
17886         /* Total Number of 1519-2047 Bytes frames received */
17887         uint64_t        rx_1519b_2047b_frames;
17888         /* Total Number of 2048-4095 Bytes frames received */
17889         uint64_t        rx_2048b_4095b_frames;
17890         /* Total Number of 4096-9216 Bytes frames received */
17891         uint64_t        rx_4096b_9216b_frames;
17892         /* Total Number of 9217-16383 Bytes frames received */
17893         uint64_t        rx_9217b_16383b_frames;
17894         /* Total number of frames received */
17895         uint64_t        rx_total_frames;
17896         /* Total number of unicast frames received */
17897         uint64_t        rx_ucast_frames;
17898         /* Total number of multicast frames received */
17899         uint64_t        rx_mcast_frames;
17900         /* Total number of broadcast frames received */
17901         uint64_t        rx_bcast_frames;
17902         /* Total number of received frames with FCS error */
17903         uint64_t        rx_fcs_err_frames;
17904         /* Total number of control frames received */
17905         uint64_t        rx_ctrl_frames;
17906         /* Total number of PAUSE frames received */
17907         uint64_t        rx_pause_frames;
17908         /* Total number of PFC frames received */
17909         uint64_t        rx_pfc_frames;
17910         /*
17911          * Total number of frames received with an unsupported
17912          * opcode
17913          */
17914         uint64_t        rx_unsupported_opcode_frames;
17915         /*
17916          * Total number of frames received with an unsupported
17917          * DA for pause and PFC
17918          */
17919         uint64_t        rx_unsupported_da_pausepfc_frames;
17920         /* Total number of frames received with an unsupported SA */
17921         uint64_t        rx_wrong_sa_frames;
17922         /* Total number of received packets with alignment error */
17923         uint64_t        rx_align_err_frames;
17924         /* Total number of received frames with out-of-range length */
17925         uint64_t        rx_oor_len_frames;
17926         /* Total number of received frames with error termination */
17927         uint64_t        rx_code_err_frames;
17928         /*
17929          * Total number of received frames with a false carrier is
17930          * detected during idle, as defined by RX_ER samples active
17931          * and RXD is 0xE. The event is reported along with the
17932          * statistics generated on the next received frame. Only
17933          * one false carrier condition can be detected and logged
17934          * between frames.
17935          *
17936          * Carrier event, valid for 10M/100M speed modes only.
17937          */
17938         uint64_t        rx_false_carrier_frames;
17939         /* Total number of over-sized frames received */
17940         uint64_t        rx_ovrsz_frames;
17941         /* Total number of jabber packets received */
17942         uint64_t        rx_jbr_frames;
17943         /* Total number of received frames with MTU error */
17944         uint64_t        rx_mtu_err_frames;
17945         /* Total number of received frames with CRC match */
17946         uint64_t        rx_match_crc_frames;
17947         /* Total number of frames received promiscuously */
17948         uint64_t        rx_promiscuous_frames;
17949         /*
17950          * Total number of received frames with one or two VLAN
17951          * tags
17952          */
17953         uint64_t        rx_tagged_frames;
17954         /* Total number of received frames with two VLAN tags */
17955         uint64_t        rx_double_tagged_frames;
17956         /* Total number of truncated frames received */
17957         uint64_t        rx_trunc_frames;
17958         /* Total number of good frames (without errors) received */
17959         uint64_t        rx_good_frames;
17960         /*
17961          * Total number of received PFC frames with transition from
17962          * XON to XOFF on Pri 0
17963          */
17964         uint64_t        rx_pfc_xon2xoff_frames_pri0;
17965         /*
17966          * Total number of received PFC frames with transition from
17967          * XON to XOFF on Pri 1
17968          */
17969         uint64_t        rx_pfc_xon2xoff_frames_pri1;
17970         /*
17971          * Total number of received PFC frames with transition from
17972          * XON to XOFF on Pri 2
17973          */
17974         uint64_t        rx_pfc_xon2xoff_frames_pri2;
17975         /*
17976          * Total number of received PFC frames with transition from
17977          * XON to XOFF on Pri 3
17978          */
17979         uint64_t        rx_pfc_xon2xoff_frames_pri3;
17980         /*
17981          * Total number of received PFC frames with transition from
17982          * XON to XOFF on Pri 4
17983          */
17984         uint64_t        rx_pfc_xon2xoff_frames_pri4;
17985         /*
17986          * Total number of received PFC frames with transition from
17987          * XON to XOFF on Pri 5
17988          */
17989         uint64_t        rx_pfc_xon2xoff_frames_pri5;
17990         /*
17991          * Total number of received PFC frames with transition from
17992          * XON to XOFF on Pri 6
17993          */
17994         uint64_t        rx_pfc_xon2xoff_frames_pri6;
17995         /*
17996          * Total number of received PFC frames with transition from
17997          * XON to XOFF on Pri 7
17998          */
17999         uint64_t        rx_pfc_xon2xoff_frames_pri7;
18000         /*
18001          * Total number of received PFC frames with PFC enabled
18002          * bit for Pri 0
18003          */
18004         uint64_t        rx_pfc_ena_frames_pri0;
18005         /*
18006          * Total number of received PFC frames with PFC enabled
18007          * bit for Pri 1
18008          */
18009         uint64_t        rx_pfc_ena_frames_pri1;
18010         /*
18011          * Total number of received PFC frames with PFC enabled
18012          * bit for Pri 2
18013          */
18014         uint64_t        rx_pfc_ena_frames_pri2;
18015         /*
18016          * Total number of received PFC frames with PFC enabled
18017          * bit for Pri 3
18018          */
18019         uint64_t        rx_pfc_ena_frames_pri3;
18020         /*
18021          * Total number of received PFC frames with PFC enabled
18022          * bit for Pri 4
18023          */
18024         uint64_t        rx_pfc_ena_frames_pri4;
18025         /*
18026          * Total number of received PFC frames with PFC enabled
18027          * bit for Pri 5
18028          */
18029         uint64_t        rx_pfc_ena_frames_pri5;
18030         /*
18031          * Total number of received PFC frames with PFC enabled
18032          * bit for Pri 6
18033          */
18034         uint64_t        rx_pfc_ena_frames_pri6;
18035         /*
18036          * Total number of received PFC frames with PFC enabled
18037          * bit for Pri 7
18038          */
18039         uint64_t        rx_pfc_ena_frames_pri7;
18040         /* Total Number of frames received with SCH CRC error */
18041         uint64_t        rx_sch_crc_err_frames;
18042         /* Total Number of under-sized frames received */
18043         uint64_t        rx_undrsz_frames;
18044         /* Total Number of fragmented frames received */
18045         uint64_t        rx_frag_frames;
18046         /* Total number of RX EEE LPI Events */
18047         uint64_t        rx_eee_lpi_events;
18048         /* EEE LPI Duration Counter on RX */
18049         uint64_t        rx_eee_lpi_duration;
18050         /*
18051          * Total number of physical type Link Level Flow Control
18052          * (LLFC) messages received
18053          */
18054         uint64_t        rx_llfc_physical_msgs;
18055         /*
18056          * Total number of logical type Link Level Flow Control
18057          * (LLFC) messages received
18058          */
18059         uint64_t        rx_llfc_logical_msgs;
18060         /*
18061          * Total number of logical type Link Level Flow Control
18062          * (LLFC) messages received with CRC error
18063          */
18064         uint64_t        rx_llfc_msgs_with_crc_err;
18065         /* Total number of HCFC messages received */
18066         uint64_t        rx_hcfc_msgs;
18067         /* Total number of HCFC messages received with CRC error */
18068         uint64_t        rx_hcfc_msgs_with_crc_err;
18069         /* Total number of received bytes */
18070         uint64_t        rx_bytes;
18071         /* Total number of bytes received in runt frames */
18072         uint64_t        rx_runt_bytes;
18073         /* Total number of runt frames received */
18074         uint64_t        rx_runt_frames;
18075         /* Total Rx Discards per Port reported by STATS block */
18076         uint64_t        rx_stat_discard;
18077         uint64_t        rx_stat_err;
18078 } __rte_packed;
18079
18080 /********************
18081  * hwrm_port_qstats *
18082  ********************/
18083
18084
18085 /* hwrm_port_qstats_input (size:320b/40B) */
18086 struct hwrm_port_qstats_input {
18087         /* The HWRM command request type. */
18088         uint16_t        req_type;
18089         /*
18090          * The completion ring to send the completion event on. This should
18091          * be the NQ ID returned from the `nq_alloc` HWRM command.
18092          */
18093         uint16_t        cmpl_ring;
18094         /*
18095          * The sequence ID is used by the driver for tracking multiple
18096          * commands. This ID is treated as opaque data by the firmware and
18097          * the value is returned in the `hwrm_resp_hdr` upon completion.
18098          */
18099         uint16_t        seq_id;
18100         /*
18101          * The target ID of the command:
18102          * * 0x0-0xFFF8 - The function ID
18103          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18104          * * 0xFFFD - Reserved for user-space HWRM interface
18105          * * 0xFFFF - HWRM
18106          */
18107         uint16_t        target_id;
18108         /*
18109          * A physical address pointer pointing to a host buffer that the
18110          * command's response data will be written. This can be either a host
18111          * physical address (HPA) or a guest physical address (GPA) and must
18112          * point to a physically contiguous block of memory.
18113          */
18114         uint64_t        resp_addr;
18115         /* Port ID of port that is being queried. */
18116         uint16_t        port_id;
18117         uint8_t flags;
18118         /* This value is not used to avoid backward compatibility issues. */
18119         #define HWRM_PORT_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
18120         /*
18121          * This bit is set to 1 when request is for a counter mask,
18122          * representing the width of each of the stats counters, rather
18123          * than counters themselves.
18124          */
18125         #define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
18126         #define HWRM_PORT_QSTATS_INPUT_FLAGS_LAST \
18127                 HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK
18128         uint8_t unused_0[5];
18129         /*
18130          * This is the host address where
18131          * Tx port statistics will be stored
18132          */
18133         uint64_t        tx_stat_host_addr;
18134         /*
18135          * This is the host address where
18136          * Rx port statistics will be stored
18137          */
18138         uint64_t        rx_stat_host_addr;
18139 } __rte_packed;
18140
18141 /* hwrm_port_qstats_output (size:128b/16B) */
18142 struct hwrm_port_qstats_output {
18143         /* The specific error status for the command. */
18144         uint16_t        error_code;
18145         /* The HWRM command request type. */
18146         uint16_t        req_type;
18147         /* The sequence ID from the original command. */
18148         uint16_t        seq_id;
18149         /* The length of the response data in number of bytes. */
18150         uint16_t        resp_len;
18151         /* The size of TX port statistics block in bytes. */
18152         uint16_t        tx_stat_size;
18153         /* The size of RX port statistics block in bytes. */
18154         uint16_t        rx_stat_size;
18155         uint8_t unused_0[3];
18156         /*
18157          * This field is used in Output records to indicate that the output
18158          * is completely written to RAM.  This field should be read as '1'
18159          * to indicate that the output has been completely written.
18160          * When writing a command completion or response to an internal processor,
18161          * the order of writes has to be such that this field is written last.
18162          */
18163         uint8_t valid;
18164 } __rte_packed;
18165
18166 /* Port Tx Statistics extended Format */
18167 /* tx_port_stats_ext (size:2048b/256B) */
18168 struct tx_port_stats_ext {
18169         /* Total number of tx bytes count on cos queue 0 */
18170         uint64_t        tx_bytes_cos0;
18171         /* Total number of tx bytes count on cos queue 1 */
18172         uint64_t        tx_bytes_cos1;
18173         /* Total number of tx bytes count on cos queue 2 */
18174         uint64_t        tx_bytes_cos2;
18175         /* Total number of tx bytes count on cos queue 3 */
18176         uint64_t        tx_bytes_cos3;
18177         /* Total number of tx bytes count on cos queue 4 */
18178         uint64_t        tx_bytes_cos4;
18179         /* Total number of tx bytes count on cos queue 5 */
18180         uint64_t        tx_bytes_cos5;
18181         /* Total number of tx bytes count on cos queue 6 */
18182         uint64_t        tx_bytes_cos6;
18183         /* Total number of tx bytes count on cos queue 7 */
18184         uint64_t        tx_bytes_cos7;
18185         /* Total number of tx packets count on cos queue 0 */
18186         uint64_t        tx_packets_cos0;
18187         /* Total number of tx packets count on cos queue 1 */
18188         uint64_t        tx_packets_cos1;
18189         /* Total number of tx packets count on cos queue 2 */
18190         uint64_t        tx_packets_cos2;
18191         /* Total number of tx packets count on cos queue 3 */
18192         uint64_t        tx_packets_cos3;
18193         /* Total number of tx packets count on cos queue 4 */
18194         uint64_t        tx_packets_cos4;
18195         /* Total number of tx packets count on cos queue 5 */
18196         uint64_t        tx_packets_cos5;
18197         /* Total number of tx packets count on cos queue 6 */
18198         uint64_t        tx_packets_cos6;
18199         /* Total number of tx packets count on cos queue 7 */
18200         uint64_t        tx_packets_cos7;
18201         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
18202         uint64_t        pfc_pri0_tx_duration_us;
18203         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
18204         uint64_t        pfc_pri0_tx_transitions;
18205         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
18206         uint64_t        pfc_pri1_tx_duration_us;
18207         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
18208         uint64_t        pfc_pri1_tx_transitions;
18209         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
18210         uint64_t        pfc_pri2_tx_duration_us;
18211         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
18212         uint64_t        pfc_pri2_tx_transitions;
18213         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
18214         uint64_t        pfc_pri3_tx_duration_us;
18215         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
18216         uint64_t        pfc_pri3_tx_transitions;
18217         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
18218         uint64_t        pfc_pri4_tx_duration_us;
18219         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
18220         uint64_t        pfc_pri4_tx_transitions;
18221         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
18222         uint64_t        pfc_pri5_tx_duration_us;
18223         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
18224         uint64_t        pfc_pri5_tx_transitions;
18225         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
18226         uint64_t        pfc_pri6_tx_duration_us;
18227         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
18228         uint64_t        pfc_pri6_tx_transitions;
18229         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
18230         uint64_t        pfc_pri7_tx_duration_us;
18231         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
18232         uint64_t        pfc_pri7_tx_transitions;
18233 } __rte_packed;
18234
18235 /* Port Rx Statistics extended Format */
18236 /* rx_port_stats_ext (size:3648b/456B) */
18237 struct rx_port_stats_ext {
18238         /* Number of times link state changed to down */
18239         uint64_t        link_down_events;
18240         /* Number of times the idle rings with pause bit are found */
18241         uint64_t        continuous_pause_events;
18242         /* Number of times the active rings pause bit resumed back */
18243         uint64_t        resume_pause_events;
18244         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
18245         uint64_t        continuous_roce_pause_events;
18246         /* Number of times, the ROCE cos queue PFC is enabled back */
18247         uint64_t        resume_roce_pause_events;
18248         /* Total number of rx bytes count on cos queue 0 */
18249         uint64_t        rx_bytes_cos0;
18250         /* Total number of rx bytes count on cos queue 1 */
18251         uint64_t        rx_bytes_cos1;
18252         /* Total number of rx bytes count on cos queue 2 */
18253         uint64_t        rx_bytes_cos2;
18254         /* Total number of rx bytes count on cos queue 3 */
18255         uint64_t        rx_bytes_cos3;
18256         /* Total number of rx bytes count on cos queue 4 */
18257         uint64_t        rx_bytes_cos4;
18258         /* Total number of rx bytes count on cos queue 5 */
18259         uint64_t        rx_bytes_cos5;
18260         /* Total number of rx bytes count on cos queue 6 */
18261         uint64_t        rx_bytes_cos6;
18262         /* Total number of rx bytes count on cos queue 7 */
18263         uint64_t        rx_bytes_cos7;
18264         /* Total number of rx packets count on cos queue 0 */
18265         uint64_t        rx_packets_cos0;
18266         /* Total number of rx packets count on cos queue 1 */
18267         uint64_t        rx_packets_cos1;
18268         /* Total number of rx packets count on cos queue 2 */
18269         uint64_t        rx_packets_cos2;
18270         /* Total number of rx packets count on cos queue 3 */
18271         uint64_t        rx_packets_cos3;
18272         /* Total number of rx packets count on cos queue 4 */
18273         uint64_t        rx_packets_cos4;
18274         /* Total number of rx packets count on cos queue 5 */
18275         uint64_t        rx_packets_cos5;
18276         /* Total number of rx packets count on cos queue 6 */
18277         uint64_t        rx_packets_cos6;
18278         /* Total number of rx packets count on cos queue 7 */
18279         uint64_t        rx_packets_cos7;
18280         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
18281         uint64_t        pfc_pri0_rx_duration_us;
18282         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
18283         uint64_t        pfc_pri0_rx_transitions;
18284         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
18285         uint64_t        pfc_pri1_rx_duration_us;
18286         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
18287         uint64_t        pfc_pri1_rx_transitions;
18288         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
18289         uint64_t        pfc_pri2_rx_duration_us;
18290         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
18291         uint64_t        pfc_pri2_rx_transitions;
18292         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
18293         uint64_t        pfc_pri3_rx_duration_us;
18294         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
18295         uint64_t        pfc_pri3_rx_transitions;
18296         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
18297         uint64_t        pfc_pri4_rx_duration_us;
18298         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
18299         uint64_t        pfc_pri4_rx_transitions;
18300         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
18301         uint64_t        pfc_pri5_rx_duration_us;
18302         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
18303         uint64_t        pfc_pri5_rx_transitions;
18304         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
18305         uint64_t        pfc_pri6_rx_duration_us;
18306         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
18307         uint64_t        pfc_pri6_rx_transitions;
18308         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
18309         uint64_t        pfc_pri7_rx_duration_us;
18310         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
18311         uint64_t        pfc_pri7_rx_transitions;
18312         /* Total number of received bits */
18313         uint64_t        rx_bits;
18314         /* The number of events where the port receive buffer was over 85% full */
18315         uint64_t        rx_buffer_passed_threshold;
18316         /*
18317          * The number of symbol errors that wasn't corrected by FEC correction
18318          * alogirithm
18319          */
18320         uint64_t        rx_pcs_symbol_err;
18321         /* The number of corrected bits on the port according to active FEC */
18322         uint64_t        rx_corrected_bits;
18323         /* Total number of rx discard bytes count on cos queue 0 */
18324         uint64_t        rx_discard_bytes_cos0;
18325         /* Total number of rx discard bytes count on cos queue 1 */
18326         uint64_t        rx_discard_bytes_cos1;
18327         /* Total number of rx discard bytes count on cos queue 2 */
18328         uint64_t        rx_discard_bytes_cos2;
18329         /* Total number of rx discard bytes count on cos queue 3 */
18330         uint64_t        rx_discard_bytes_cos3;
18331         /* Total number of rx discard bytes count on cos queue 4 */
18332         uint64_t        rx_discard_bytes_cos4;
18333         /* Total number of rx discard bytes count on cos queue 5 */
18334         uint64_t        rx_discard_bytes_cos5;
18335         /* Total number of rx discard bytes count on cos queue 6 */
18336         uint64_t        rx_discard_bytes_cos6;
18337         /* Total number of rx discard bytes count on cos queue 7 */
18338         uint64_t        rx_discard_bytes_cos7;
18339         /* Total number of rx discard packets count on cos queue 0 */
18340         uint64_t        rx_discard_packets_cos0;
18341         /* Total number of rx discard packets count on cos queue 1 */
18342         uint64_t        rx_discard_packets_cos1;
18343         /* Total number of rx discard packets count on cos queue 2 */
18344         uint64_t        rx_discard_packets_cos2;
18345         /* Total number of rx discard packets count on cos queue 3 */
18346         uint64_t        rx_discard_packets_cos3;
18347         /* Total number of rx discard packets count on cos queue 4 */
18348         uint64_t        rx_discard_packets_cos4;
18349         /* Total number of rx discard packets count on cos queue 5 */
18350         uint64_t        rx_discard_packets_cos5;
18351         /* Total number of rx discard packets count on cos queue 6 */
18352         uint64_t        rx_discard_packets_cos6;
18353         /* Total number of rx discard packets count on cos queue 7 */
18354         uint64_t        rx_discard_packets_cos7;
18355 } __rte_packed;
18356
18357 /*
18358  * Port Rx Statistics extended PFC WatchDog Format.
18359  * StormDetect and StormRevert event determination is based
18360  * on an integration period and a percentage threshold.
18361  * StormDetect event - when percentage of XOFF frames received
18362  * within an integration period exceeds the configured threshold.
18363  * StormRevert event - when percentage of XON frames received
18364  * within an integration period exceeds the configured threshold.
18365  * Actual number of XOFF/XON frames for the events to be triggered
18366  * depends on both configured integration period and sampling rate.
18367  * The statistics in this structure represent counts of specified
18368  * events from the moment the feature (PFC WatchDog) is enabled via
18369  * hwrm_queue_pfc_enable_cfg call.
18370  */
18371 /* rx_port_stats_ext_pfc_wd (size:5120b/640B) */
18372 struct rx_port_stats_ext_pfc_wd {
18373         /*
18374          * Total number of PFC WatchDog StormDetect events detected
18375          * for Pri 0
18376          */
18377         uint64_t        rx_pfc_watchdog_storms_detected_pri0;
18378         /*
18379          * Total number of PFC WatchDog StormDetect events detected
18380          * for Pri 1
18381          */
18382         uint64_t        rx_pfc_watchdog_storms_detected_pri1;
18383         /*
18384          * Total number of PFC WatchDog StormDetect events detected
18385          * for Pri 2
18386          */
18387         uint64_t        rx_pfc_watchdog_storms_detected_pri2;
18388         /*
18389          * Total number of PFC WatchDog StormDetect events detected
18390          * for Pri 3
18391          */
18392         uint64_t        rx_pfc_watchdog_storms_detected_pri3;
18393         /*
18394          * Total number of PFC WatchDog StormDetect events detected
18395          * for Pri 4
18396          */
18397         uint64_t        rx_pfc_watchdog_storms_detected_pri4;
18398         /*
18399          * Total number of PFC WatchDog StormDetect events detected
18400          * for Pri 5
18401          */
18402         uint64_t        rx_pfc_watchdog_storms_detected_pri5;
18403         /*
18404          * Total number of PFC WatchDog StormDetect events detected
18405          * for Pri 6
18406          */
18407         uint64_t        rx_pfc_watchdog_storms_detected_pri6;
18408         /*
18409          * Total number of PFC WatchDog StormDetect events detected
18410          * for Pri 7
18411          */
18412         uint64_t        rx_pfc_watchdog_storms_detected_pri7;
18413         /*
18414          * Total number of PFC WatchDog StormRevert events detected
18415          * for Pri 0
18416          */
18417         uint64_t        rx_pfc_watchdog_storms_reverted_pri0;
18418         /*
18419          * Total number of PFC WatchDog StormRevert events detected
18420          * for Pri 1
18421          */
18422         uint64_t        rx_pfc_watchdog_storms_reverted_pri1;
18423         /*
18424          * Total number of PFC WatchDog StormRevert events detected
18425          * for Pri 2
18426          */
18427         uint64_t        rx_pfc_watchdog_storms_reverted_pri2;
18428         /*
18429          * Total number of PFC WatchDog StormRevert events detected
18430          * for Pri 3
18431          */
18432         uint64_t        rx_pfc_watchdog_storms_reverted_pri3;
18433         /*
18434          * Total number of PFC WatchDog StormRevert events detected
18435          * for Pri 4
18436          */
18437         uint64_t        rx_pfc_watchdog_storms_reverted_pri4;
18438         /*
18439          * Total number of PFC WatchDog StormRevert events detected
18440          * for Pri 5
18441          */
18442         uint64_t        rx_pfc_watchdog_storms_reverted_pri5;
18443         /*
18444          * Total number of PFC WatchDog StormRevert events detected
18445          * for Pri 6
18446          */
18447         uint64_t        rx_pfc_watchdog_storms_reverted_pri6;
18448         /*
18449          * Total number of PFC WatchDog StormRevert events detected
18450          * for Pri 7
18451          */
18452         uint64_t        rx_pfc_watchdog_storms_reverted_pri7;
18453         /*
18454          * Total number of packets received during PFC watchdog storm
18455          * for pri 0
18456          */
18457         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri0;
18458         /*
18459          * Total number of packets received during PFC watchdog storm
18460          * for pri 1
18461          */
18462         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri1;
18463         /*
18464          * Total number of packets received during PFC watchdog storm
18465          *  for pri 2
18466          */
18467         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri2;
18468         /*
18469          * Total number of packets received during PFC watchdog storm
18470          *  for pri 3
18471          */
18472         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri3;
18473         /*
18474          * Total number of packets received during PFC watchdog storm
18475          *  for pri 4
18476          */
18477         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri4;
18478         /*
18479          * Total number of packets received during PFC watchdog storm
18480          *  for pri 5
18481          */
18482         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri5;
18483         /*
18484          * Total number of packets received during PFC watchdog storm
18485          *  for pri 6
18486          */
18487         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri6;
18488         /*
18489          * Total number of packets received during PFC watchdog storm
18490          *  for pri 7
18491          */
18492         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri7;
18493         /*
18494          * Total number of bytes received during PFC watchdog storm
18495          * for pri 0
18496          */
18497         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri0;
18498         /*
18499          * Total number of bytes received during PFC watchdog storm
18500          * for pri 1
18501          */
18502         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri1;
18503         /*
18504          * Total number of bytes received during PFC watchdog storm
18505          *  for pri 2
18506          */
18507         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri2;
18508         /*
18509          * Total number of bytes received during PFC watchdog storm
18510          *  for pri 3
18511          */
18512         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri3;
18513         /*
18514          * Total number of bytes received during PFC watchdog storm
18515          *  for pri 4
18516          */
18517         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri4;
18518         /*
18519          * Total number of bytes received during PFC watchdog storm
18520          *  for pri 5
18521          */
18522         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri5;
18523         /*
18524          * Total number of bytes received during PFC watchdog storm
18525          *  for pri 6
18526          */
18527         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri6;
18528         /*
18529          * Total number of bytes received during PFC watchdog storm
18530          *  for pri 7
18531          */
18532         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri7;
18533         /*
18534          * Total number of packets dropped on rx during PFC watchdog storm
18535          * for pri 0
18536          */
18537         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri0;
18538         /*
18539          * Total number of packets dropped on rx during PFC watchdog storm
18540          * for pri 1
18541          */
18542         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri1;
18543         /*
18544          * Total number of packets dropped on rx during PFC watchdog storm
18545          *  for pri 2
18546          */
18547         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri2;
18548         /*
18549          * Total number of packets dropped on rx during PFC watchdog storm
18550          *  for pri 3
18551          */
18552         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri3;
18553         /*
18554          * Total number of packets dropped on rx during PFC watchdog storm
18555          *  for pri 4
18556          */
18557         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri4;
18558         /*
18559          * Total number of packets dropped on rx during PFC watchdog storm
18560          *  for pri 5
18561          */
18562         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri5;
18563         /*
18564          * Total number of packets dropped on rx during PFC watchdog storm
18565          *  for pri 6
18566          */
18567         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri6;
18568         /*
18569          * Total number of packets dropped on rx during PFC watchdog storm
18570          *  for pri 7
18571          */
18572         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri7;
18573         /*
18574          * Total number of bytes dropped on rx during PFC watchdog storm
18575          * for pri 0
18576          */
18577         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri0;
18578         /*
18579          * Total number of bytes dropped on rx during PFC watchdog storm
18580          * for pri 1
18581          */
18582         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri1;
18583         /*
18584          * Total number of bytes dropped on rx during PFC watchdog storm
18585          *  for pri 2
18586          */
18587         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri2;
18588         /*
18589          * Total number of bytes dropped on rx during PFC watchdog storm
18590          *  for pri 3
18591          */
18592         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri3;
18593         /*
18594          * Total number of bytes dropped on rx during PFC watchdog storm
18595          *  for pri 4
18596          */
18597         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri4;
18598         /*
18599          * Total number of bytes dropped on rx during PFC watchdog storm
18600          *  for pri 5
18601          */
18602         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri5;
18603         /*
18604          * Total number of bytes dropped on rx during PFC watchdog storm
18605          *  for pri 6
18606          */
18607         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri6;
18608         /*
18609          * Total number of bytes dropped on rx during PFC watchdog storm
18610          *  for pri 7
18611          */
18612         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri7;
18613         /*
18614          * Number of packets received during last PFC watchdog storm
18615          * for pri 0
18616          */
18617         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri0;
18618         /*
18619          * Number of packets received during last PFC watchdog storm
18620          * for pri 1
18621          */
18622         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri1;
18623         /*
18624          * Number of packets received during last PFC watchdog storm
18625          *  for pri 2
18626          */
18627         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri2;
18628         /*
18629          * Number of packets received during last PFC watchdog storm
18630          *  for pri 3
18631          */
18632         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri3;
18633         /*
18634          * Number of packets received during last PFC watchdog storm
18635          *  for pri 4
18636          */
18637         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri4;
18638         /*
18639          * Number of packets received during last PFC watchdog storm
18640          *  for pri 5
18641          */
18642         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri5;
18643         /*
18644          * Number of packets received during last PFC watchdog storm
18645          *  for pri 6
18646          */
18647         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri6;
18648         /*
18649          * Number of packets received during last PFC watchdog storm
18650          *  for pri 7
18651          */
18652         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri7;
18653         /*
18654          * Number of bytes received during last PFC watchdog storm
18655          * for pri 0
18656          */
18657         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri0;
18658         /*
18659          * Number of bytes received during last PFC watchdog storm
18660          * for pri 1
18661          */
18662         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri1;
18663         /*
18664          * Number of bytes received during last PFC watchdog storm
18665          *  for pri 2
18666          */
18667         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri2;
18668         /*
18669          * Number of bytes received during last PFC watchdog storm
18670          *  for pri 3
18671          */
18672         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri3;
18673         /*
18674          * Number of bytes received during last PFC watchdog storm
18675          *  for pri 4
18676          */
18677         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri4;
18678         /*
18679          * Number of bytes received during last PFC watchdog storm
18680          *  for pri 5
18681          */
18682         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri5;
18683         /*
18684          * Number of bytes received during last PFC watchdog storm
18685          *  for pri 6
18686          */
18687         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri6;
18688         /*
18689          * Number of bytes received during last PFC watchdog storm
18690          *  for pri 7
18691          */
18692         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri7;
18693         /*
18694          * Number of packets dropped on rx during last PFC watchdog storm
18695          * for pri 0
18696          */
18697         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri0;
18698         /*
18699          * Number of packets dropped on rx during last PFC watchdog storm
18700          * for pri 1
18701          */
18702         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri1;
18703         /*
18704          * Number of packets dropped on rx during last PFC watchdog storm
18705          *  for pri 2
18706          */
18707         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri2;
18708         /*
18709          * Number of packets dropped on rx during last PFC watchdog storm
18710          *  for pri 3
18711          */
18712         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri3;
18713         /*
18714          * Number of packets dropped on rx during last PFC watchdog storm
18715          *  for pri 4
18716          */
18717         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri4;
18718         /*
18719          * Number of packets dropped on rx during last PFC watchdog storm
18720          *  for pri 5
18721          */
18722         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri5;
18723         /*
18724          * Number of packets dropped on rx during last PFC watchdog storm
18725          *  for pri 6
18726          */
18727         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri6;
18728         /*
18729          * Number of packets dropped on rx during last PFC watchdog storm
18730          *  for pri 7
18731          */
18732         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri7;
18733         /*
18734          * Total number of bytes dropped on rx during PFC watchdog storm
18735          * for pri 0
18736          */
18737         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri0;
18738         /*
18739          * Number of bytes dropped on rx during last PFC watchdog storm
18740          * for pri 1
18741          */
18742         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri1;
18743         /*
18744          * Number of bytes dropped on rx during last PFC watchdog storm
18745          *  for pri 2
18746          */
18747         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri2;
18748         /*
18749          * Number of bytes dropped on rx during last PFC watchdog storm
18750          *  for pri 3
18751          */
18752         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri3;
18753         /*
18754          * Number of bytes dropped on rx during last PFC watchdog storm
18755          *  for pri 4
18756          */
18757         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri4;
18758         /*
18759          * Number of bytes dropped on rx during last PFC watchdog storm
18760          *  for pri 5
18761          */
18762         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri5;
18763         /*
18764          * Number of bytes dropped on rx during last PFC watchdog storm
18765          *  for pri 6
18766          */
18767         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri6;
18768         /*
18769          * Number of bytes dropped on rx during last PFC watchdog storm
18770          *  for pri 7
18771          */
18772         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri7;
18773 } __rte_packed;
18774
18775 /************************
18776  * hwrm_port_qstats_ext *
18777  ************************/
18778
18779
18780 /* hwrm_port_qstats_ext_input (size:320b/40B) */
18781 struct hwrm_port_qstats_ext_input {
18782         /* The HWRM command request type. */
18783         uint16_t        req_type;
18784         /*
18785          * The completion ring to send the completion event on. This should
18786          * be the NQ ID returned from the `nq_alloc` HWRM command.
18787          */
18788         uint16_t        cmpl_ring;
18789         /*
18790          * The sequence ID is used by the driver for tracking multiple
18791          * commands. This ID is treated as opaque data by the firmware and
18792          * the value is returned in the `hwrm_resp_hdr` upon completion.
18793          */
18794         uint16_t        seq_id;
18795         /*
18796          * The target ID of the command:
18797          * * 0x0-0xFFF8 - The function ID
18798          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18799          * * 0xFFFD - Reserved for user-space HWRM interface
18800          * * 0xFFFF - HWRM
18801          */
18802         uint16_t        target_id;
18803         /*
18804          * A physical address pointer pointing to a host buffer that the
18805          * command's response data will be written. This can be either a host
18806          * physical address (HPA) or a guest physical address (GPA) and must
18807          * point to a physically contiguous block of memory.
18808          */
18809         uint64_t        resp_addr;
18810         /* Port ID of port that is being queried. */
18811         uint16_t        port_id;
18812         /*
18813          * The size of TX port extended
18814          * statistics block in bytes.
18815          */
18816         uint16_t        tx_stat_size;
18817         /*
18818          * The size of RX port extended
18819          * statistics block in bytes
18820          */
18821         uint16_t        rx_stat_size;
18822         uint8_t flags;
18823         /* This value is not used to avoid backward compatibility issues. */
18824         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
18825         /*
18826          * This bit is set to 1 when request is for the counter mask,
18827          * representing width of each of the stats counters, rather than
18828          * counters themselves.
18829          */
18830         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
18831         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_LAST \
18832                 HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
18833         uint8_t unused_0;
18834         /*
18835          * This is the host address where
18836          * Tx port statistics will be stored
18837          */
18838         uint64_t        tx_stat_host_addr;
18839         /*
18840          * This is the host address where
18841          * Rx port statistics will be stored
18842          */
18843         uint64_t        rx_stat_host_addr;
18844 } __rte_packed;
18845
18846 /* hwrm_port_qstats_ext_output (size:128b/16B) */
18847 struct hwrm_port_qstats_ext_output {
18848         /* The specific error status for the command. */
18849         uint16_t        error_code;
18850         /* The HWRM command request type. */
18851         uint16_t        req_type;
18852         /* The sequence ID from the original command. */
18853         uint16_t        seq_id;
18854         /* The length of the response data in number of bytes. */
18855         uint16_t        resp_len;
18856         /* The size of TX port statistics block in bytes. */
18857         uint16_t        tx_stat_size;
18858         /* The size of RX port statistics block in bytes. */
18859         uint16_t        rx_stat_size;
18860         /* Total number of active cos queues available. */
18861         uint16_t        total_active_cos_queues;
18862         uint8_t flags;
18863         /*
18864          * If set to 1, then this field indicates that clear
18865          * roce specific counters is supported.
18866          */
18867         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
18868                 UINT32_C(0x1)
18869         /*
18870          * This field is used in Output records to indicate that the output
18871          * is completely written to RAM.  This field should be read as '1'
18872          * to indicate that the output has been completely written.
18873          * When writing a command completion or response to an internal processor,
18874          * the order of writes has to be such that this field is written last.
18875          */
18876         uint8_t valid;
18877 } __rte_packed;
18878
18879 /*******************************
18880  * hwrm_port_qstats_ext_pfc_wd *
18881  *******************************/
18882
18883
18884 /* hwrm_port_qstats_ext_pfc_wd_input (size:256b/32B) */
18885 struct hwrm_port_qstats_ext_pfc_wd_input {
18886         /* The HWRM command request type. */
18887         uint16_t        req_type;
18888         /*
18889          * The completion ring to send the completion event on. This should
18890          * be the NQ ID returned from the `nq_alloc` HWRM command.
18891          */
18892         uint16_t        cmpl_ring;
18893         /*
18894          * The sequence ID is used by the driver for tracking multiple
18895          * commands. This ID is treated as opaque data by the firmware and
18896          * the value is returned in the `hwrm_resp_hdr` upon completion.
18897          */
18898         uint16_t        seq_id;
18899         /*
18900          * The target ID of the command:
18901          * * 0x0-0xFFF8 - The function ID
18902          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18903          * * 0xFFFD - Reserved for user-space HWRM interface
18904          * * 0xFFFF - HWRM
18905          */
18906         uint16_t        target_id;
18907         /*
18908          * A physical address pointer pointing to a host buffer that the
18909          * command's response data will be written. This can be either a host
18910          * physical address (HPA) or a guest physical address (GPA) and must
18911          * point to a physically contiguous block of memory.
18912          */
18913         uint64_t        resp_addr;
18914         /* Port ID of port that is being queried. */
18915         uint16_t        port_id;
18916         /*
18917          * The size of rx_port_stats_ext_pfc_wd
18918          * block in bytes
18919          */
18920         uint16_t        pfc_wd_stat_size;
18921         uint8_t unused_0[4];
18922         /*
18923          * This is the host address where
18924          * rx_port_stats_ext_pfc_wd will be stored
18925          */
18926         uint64_t        pfc_wd_stat_host_addr;
18927 } __rte_packed;
18928
18929 /* hwrm_port_qstats_ext_pfc_wd_output (size:128b/16B) */
18930 struct hwrm_port_qstats_ext_pfc_wd_output {
18931         /* The specific error status for the command. */
18932         uint16_t        error_code;
18933         /* The HWRM command request type. */
18934         uint16_t        req_type;
18935         /* The sequence ID from the original command. */
18936         uint16_t        seq_id;
18937         /* The length of the response data in number of bytes. */
18938         uint16_t        resp_len;
18939         /*
18940          * The size of rx_port_stats_ext_pfc_wd
18941          * statistics block in bytes.
18942          */
18943         uint16_t        pfc_wd_stat_size;
18944         uint8_t flags;
18945         /*
18946          * This field is used in Output records to indicate that the output
18947          * is completely written to RAM.  This field should be read as '1'
18948          * to indicate that the output has been completely written.
18949          * When writing a command completion or response to an internal processor,
18950          * the order of writes has to be such that this field is written last.
18951          */
18952         uint8_t valid;
18953         uint8_t unused_0[4];
18954 } __rte_packed;
18955
18956 /*************************
18957  * hwrm_port_lpbk_qstats *
18958  *************************/
18959
18960
18961 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
18962 struct hwrm_port_lpbk_qstats_input {
18963         /* The HWRM command request type. */
18964         uint16_t        req_type;
18965         /*
18966          * The completion ring to send the completion event on. This should
18967          * be the NQ ID returned from the `nq_alloc` HWRM command.
18968          */
18969         uint16_t        cmpl_ring;
18970         /*
18971          * The sequence ID is used by the driver for tracking multiple
18972          * commands. This ID is treated as opaque data by the firmware and
18973          * the value is returned in the `hwrm_resp_hdr` upon completion.
18974          */
18975         uint16_t        seq_id;
18976         /*
18977          * The target ID of the command:
18978          * * 0x0-0xFFF8 - The function ID
18979          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18980          * * 0xFFFD - Reserved for user-space HWRM interface
18981          * * 0xFFFF - HWRM
18982          */
18983         uint16_t        target_id;
18984         /*
18985          * A physical address pointer pointing to a host buffer that the
18986          * command's response data will be written. This can be either a host
18987          * physical address (HPA) or a guest physical address (GPA) and must
18988          * point to a physically contiguous block of memory.
18989          */
18990         uint64_t        resp_addr;
18991 } __rte_packed;
18992
18993 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
18994 struct hwrm_port_lpbk_qstats_output {
18995         /* The specific error status for the command. */
18996         uint16_t        error_code;
18997         /* The HWRM command request type. */
18998         uint16_t        req_type;
18999         /* The sequence ID from the original command. */
19000         uint16_t        seq_id;
19001         /* The length of the response data in number of bytes. */
19002         uint16_t        resp_len;
19003         /* Number of transmitted unicast frames */
19004         uint64_t        lpbk_ucast_frames;
19005         /* Number of transmitted multicast frames */
19006         uint64_t        lpbk_mcast_frames;
19007         /* Number of transmitted broadcast frames */
19008         uint64_t        lpbk_bcast_frames;
19009         /* Number of transmitted bytes for unicast traffic */
19010         uint64_t        lpbk_ucast_bytes;
19011         /* Number of transmitted bytes for multicast traffic */
19012         uint64_t        lpbk_mcast_bytes;
19013         /* Number of transmitted bytes for broadcast traffic */
19014         uint64_t        lpbk_bcast_bytes;
19015         /* Total Tx Drops for loopback traffic reported by STATS block */
19016         uint64_t        tx_stat_discard;
19017         /* Total Tx Error Drops for loopback traffic reported by STATS block */
19018         uint64_t        tx_stat_error;
19019         /* Total Rx Drops for loopback traffic reported by STATS block */
19020         uint64_t        rx_stat_discard;
19021         /* Total Rx Error Drops for loopback traffic reported by STATS block */
19022         uint64_t        rx_stat_error;
19023         uint8_t unused_0[7];
19024         /*
19025          * This field is used in Output records to indicate that the output
19026          * is completely written to RAM.  This field should be read as '1'
19027          * to indicate that the output has been completely written.
19028          * When writing a command completion or response to an internal processor,
19029          * the order of writes has to be such that this field is written last.
19030          */
19031         uint8_t valid;
19032 } __rte_packed;
19033
19034 /************************
19035  * hwrm_port_ecn_qstats *
19036  ************************/
19037
19038
19039 /* hwrm_port_ecn_qstats_input (size:192b/24B) */
19040 struct hwrm_port_ecn_qstats_input {
19041         /* The HWRM command request type. */
19042         uint16_t        req_type;
19043         /*
19044          * The completion ring to send the completion event on. This should
19045          * be the NQ ID returned from the `nq_alloc` HWRM command.
19046          */
19047         uint16_t        cmpl_ring;
19048         /*
19049          * The sequence ID is used by the driver for tracking multiple
19050          * commands. This ID is treated as opaque data by the firmware and
19051          * the value is returned in the `hwrm_resp_hdr` upon completion.
19052          */
19053         uint16_t        seq_id;
19054         /*
19055          * The target ID of the command:
19056          * * 0x0-0xFFF8 - The function ID
19057          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19058          * * 0xFFFD - Reserved for user-space HWRM interface
19059          * * 0xFFFF - HWRM
19060          */
19061         uint16_t        target_id;
19062         /*
19063          * A physical address pointer pointing to a host buffer that the
19064          * command's response data will be written. This can be either a host
19065          * physical address (HPA) or a guest physical address (GPA) and must
19066          * point to a physically contiguous block of memory.
19067          */
19068         uint64_t        resp_addr;
19069         /*
19070          * Port ID of port that is being queried. Unused if NIC is in
19071          * multi-host mode.
19072          */
19073         uint16_t        port_id;
19074         uint8_t unused_0[6];
19075 } __rte_packed;
19076
19077 /* hwrm_port_ecn_qstats_output (size:384b/48B) */
19078 struct hwrm_port_ecn_qstats_output {
19079         /* The specific error status for the command. */
19080         uint16_t        error_code;
19081         /* The HWRM command request type. */
19082         uint16_t        req_type;
19083         /* The sequence ID from the original command. */
19084         uint16_t        seq_id;
19085         /* The length of the response data in number of bytes. */
19086         uint16_t        resp_len;
19087         /* Number of packets marked in CoS queue 0. */
19088         uint32_t        mark_cnt_cos0;
19089         /* Number of packets marked in CoS queue 1. */
19090         uint32_t        mark_cnt_cos1;
19091         /* Number of packets marked in CoS queue 2. */
19092         uint32_t        mark_cnt_cos2;
19093         /* Number of packets marked in CoS queue 3. */
19094         uint32_t        mark_cnt_cos3;
19095         /* Number of packets marked in CoS queue 4. */
19096         uint32_t        mark_cnt_cos4;
19097         /* Number of packets marked in CoS queue 5. */
19098         uint32_t        mark_cnt_cos5;
19099         /* Number of packets marked in CoS queue 6. */
19100         uint32_t        mark_cnt_cos6;
19101         /* Number of packets marked in CoS queue 7. */
19102         uint32_t        mark_cnt_cos7;
19103         /*
19104          * Bitmask that indicates which CoS queues have ECN marking enabled.
19105          * Bit i corresponds to CoS queue i.
19106          */
19107         uint8_t mark_en;
19108         uint8_t unused_0[6];
19109         /*
19110          * This field is used in Output records to indicate that the output
19111          * is completely written to RAM.  This field should be read as '1'
19112          * to indicate that the output has been completely written.
19113          * When writing a command completion or response to an internal processor,
19114          * the order of writes has to be such that this field is written last.
19115          */
19116         uint8_t valid;
19117 } __rte_packed;
19118
19119 /***********************
19120  * hwrm_port_clr_stats *
19121  ***********************/
19122
19123
19124 /* hwrm_port_clr_stats_input (size:192b/24B) */
19125 struct hwrm_port_clr_stats_input {
19126         /* The HWRM command request type. */
19127         uint16_t        req_type;
19128         /*
19129          * The completion ring to send the completion event on. This should
19130          * be the NQ ID returned from the `nq_alloc` HWRM command.
19131          */
19132         uint16_t        cmpl_ring;
19133         /*
19134          * The sequence ID is used by the driver for tracking multiple
19135          * commands. This ID is treated as opaque data by the firmware and
19136          * the value is returned in the `hwrm_resp_hdr` upon completion.
19137          */
19138         uint16_t        seq_id;
19139         /*
19140          * The target ID of the command:
19141          * * 0x0-0xFFF8 - The function ID
19142          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19143          * * 0xFFFD - Reserved for user-space HWRM interface
19144          * * 0xFFFF - HWRM
19145          */
19146         uint16_t        target_id;
19147         /*
19148          * A physical address pointer pointing to a host buffer that the
19149          * command's response data will be written. This can be either a host
19150          * physical address (HPA) or a guest physical address (GPA) and must
19151          * point to a physically contiguous block of memory.
19152          */
19153         uint64_t        resp_addr;
19154         /* Port ID of port that is being queried. */
19155         uint16_t        port_id;
19156         uint8_t flags;
19157         /*
19158          * If set to 1, then this field indicates clear the following RoCE
19159          * specific counters.
19160          * RoCE associated TX/RX cos counters
19161          * CNP associated TX/RX cos counters
19162          * RoCE/CNP specific TX/RX flow counters
19163          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
19164          * This flag is honored only when RoCE is enabled on that port.
19165          */
19166         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
19167         uint8_t unused_0[5];
19168 } __rte_packed;
19169
19170 /* hwrm_port_clr_stats_output (size:128b/16B) */
19171 struct hwrm_port_clr_stats_output {
19172         /* The specific error status for the command. */
19173         uint16_t        error_code;
19174         /* The HWRM command request type. */
19175         uint16_t        req_type;
19176         /* The sequence ID from the original command. */
19177         uint16_t        seq_id;
19178         /* The length of the response data in number of bytes. */
19179         uint16_t        resp_len;
19180         uint8_t unused_0[7];
19181         /*
19182          * This field is used in Output records to indicate that the output
19183          * is completely written to RAM.  This field should be read as '1'
19184          * to indicate that the output has been completely written.
19185          * When writing a command completion or response to an internal processor,
19186          * the order of writes has to be such that this field is written last.
19187          */
19188         uint8_t valid;
19189 } __rte_packed;
19190
19191 /***********************
19192  * hwrm_port_phy_qcaps *
19193  ***********************/
19194
19195
19196 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
19197 struct hwrm_port_phy_qcaps_input {
19198         /* The HWRM command request type. */
19199         uint16_t        req_type;
19200         /*
19201          * The completion ring to send the completion event on. This should
19202          * be the NQ ID returned from the `nq_alloc` HWRM command.
19203          */
19204         uint16_t        cmpl_ring;
19205         /*
19206          * The sequence ID is used by the driver for tracking multiple
19207          * commands. This ID is treated as opaque data by the firmware and
19208          * the value is returned in the `hwrm_resp_hdr` upon completion.
19209          */
19210         uint16_t        seq_id;
19211         /*
19212          * The target ID of the command:
19213          * * 0x0-0xFFF8 - The function ID
19214          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19215          * * 0xFFFD - Reserved for user-space HWRM interface
19216          * * 0xFFFF - HWRM
19217          */
19218         uint16_t        target_id;
19219         /*
19220          * A physical address pointer pointing to a host buffer that the
19221          * command's response data will be written. This can be either a host
19222          * physical address (HPA) or a guest physical address (GPA) and must
19223          * point to a physically contiguous block of memory.
19224          */
19225         uint64_t        resp_addr;
19226         /* Port ID of port that is being queried. */
19227         uint16_t        port_id;
19228         uint8_t unused_0[6];
19229 } __rte_packed;
19230
19231 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
19232 struct hwrm_port_phy_qcaps_output {
19233         /* The specific error status for the command. */
19234         uint16_t        error_code;
19235         /* The HWRM command request type. */
19236         uint16_t        req_type;
19237         /* The sequence ID from the original command. */
19238         uint16_t        seq_id;
19239         /* The length of the response data in number of bytes. */
19240         uint16_t        resp_len;
19241         /* PHY capability flags */
19242         uint8_t flags;
19243         /*
19244          * If set to 1, then this field indicates that the
19245          * link is capable of supporting EEE.
19246          */
19247         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
19248                 UINT32_C(0x1)
19249         /*
19250          * If set to 1, then this field indicates that the
19251          * PHY is capable of supporting external loopback.
19252          */
19253         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
19254                 UINT32_C(0x2)
19255         /*
19256          * If set to 1, then this field indicates that the
19257          * PHY is capable of supporting loopback in autoneg mode.
19258          */
19259         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED \
19260                 UINT32_C(0x4)
19261         /*
19262          * Indicates if the configuration of shared PHY settings is supported.
19263          * In cases where a physical port is shared by multiple functions
19264          * (e.g. NPAR, multihost, etc), the configuration of PHY
19265          * settings may not be allowed. Callers to HWRM_PORT_PHY_CFG will
19266          * get an HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error in this case.
19267          */
19268         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED \
19269                 UINT32_C(0x8)
19270         /*
19271          * If set to 1, it indicates that the port counters and extended
19272          * port counters will not reset when the firmware shuts down or
19273          * resets the PHY.  These counters will only be reset during power
19274          * cycle or by calling HWRM_PORT_CLR_STATS.
19275          * If set to 0, the state of the counters is unspecified when
19276          * firmware shuts down or resets the PHY.
19277          */
19278         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET \
19279                 UINT32_C(0x10)
19280         /*
19281          * Reserved field. The HWRM shall set this field to 0.
19282          * An HWRM client shall ignore this field.
19283          */
19284         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \
19285                 UINT32_C(0xe0)
19286         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT \
19287                 5
19288         /* Number of front panel ports for this device. */
19289         uint8_t port_cnt;
19290         /* Not supported or unknown */
19291         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
19292         /* single port device */
19293         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
19294         /* 2-port device */
19295         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
19296         /* 3-port device */
19297         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
19298         /* 4-port device */
19299         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
19300         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
19301                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
19302         /*
19303          * This is a bit mask to indicate what speeds are supported
19304          * as forced speeds on this link.
19305          * For each speed that can be forced on this link, the
19306          * corresponding mask bit shall be set to '1'.
19307          */
19308         uint16_t        supported_speeds_force_mode;
19309         /* 100Mb link speed (Half-duplex) */
19310         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
19311                 UINT32_C(0x1)
19312         /* 100Mb link speed (Full-duplex) */
19313         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
19314                 UINT32_C(0x2)
19315         /* 1Gb link speed (Half-duplex) */
19316         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
19317                 UINT32_C(0x4)
19318         /* 1Gb link speed (Full-duplex) */
19319         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
19320                 UINT32_C(0x8)
19321         /* 2Gb link speed */
19322         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
19323                 UINT32_C(0x10)
19324         /* 25Gb link speed */
19325         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
19326                 UINT32_C(0x20)
19327         /* 10Gb link speed */
19328         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
19329                 UINT32_C(0x40)
19330         /* 20Gb link speed */
19331         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
19332                 UINT32_C(0x80)
19333         /* 25Gb link speed */
19334         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
19335                 UINT32_C(0x100)
19336         /* 40Gb link speed */
19337         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
19338                 UINT32_C(0x200)
19339         /* 50Gb link speed */
19340         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
19341                 UINT32_C(0x400)
19342         /* 100Gb link speed */
19343         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
19344                 UINT32_C(0x800)
19345         /* 10Mb link speed (Half-duplex) */
19346         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
19347                 UINT32_C(0x1000)
19348         /* 10Mb link speed (Full-duplex) */
19349         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
19350                 UINT32_C(0x2000)
19351         /* 200Gb link speed */
19352         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_200GB \
19353                 UINT32_C(0x4000)
19354         /*
19355          * This is a bit mask to indicate what speeds are supported
19356          * for autonegotiation on this link.
19357          * For each speed that can be autonegotiated on this link, the
19358          * corresponding mask bit shall be set to '1'.
19359          */
19360         uint16_t        supported_speeds_auto_mode;
19361         /* 100Mb link speed (Half-duplex) */
19362         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
19363                 UINT32_C(0x1)
19364         /* 100Mb link speed (Full-duplex) */
19365         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
19366                 UINT32_C(0x2)
19367         /* 1Gb link speed (Half-duplex) */
19368         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
19369                 UINT32_C(0x4)
19370         /* 1Gb link speed (Full-duplex) */
19371         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
19372                 UINT32_C(0x8)
19373         /* 2Gb link speed */
19374         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
19375                 UINT32_C(0x10)
19376         /* 25Gb link speed */
19377         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
19378                 UINT32_C(0x20)
19379         /* 10Gb link speed */
19380         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
19381                 UINT32_C(0x40)
19382         /* 20Gb link speed */
19383         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
19384                 UINT32_C(0x80)
19385         /* 25Gb link speed */
19386         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
19387                 UINT32_C(0x100)
19388         /* 40Gb link speed */
19389         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
19390                 UINT32_C(0x200)
19391         /* 50Gb link speed */
19392         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
19393                 UINT32_C(0x400)
19394         /* 100Gb link speed */
19395         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
19396                 UINT32_C(0x800)
19397         /* 10Mb link speed (Half-duplex) */
19398         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
19399                 UINT32_C(0x1000)
19400         /* 10Mb link speed (Full-duplex) */
19401         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
19402                 UINT32_C(0x2000)
19403         /* 200Gb link speed */
19404         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_200GB \
19405                 UINT32_C(0x4000)
19406         /*
19407          * This is a bit mask to indicate what speeds are supported
19408          * for EEE on this link.
19409          * For each speed that can be autonegotiated when EEE is enabled
19410          * on this link, the corresponding mask bit shall be set to '1'.
19411          * This field is only valid when the eee_suppotred is set to '1'.
19412          */
19413         uint16_t        supported_speeds_eee_mode;
19414         /* Reserved */
19415         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
19416                 UINT32_C(0x1)
19417         /* 100Mb link speed (Full-duplex) */
19418         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
19419                 UINT32_C(0x2)
19420         /* Reserved */
19421         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
19422                 UINT32_C(0x4)
19423         /* 1Gb link speed (Full-duplex) */
19424         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
19425                 UINT32_C(0x8)
19426         /* Reserved */
19427         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
19428                 UINT32_C(0x10)
19429         /* Reserved */
19430         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
19431                 UINT32_C(0x20)
19432         /* 10Gb link speed */
19433         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
19434                 UINT32_C(0x40)
19435         uint32_t        tx_lpi_timer_low;
19436         /*
19437          * The lowest value of TX LPI timer that can be set on this link
19438          * when EEE is enabled. This value is in microseconds.
19439          * This field is valid only when_eee_supported is set to '1'.
19440          */
19441         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
19442                 UINT32_C(0xffffff)
19443         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
19444         /*
19445          * Reserved field. The HWRM shall set this field to 0.
19446          * An HWRM client shall ignore this field.
19447          */
19448         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
19449                 UINT32_C(0xff000000)
19450         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
19451         uint32_t        valid_tx_lpi_timer_high;
19452         /*
19453          * The highest value of TX LPI timer that can be set on this link
19454          * when EEE is enabled. This value is in microseconds.
19455          * This field is valid only when_eee_supported is set to '1'.
19456          */
19457         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
19458                 UINT32_C(0xffffff)
19459         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
19460         /*
19461          * This field is used in Output records to indicate that the output
19462          * is completely written to RAM.  This field should be read as '1'
19463          * to indicate that the output has been completely written.
19464          * When writing a command completion or response to an internal processor,
19465          * the order of writes has to be such that this field is written last.
19466          */
19467         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
19468                 UINT32_C(0xff000000)
19469         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
19470 } __rte_packed;
19471
19472 /****************************
19473  * hwrm_port_phy_mdio_write *
19474  ****************************/
19475
19476
19477 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
19478 struct hwrm_port_phy_mdio_write_input {
19479         /* The HWRM command request type. */
19480         uint16_t        req_type;
19481         /*
19482          * The completion ring to send the completion event on. This should
19483          * be the NQ ID returned from the `nq_alloc` HWRM command.
19484          */
19485         uint16_t        cmpl_ring;
19486         /*
19487          * The sequence ID is used by the driver for tracking multiple
19488          * commands. This ID is treated as opaque data by the firmware and
19489          * the value is returned in the `hwrm_resp_hdr` upon completion.
19490          */
19491         uint16_t        seq_id;
19492         /*
19493          * The target ID of the command:
19494          * * 0x0-0xFFF8 - The function ID
19495          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19496          * * 0xFFFD - Reserved for user-space HWRM interface
19497          * * 0xFFFF - HWRM
19498          */
19499         uint16_t        target_id;
19500         /*
19501          * A physical address pointer pointing to a host buffer that the
19502          * command's response data will be written. This can be either a host
19503          * physical address (HPA) or a guest physical address (GPA) and must
19504          * point to a physically contiguous block of memory.
19505          */
19506         uint64_t        resp_addr;
19507         /* Reserved for future use. */
19508         uint32_t        unused_0[2];
19509         /* Port ID of port. */
19510         uint16_t        port_id;
19511         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
19512         uint8_t phy_addr;
19513         /* 8-bit device address. */
19514         uint8_t dev_addr;
19515         /* 16-bit register address. */
19516         uint16_t        reg_addr;
19517         /* 16-bit register data. */
19518         uint16_t        reg_data;
19519         /*
19520          * When this bit is set to 1 a Clause 45 mdio access is done.
19521          * when this bit is set to 0 a Clause 22 mdio access is done.
19522          */
19523         uint8_t cl45_mdio;
19524         /*  */
19525         uint8_t unused_1[7];
19526 } __rte_packed;
19527
19528 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
19529 struct hwrm_port_phy_mdio_write_output {
19530         /* The specific error status for the command. */
19531         uint16_t        error_code;
19532         /* The HWRM command request type. */
19533         uint16_t        req_type;
19534         /* The sequence ID from the original command. */
19535         uint16_t        seq_id;
19536         /* The length of the response data in number of bytes. */
19537         uint16_t        resp_len;
19538         uint8_t unused_0[7];
19539         /*
19540          * This field is used in Output records to indicate that the output
19541          * is completely written to RAM.  This field should be read as '1'
19542          * to indicate that the output has been completely written.
19543          * When writing a command completion or response to an internal processor,
19544          * the order of writes has to be such that this field is written last.
19545          */
19546         uint8_t valid;
19547 } __rte_packed;
19548
19549 /***************************
19550  * hwrm_port_phy_mdio_read *
19551  ***************************/
19552
19553
19554 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
19555 struct hwrm_port_phy_mdio_read_input {
19556         /* The HWRM command request type. */
19557         uint16_t        req_type;
19558         /*
19559          * The completion ring to send the completion event on. This should
19560          * be the NQ ID returned from the `nq_alloc` HWRM command.
19561          */
19562         uint16_t        cmpl_ring;
19563         /*
19564          * The sequence ID is used by the driver for tracking multiple
19565          * commands. This ID is treated as opaque data by the firmware and
19566          * the value is returned in the `hwrm_resp_hdr` upon completion.
19567          */
19568         uint16_t        seq_id;
19569         /*
19570          * The target ID of the command:
19571          * * 0x0-0xFFF8 - The function ID
19572          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19573          * * 0xFFFD - Reserved for user-space HWRM interface
19574          * * 0xFFFF - HWRM
19575          */
19576         uint16_t        target_id;
19577         /*
19578          * A physical address pointer pointing to a host buffer that the
19579          * command's response data will be written. This can be either a host
19580          * physical address (HPA) or a guest physical address (GPA) and must
19581          * point to a physically contiguous block of memory.
19582          */
19583         uint64_t        resp_addr;
19584         /* Reserved for future use. */
19585         uint32_t        unused_0[2];
19586         /* Port ID of port. */
19587         uint16_t        port_id;
19588         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
19589         uint8_t phy_addr;
19590         /* 8-bit device address. */
19591         uint8_t dev_addr;
19592         /* 16-bit register address. */
19593         uint16_t        reg_addr;
19594         /*
19595          * When this bit is set to 1 a Clause 45 mdio access is done.
19596          * when this bit is set to 0 a Clause 22 mdio access is done.
19597          */
19598         uint8_t cl45_mdio;
19599         /*  */
19600         uint8_t unused_1;
19601 } __rte_packed;
19602
19603 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
19604 struct hwrm_port_phy_mdio_read_output {
19605         /* The specific error status for the command. */
19606         uint16_t        error_code;
19607         /* The HWRM command request type. */
19608         uint16_t        req_type;
19609         /* The sequence ID from the original command. */
19610         uint16_t        seq_id;
19611         /* The length of the response data in number of bytes. */
19612         uint16_t        resp_len;
19613         /* 16-bit register data. */
19614         uint16_t        reg_data;
19615         uint8_t unused_0[5];
19616         /*
19617          * This field is used in Output records to indicate that the output
19618          * is completely written to RAM.  This field should be read as '1'
19619          * to indicate that the output has been completely written.
19620          * When writing a command completion or response to an internal processor,
19621          * the order of writes has to be such that this field is written last.
19622          */
19623         uint8_t valid;
19624 } __rte_packed;
19625
19626 /*********************
19627  * hwrm_port_led_cfg *
19628  *********************/
19629
19630
19631 /* hwrm_port_led_cfg_input (size:512b/64B) */
19632 struct hwrm_port_led_cfg_input {
19633         /* The HWRM command request type. */
19634         uint16_t        req_type;
19635         /*
19636          * The completion ring to send the completion event on. This should
19637          * be the NQ ID returned from the `nq_alloc` HWRM command.
19638          */
19639         uint16_t        cmpl_ring;
19640         /*
19641          * The sequence ID is used by the driver for tracking multiple
19642          * commands. This ID is treated as opaque data by the firmware and
19643          * the value is returned in the `hwrm_resp_hdr` upon completion.
19644          */
19645         uint16_t        seq_id;
19646         /*
19647          * The target ID of the command:
19648          * * 0x0-0xFFF8 - The function ID
19649          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19650          * * 0xFFFD - Reserved for user-space HWRM interface
19651          * * 0xFFFF - HWRM
19652          */
19653         uint16_t        target_id;
19654         /*
19655          * A physical address pointer pointing to a host buffer that the
19656          * command's response data will be written. This can be either a host
19657          * physical address (HPA) or a guest physical address (GPA) and must
19658          * point to a physically contiguous block of memory.
19659          */
19660         uint64_t        resp_addr;
19661         uint32_t        enables;
19662         /*
19663          * This bit must be '1' for the led0_id field to be
19664          * configured.
19665          */
19666         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
19667                 UINT32_C(0x1)
19668         /*
19669          * This bit must be '1' for the led0_state field to be
19670          * configured.
19671          */
19672         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
19673                 UINT32_C(0x2)
19674         /*
19675          * This bit must be '1' for the led0_color field to be
19676          * configured.
19677          */
19678         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
19679                 UINT32_C(0x4)
19680         /*
19681          * This bit must be '1' for the led0_blink_on field to be
19682          * configured.
19683          */
19684         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
19685                 UINT32_C(0x8)
19686         /*
19687          * This bit must be '1' for the led0_blink_off field to be
19688          * configured.
19689          */
19690         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
19691                 UINT32_C(0x10)
19692         /*
19693          * This bit must be '1' for the led0_group_id field to be
19694          * configured.
19695          */
19696         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
19697                 UINT32_C(0x20)
19698         /*
19699          * This bit must be '1' for the led1_id field to be
19700          * configured.
19701          */
19702         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
19703                 UINT32_C(0x40)
19704         /*
19705          * This bit must be '1' for the led1_state field to be
19706          * configured.
19707          */
19708         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
19709                 UINT32_C(0x80)
19710         /*
19711          * This bit must be '1' for the led1_color field to be
19712          * configured.
19713          */
19714         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
19715                 UINT32_C(0x100)
19716         /*
19717          * This bit must be '1' for the led1_blink_on field to be
19718          * configured.
19719          */
19720         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
19721                 UINT32_C(0x200)
19722         /*
19723          * This bit must be '1' for the led1_blink_off field to be
19724          * configured.
19725          */
19726         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
19727                 UINT32_C(0x400)
19728         /*
19729          * This bit must be '1' for the led1_group_id field to be
19730          * configured.
19731          */
19732         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
19733                 UINT32_C(0x800)
19734         /*
19735          * This bit must be '1' for the led2_id field to be
19736          * configured.
19737          */
19738         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
19739                 UINT32_C(0x1000)
19740         /*
19741          * This bit must be '1' for the led2_state field to be
19742          * configured.
19743          */
19744         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
19745                 UINT32_C(0x2000)
19746         /*
19747          * This bit must be '1' for the led2_color field to be
19748          * configured.
19749          */
19750         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
19751                 UINT32_C(0x4000)
19752         /*
19753          * This bit must be '1' for the led2_blink_on field to be
19754          * configured.
19755          */
19756         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
19757                 UINT32_C(0x8000)
19758         /*
19759          * This bit must be '1' for the led2_blink_off field to be
19760          * configured.
19761          */
19762         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
19763                 UINT32_C(0x10000)
19764         /*
19765          * This bit must be '1' for the led2_group_id field to be
19766          * configured.
19767          */
19768         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
19769                 UINT32_C(0x20000)
19770         /*
19771          * This bit must be '1' for the led3_id field to be
19772          * configured.
19773          */
19774         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
19775                 UINT32_C(0x40000)
19776         /*
19777          * This bit must be '1' for the led3_state field to be
19778          * configured.
19779          */
19780         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
19781                 UINT32_C(0x80000)
19782         /*
19783          * This bit must be '1' for the led3_color field to be
19784          * configured.
19785          */
19786         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
19787                 UINT32_C(0x100000)
19788         /*
19789          * This bit must be '1' for the led3_blink_on field to be
19790          * configured.
19791          */
19792         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
19793                 UINT32_C(0x200000)
19794         /*
19795          * This bit must be '1' for the led3_blink_off field to be
19796          * configured.
19797          */
19798         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
19799                 UINT32_C(0x400000)
19800         /*
19801          * This bit must be '1' for the led3_group_id field to be
19802          * configured.
19803          */
19804         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
19805                 UINT32_C(0x800000)
19806         /* Port ID of port whose LEDs are configured. */
19807         uint16_t        port_id;
19808         /*
19809          * The number of LEDs that are being configured.
19810          * Up to 4 LEDs can be configured with this command.
19811          */
19812         uint8_t num_leds;
19813         /* Reserved field. */
19814         uint8_t rsvd;
19815         /* An identifier for the LED #0. */
19816         uint8_t led0_id;
19817         /* The requested state of the LED #0. */
19818         uint8_t led0_state;
19819         /* Default state of the LED */
19820         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
19821         /* Off */
19822         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
19823         /* On */
19824         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
19825         /* Blink */
19826         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
19827         /* Blink Alternately */
19828         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
19829         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
19830                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
19831         /* The requested color of LED #0. */
19832         uint8_t led0_color;
19833         /* Default */
19834         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
19835         /* Amber */
19836         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
19837         /* Green */
19838         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
19839         /* Green or Amber */
19840         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
19841         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
19842                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
19843         uint8_t unused_0;
19844         /*
19845          * If the LED #0 state is "blink" or "blinkalt", then
19846          * this field represents the requested time in milliseconds
19847          * to keep LED on between cycles.
19848          */
19849         uint16_t        led0_blink_on;
19850         /*
19851          * If the LED #0 state is "blink" or "blinkalt", then
19852          * this field represents the requested time in milliseconds
19853          * to keep LED off between cycles.
19854          */
19855         uint16_t        led0_blink_off;
19856         /*
19857          * An identifier for the group of LEDs that LED #0 belongs
19858          * to.
19859          * If set to 0, then the LED #0 shall not be grouped and
19860          * shall be treated as an individual resource.
19861          * For all other non-zero values of this field, LED #0 shall
19862          * be grouped together with the LEDs with the same group ID
19863          * value.
19864          */
19865         uint8_t led0_group_id;
19866         /* Reserved field. */
19867         uint8_t rsvd0;
19868         /* An identifier for the LED #1. */
19869         uint8_t led1_id;
19870         /* The requested state of the LED #1. */
19871         uint8_t led1_state;
19872         /* Default state of the LED */
19873         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
19874         /* Off */
19875         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
19876         /* On */
19877         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
19878         /* Blink */
19879         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
19880         /* Blink Alternately */
19881         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
19882         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
19883                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
19884         /* The requested color of LED #1. */
19885         uint8_t led1_color;
19886         /* Default */
19887         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
19888         /* Amber */
19889         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
19890         /* Green */
19891         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
19892         /* Green or Amber */
19893         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
19894         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
19895                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
19896         uint8_t unused_1;
19897         /*
19898          * If the LED #1 state is "blink" or "blinkalt", then
19899          * this field represents the requested time in milliseconds
19900          * to keep LED on between cycles.
19901          */
19902         uint16_t        led1_blink_on;
19903         /*
19904          * If the LED #1 state is "blink" or "blinkalt", then
19905          * this field represents the requested time in milliseconds
19906          * to keep LED off between cycles.
19907          */
19908         uint16_t        led1_blink_off;
19909         /*
19910          * An identifier for the group of LEDs that LED #1 belongs
19911          * to.
19912          * If set to 0, then the LED #1 shall not be grouped and
19913          * shall be treated as an individual resource.
19914          * For all other non-zero values of this field, LED #1 shall
19915          * be grouped together with the LEDs with the same group ID
19916          * value.
19917          */
19918         uint8_t led1_group_id;
19919         /* Reserved field. */
19920         uint8_t rsvd1;
19921         /* An identifier for the LED #2. */
19922         uint8_t led2_id;
19923         /* The requested state of the LED #2. */
19924         uint8_t led2_state;
19925         /* Default state of the LED */
19926         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
19927         /* Off */
19928         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
19929         /* On */
19930         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
19931         /* Blink */
19932         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
19933         /* Blink Alternately */
19934         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
19935         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
19936                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
19937         /* The requested color of LED #2. */
19938         uint8_t led2_color;
19939         /* Default */
19940         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
19941         /* Amber */
19942         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
19943         /* Green */
19944         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
19945         /* Green or Amber */
19946         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
19947         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
19948                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
19949         uint8_t unused_2;
19950         /*
19951          * If the LED #2 state is "blink" or "blinkalt", then
19952          * this field represents the requested time in milliseconds
19953          * to keep LED on between cycles.
19954          */
19955         uint16_t        led2_blink_on;
19956         /*
19957          * If the LED #2 state is "blink" or "blinkalt", then
19958          * this field represents the requested time in milliseconds
19959          * to keep LED off between cycles.
19960          */
19961         uint16_t        led2_blink_off;
19962         /*
19963          * An identifier for the group of LEDs that LED #2 belongs
19964          * to.
19965          * If set to 0, then the LED #2 shall not be grouped and
19966          * shall be treated as an individual resource.
19967          * For all other non-zero values of this field, LED #2 shall
19968          * be grouped together with the LEDs with the same group ID
19969          * value.
19970          */
19971         uint8_t led2_group_id;
19972         /* Reserved field. */
19973         uint8_t rsvd2;
19974         /* An identifier for the LED #3. */
19975         uint8_t led3_id;
19976         /* The requested state of the LED #3. */
19977         uint8_t led3_state;
19978         /* Default state of the LED */
19979         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
19980         /* Off */
19981         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
19982         /* On */
19983         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
19984         /* Blink */
19985         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
19986         /* Blink Alternately */
19987         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
19988         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
19989                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
19990         /* The requested color of LED #3. */
19991         uint8_t led3_color;
19992         /* Default */
19993         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
19994         /* Amber */
19995         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
19996         /* Green */
19997         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
19998         /* Green or Amber */
19999         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
20000         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
20001                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
20002         uint8_t unused_3;
20003         /*
20004          * If the LED #3 state is "blink" or "blinkalt", then
20005          * this field represents the requested time in milliseconds
20006          * to keep LED on between cycles.
20007          */
20008         uint16_t        led3_blink_on;
20009         /*
20010          * If the LED #3 state is "blink" or "blinkalt", then
20011          * this field represents the requested time in milliseconds
20012          * to keep LED off between cycles.
20013          */
20014         uint16_t        led3_blink_off;
20015         /*
20016          * An identifier for the group of LEDs that LED #3 belongs
20017          * to.
20018          * If set to 0, then the LED #3 shall not be grouped and
20019          * shall be treated as an individual resource.
20020          * For all other non-zero values of this field, LED #3 shall
20021          * be grouped together with the LEDs with the same group ID
20022          * value.
20023          */
20024         uint8_t led3_group_id;
20025         /* Reserved field. */
20026         uint8_t rsvd3;
20027 } __rte_packed;
20028
20029 /* hwrm_port_led_cfg_output (size:128b/16B) */
20030 struct hwrm_port_led_cfg_output {
20031         /* The specific error status for the command. */
20032         uint16_t        error_code;
20033         /* The HWRM command request type. */
20034         uint16_t        req_type;
20035         /* The sequence ID from the original command. */
20036         uint16_t        seq_id;
20037         /* The length of the response data in number of bytes. */
20038         uint16_t        resp_len;
20039         uint8_t unused_0[7];
20040         /*
20041          * This field is used in Output records to indicate that the output
20042          * is completely written to RAM.  This field should be read as '1'
20043          * to indicate that the output has been completely written.
20044          * When writing a command completion or response to an internal processor,
20045          * the order of writes has to be such that this field is written last.
20046          */
20047         uint8_t valid;
20048 } __rte_packed;
20049
20050 /**********************
20051  * hwrm_port_led_qcfg *
20052  **********************/
20053
20054
20055 /* hwrm_port_led_qcfg_input (size:192b/24B) */
20056 struct hwrm_port_led_qcfg_input {
20057         /* The HWRM command request type. */
20058         uint16_t        req_type;
20059         /*
20060          * The completion ring to send the completion event on. This should
20061          * be the NQ ID returned from the `nq_alloc` HWRM command.
20062          */
20063         uint16_t        cmpl_ring;
20064         /*
20065          * The sequence ID is used by the driver for tracking multiple
20066          * commands. This ID is treated as opaque data by the firmware and
20067          * the value is returned in the `hwrm_resp_hdr` upon completion.
20068          */
20069         uint16_t        seq_id;
20070         /*
20071          * The target ID of the command:
20072          * * 0x0-0xFFF8 - The function ID
20073          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20074          * * 0xFFFD - Reserved for user-space HWRM interface
20075          * * 0xFFFF - HWRM
20076          */
20077         uint16_t        target_id;
20078         /*
20079          * A physical address pointer pointing to a host buffer that the
20080          * command's response data will be written. This can be either a host
20081          * physical address (HPA) or a guest physical address (GPA) and must
20082          * point to a physically contiguous block of memory.
20083          */
20084         uint64_t        resp_addr;
20085         /* Port ID of port whose LED configuration is being queried. */
20086         uint16_t        port_id;
20087         uint8_t unused_0[6];
20088 } __rte_packed;
20089
20090 /* hwrm_port_led_qcfg_output (size:448b/56B) */
20091 struct hwrm_port_led_qcfg_output {
20092         /* The specific error status for the command. */
20093         uint16_t        error_code;
20094         /* The HWRM command request type. */
20095         uint16_t        req_type;
20096         /* The sequence ID from the original command. */
20097         uint16_t        seq_id;
20098         /* The length of the response data in number of bytes. */
20099         uint16_t        resp_len;
20100         /*
20101          * The number of LEDs that are configured on this port.
20102          * Up to 4 LEDs can be returned in the response.
20103          */
20104         uint8_t num_leds;
20105         /* An identifier for the LED #0. */
20106         uint8_t led0_id;
20107         /* The type of LED #0. */
20108         uint8_t led0_type;
20109         /* Speed LED */
20110         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
20111         /* Activity LED */
20112         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
20113         /* Invalid */
20114         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
20115         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
20116                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
20117         /* The current state of the LED #0. */
20118         uint8_t led0_state;
20119         /* Default state of the LED */
20120         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
20121         /* Off */
20122         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
20123         /* On */
20124         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
20125         /* Blink */
20126         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
20127         /* Blink Alternately */
20128         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
20129         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
20130                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
20131         /* The color of LED #0. */
20132         uint8_t led0_color;
20133         /* Default */
20134         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
20135         /* Amber */
20136         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
20137         /* Green */
20138         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
20139         /* Green or Amber */
20140         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
20141         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
20142                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
20143         uint8_t unused_0;
20144         /*
20145          * If the LED #0 state is "blink" or "blinkalt", then
20146          * this field represents the requested time in milliseconds
20147          * to keep LED on between cycles.
20148          */
20149         uint16_t        led0_blink_on;
20150         /*
20151          * If the LED #0 state is "blink" or "blinkalt", then
20152          * this field represents the requested time in milliseconds
20153          * to keep LED off between cycles.
20154          */
20155         uint16_t        led0_blink_off;
20156         /*
20157          * An identifier for the group of LEDs that LED #0 belongs
20158          * to.
20159          * If set to 0, then the LED #0 is not grouped.
20160          * For all other non-zero values of this field, LED #0 is
20161          * grouped together with the LEDs with the same group ID
20162          * value.
20163          */
20164         uint8_t led0_group_id;
20165         /* An identifier for the LED #1. */
20166         uint8_t led1_id;
20167         /* The type of LED #1. */
20168         uint8_t led1_type;
20169         /* Speed LED */
20170         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
20171         /* Activity LED */
20172         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
20173         /* Invalid */
20174         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
20175         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
20176                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
20177         /* The current state of the LED #1. */
20178         uint8_t led1_state;
20179         /* Default state of the LED */
20180         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
20181         /* Off */
20182         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
20183         /* On */
20184         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
20185         /* Blink */
20186         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
20187         /* Blink Alternately */
20188         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
20189         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
20190                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
20191         /* The color of LED #1. */
20192         uint8_t led1_color;
20193         /* Default */
20194         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
20195         /* Amber */
20196         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
20197         /* Green */
20198         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
20199         /* Green or Amber */
20200         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
20201         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
20202                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
20203         uint8_t unused_1;
20204         /*
20205          * If the LED #1 state is "blink" or "blinkalt", then
20206          * this field represents the requested time in milliseconds
20207          * to keep LED on between cycles.
20208          */
20209         uint16_t        led1_blink_on;
20210         /*
20211          * If the LED #1 state is "blink" or "blinkalt", then
20212          * this field represents the requested time in milliseconds
20213          * to keep LED off between cycles.
20214          */
20215         uint16_t        led1_blink_off;
20216         /*
20217          * An identifier for the group of LEDs that LED #1 belongs
20218          * to.
20219          * If set to 0, then the LED #1 is not grouped.
20220          * For all other non-zero values of this field, LED #1 is
20221          * grouped together with the LEDs with the same group ID
20222          * value.
20223          */
20224         uint8_t led1_group_id;
20225         /* An identifier for the LED #2. */
20226         uint8_t led2_id;
20227         /* The type of LED #2. */
20228         uint8_t led2_type;
20229         /* Speed LED */
20230         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
20231         /* Activity LED */
20232         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
20233         /* Invalid */
20234         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
20235         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
20236                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
20237         /* The current state of the LED #2. */
20238         uint8_t led2_state;
20239         /* Default state of the LED */
20240         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
20241         /* Off */
20242         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
20243         /* On */
20244         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
20245         /* Blink */
20246         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
20247         /* Blink Alternately */
20248         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
20249         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
20250                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
20251         /* The color of LED #2. */
20252         uint8_t led2_color;
20253         /* Default */
20254         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
20255         /* Amber */
20256         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
20257         /* Green */
20258         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
20259         /* Green or Amber */
20260         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
20261         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
20262                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
20263         uint8_t unused_2;
20264         /*
20265          * If the LED #2 state is "blink" or "blinkalt", then
20266          * this field represents the requested time in milliseconds
20267          * to keep LED on between cycles.
20268          */
20269         uint16_t        led2_blink_on;
20270         /*
20271          * If the LED #2 state is "blink" or "blinkalt", then
20272          * this field represents the requested time in milliseconds
20273          * to keep LED off between cycles.
20274          */
20275         uint16_t        led2_blink_off;
20276         /*
20277          * An identifier for the group of LEDs that LED #2 belongs
20278          * to.
20279          * If set to 0, then the LED #2 is not grouped.
20280          * For all other non-zero values of this field, LED #2 is
20281          * grouped together with the LEDs with the same group ID
20282          * value.
20283          */
20284         uint8_t led2_group_id;
20285         /* An identifier for the LED #3. */
20286         uint8_t led3_id;
20287         /* The type of LED #3. */
20288         uint8_t led3_type;
20289         /* Speed LED */
20290         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
20291         /* Activity LED */
20292         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
20293         /* Invalid */
20294         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
20295         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
20296                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
20297         /* The current state of the LED #3. */
20298         uint8_t led3_state;
20299         /* Default state of the LED */
20300         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
20301         /* Off */
20302         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
20303         /* On */
20304         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
20305         /* Blink */
20306         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
20307         /* Blink Alternately */
20308         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
20309         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
20310                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
20311         /* The color of LED #3. */
20312         uint8_t led3_color;
20313         /* Default */
20314         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
20315         /* Amber */
20316         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
20317         /* Green */
20318         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
20319         /* Green or Amber */
20320         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
20321         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
20322                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
20323         uint8_t unused_3;
20324         /*
20325          * If the LED #3 state is "blink" or "blinkalt", then
20326          * this field represents the requested time in milliseconds
20327          * to keep LED on between cycles.
20328          */
20329         uint16_t        led3_blink_on;
20330         /*
20331          * If the LED #3 state is "blink" or "blinkalt", then
20332          * this field represents the requested time in milliseconds
20333          * to keep LED off between cycles.
20334          */
20335         uint16_t        led3_blink_off;
20336         /*
20337          * An identifier for the group of LEDs that LED #3 belongs
20338          * to.
20339          * If set to 0, then the LED #3 is not grouped.
20340          * For all other non-zero values of this field, LED #3 is
20341          * grouped together with the LEDs with the same group ID
20342          * value.
20343          */
20344         uint8_t led3_group_id;
20345         uint8_t unused_4[6];
20346         /*
20347          * This field is used in Output records to indicate that the output
20348          * is completely written to RAM.  This field should be read as '1'
20349          * to indicate that the output has been completely written.
20350          * When writing a command completion or response to an internal processor,
20351          * the order of writes has to be such that this field is written last.
20352          */
20353         uint8_t valid;
20354 } __rte_packed;
20355
20356 /***********************
20357  * hwrm_port_led_qcaps *
20358  ***********************/
20359
20360
20361 /* hwrm_port_led_qcaps_input (size:192b/24B) */
20362 struct hwrm_port_led_qcaps_input {
20363         /* The HWRM command request type. */
20364         uint16_t        req_type;
20365         /*
20366          * The completion ring to send the completion event on. This should
20367          * be the NQ ID returned from the `nq_alloc` HWRM command.
20368          */
20369         uint16_t        cmpl_ring;
20370         /*
20371          * The sequence ID is used by the driver for tracking multiple
20372          * commands. This ID is treated as opaque data by the firmware and
20373          * the value is returned in the `hwrm_resp_hdr` upon completion.
20374          */
20375         uint16_t        seq_id;
20376         /*
20377          * The target ID of the command:
20378          * * 0x0-0xFFF8 - The function ID
20379          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20380          * * 0xFFFD - Reserved for user-space HWRM interface
20381          * * 0xFFFF - HWRM
20382          */
20383         uint16_t        target_id;
20384         /*
20385          * A physical address pointer pointing to a host buffer that the
20386          * command's response data will be written. This can be either a host
20387          * physical address (HPA) or a guest physical address (GPA) and must
20388          * point to a physically contiguous block of memory.
20389          */
20390         uint64_t        resp_addr;
20391         /* Port ID of port whose LED configuration is being queried. */
20392         uint16_t        port_id;
20393         uint8_t unused_0[6];
20394 } __rte_packed;
20395
20396 /* hwrm_port_led_qcaps_output (size:384b/48B) */
20397 struct hwrm_port_led_qcaps_output {
20398         /* The specific error status for the command. */
20399         uint16_t        error_code;
20400         /* The HWRM command request type. */
20401         uint16_t        req_type;
20402         /* The sequence ID from the original command. */
20403         uint16_t        seq_id;
20404         /* The length of the response data in number of bytes. */
20405         uint16_t        resp_len;
20406         /*
20407          * The number of LEDs that are configured on this port.
20408          * Up to 4 LEDs can be returned in the response.
20409          */
20410         uint8_t num_leds;
20411         /* Reserved for future use. */
20412         uint8_t unused[3];
20413         /* An identifier for the LED #0. */
20414         uint8_t led0_id;
20415         /* The type of LED #0. */
20416         uint8_t led0_type;
20417         /* Speed LED */
20418         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
20419         /* Activity LED */
20420         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
20421         /* Invalid */
20422         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
20423         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
20424                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
20425         /*
20426          * An identifier for the group of LEDs that LED #0 belongs
20427          * to.
20428          * If set to 0, then the LED #0 cannot be grouped.
20429          * For all other non-zero values of this field, LED #0 is
20430          * grouped together with the LEDs with the same group ID
20431          * value.
20432          */
20433         uint8_t led0_group_id;
20434         uint8_t unused_0;
20435         /* The states supported by LED #0. */
20436         uint16_t        led0_state_caps;
20437         /*
20438          * If set to 1, this LED is enabled.
20439          * If set to 0, this LED is disabled.
20440          */
20441         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
20442                 UINT32_C(0x1)
20443         /*
20444          * If set to 1, off state is supported on this LED.
20445          * If set to 0, off state is not supported on this LED.
20446          */
20447         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
20448                 UINT32_C(0x2)
20449         /*
20450          * If set to 1, on state is supported on this LED.
20451          * If set to 0, on state is not supported on this LED.
20452          */
20453         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
20454                 UINT32_C(0x4)
20455         /*
20456          * If set to 1, blink state is supported on this LED.
20457          * If set to 0, blink state is not supported on this LED.
20458          */
20459         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
20460                 UINT32_C(0x8)
20461         /*
20462          * If set to 1, blink_alt state is supported on this LED.
20463          * If set to 0, blink_alt state is not supported on this LED.
20464          */
20465         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
20466                 UINT32_C(0x10)
20467         /* The colors supported by LED #0. */
20468         uint16_t        led0_color_caps;
20469         /* reserved. */
20470         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
20471                 UINT32_C(0x1)
20472         /*
20473          * If set to 1, Amber color is supported on this LED.
20474          * If set to 0, Amber color is not supported on this LED.
20475          */
20476         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
20477                 UINT32_C(0x2)
20478         /*
20479          * If set to 1, Green color is supported on this LED.
20480          * If set to 0, Green color is not supported on this LED.
20481          */
20482         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
20483                 UINT32_C(0x4)
20484         /* An identifier for the LED #1. */
20485         uint8_t led1_id;
20486         /* The type of LED #1. */
20487         uint8_t led1_type;
20488         /* Speed LED */
20489         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
20490         /* Activity LED */
20491         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
20492         /* Invalid */
20493         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
20494         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
20495                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
20496         /*
20497          * An identifier for the group of LEDs that LED #1 belongs
20498          * to.
20499          * If set to 0, then the LED #0 cannot be grouped.
20500          * For all other non-zero values of this field, LED #0 is
20501          * grouped together with the LEDs with the same group ID
20502          * value.
20503          */
20504         uint8_t led1_group_id;
20505         uint8_t unused_1;
20506         /* The states supported by LED #1. */
20507         uint16_t        led1_state_caps;
20508         /*
20509          * If set to 1, this LED is enabled.
20510          * If set to 0, this LED is disabled.
20511          */
20512         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
20513                 UINT32_C(0x1)
20514         /*
20515          * If set to 1, off state is supported on this LED.
20516          * If set to 0, off state is not supported on this LED.
20517          */
20518         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
20519                 UINT32_C(0x2)
20520         /*
20521          * If set to 1, on state is supported on this LED.
20522          * If set to 0, on state is not supported on this LED.
20523          */
20524         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
20525                 UINT32_C(0x4)
20526         /*
20527          * If set to 1, blink state is supported on this LED.
20528          * If set to 0, blink state is not supported on this LED.
20529          */
20530         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
20531                 UINT32_C(0x8)
20532         /*
20533          * If set to 1, blink_alt state is supported on this LED.
20534          * If set to 0, blink_alt state is not supported on this LED.
20535          */
20536         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
20537                 UINT32_C(0x10)
20538         /* The colors supported by LED #1. */
20539         uint16_t        led1_color_caps;
20540         /* reserved. */
20541         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
20542                 UINT32_C(0x1)
20543         /*
20544          * If set to 1, Amber color is supported on this LED.
20545          * If set to 0, Amber color is not supported on this LED.
20546          */
20547         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
20548                 UINT32_C(0x2)
20549         /*
20550          * If set to 1, Green color is supported on this LED.
20551          * If set to 0, Green color is not supported on this LED.
20552          */
20553         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
20554                 UINT32_C(0x4)
20555         /* An identifier for the LED #2. */
20556         uint8_t led2_id;
20557         /* The type of LED #2. */
20558         uint8_t led2_type;
20559         /* Speed LED */
20560         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
20561         /* Activity LED */
20562         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
20563         /* Invalid */
20564         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
20565         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
20566                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
20567         /*
20568          * An identifier for the group of LEDs that LED #0 belongs
20569          * to.
20570          * If set to 0, then the LED #0 cannot be grouped.
20571          * For all other non-zero values of this field, LED #0 is
20572          * grouped together with the LEDs with the same group ID
20573          * value.
20574          */
20575         uint8_t led2_group_id;
20576         uint8_t unused_2;
20577         /* The states supported by LED #2. */
20578         uint16_t        led2_state_caps;
20579         /*
20580          * If set to 1, this LED is enabled.
20581          * If set to 0, this LED is disabled.
20582          */
20583         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
20584                 UINT32_C(0x1)
20585         /*
20586          * If set to 1, off state is supported on this LED.
20587          * If set to 0, off state is not supported on this LED.
20588          */
20589         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
20590                 UINT32_C(0x2)
20591         /*
20592          * If set to 1, on state is supported on this LED.
20593          * If set to 0, on state is not supported on this LED.
20594          */
20595         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
20596                 UINT32_C(0x4)
20597         /*
20598          * If set to 1, blink state is supported on this LED.
20599          * If set to 0, blink state is not supported on this LED.
20600          */
20601         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
20602                 UINT32_C(0x8)
20603         /*
20604          * If set to 1, blink_alt state is supported on this LED.
20605          * If set to 0, blink_alt state is not supported on this LED.
20606          */
20607         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
20608                 UINT32_C(0x10)
20609         /* The colors supported by LED #2. */
20610         uint16_t        led2_color_caps;
20611         /* reserved. */
20612         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
20613                 UINT32_C(0x1)
20614         /*
20615          * If set to 1, Amber color is supported on this LED.
20616          * If set to 0, Amber color is not supported on this LED.
20617          */
20618         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
20619                 UINT32_C(0x2)
20620         /*
20621          * If set to 1, Green color is supported on this LED.
20622          * If set to 0, Green color is not supported on this LED.
20623          */
20624         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
20625                 UINT32_C(0x4)
20626         /* An identifier for the LED #3. */
20627         uint8_t led3_id;
20628         /* The type of LED #3. */
20629         uint8_t led3_type;
20630         /* Speed LED */
20631         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
20632         /* Activity LED */
20633         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
20634         /* Invalid */
20635         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
20636         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
20637                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
20638         /*
20639          * An identifier for the group of LEDs that LED #3 belongs
20640          * to.
20641          * If set to 0, then the LED #0 cannot be grouped.
20642          * For all other non-zero values of this field, LED #0 is
20643          * grouped together with the LEDs with the same group ID
20644          * value.
20645          */
20646         uint8_t led3_group_id;
20647         uint8_t unused_3;
20648         /* The states supported by LED #3. */
20649         uint16_t        led3_state_caps;
20650         /*
20651          * If set to 1, this LED is enabled.
20652          * If set to 0, this LED is disabled.
20653          */
20654         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
20655                 UINT32_C(0x1)
20656         /*
20657          * If set to 1, off state is supported on this LED.
20658          * If set to 0, off state is not supported on this LED.
20659          */
20660         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
20661                 UINT32_C(0x2)
20662         /*
20663          * If set to 1, on state is supported on this LED.
20664          * If set to 0, on state is not supported on this LED.
20665          */
20666         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
20667                 UINT32_C(0x4)
20668         /*
20669          * If set to 1, blink state is supported on this LED.
20670          * If set to 0, blink state is not supported on this LED.
20671          */
20672         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
20673                 UINT32_C(0x8)
20674         /*
20675          * If set to 1, blink_alt state is supported on this LED.
20676          * If set to 0, blink_alt state is not supported on this LED.
20677          */
20678         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
20679                 UINT32_C(0x10)
20680         /* The colors supported by LED #3. */
20681         uint16_t        led3_color_caps;
20682         /* reserved. */
20683         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
20684                 UINT32_C(0x1)
20685         /*
20686          * If set to 1, Amber color is supported on this LED.
20687          * If set to 0, Amber color is not supported on this LED.
20688          */
20689         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
20690                 UINT32_C(0x2)
20691         /*
20692          * If set to 1, Green color is supported on this LED.
20693          * If set to 0, Green color is not supported on this LED.
20694          */
20695         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
20696                 UINT32_C(0x4)
20697         uint8_t unused_4[3];
20698         /*
20699          * This field is used in Output records to indicate that the output
20700          * is completely written to RAM.  This field should be read as '1'
20701          * to indicate that the output has been completely written.
20702          * When writing a command completion or response to an internal processor,
20703          * the order of writes has to be such that this field is written last.
20704          */
20705         uint8_t valid;
20706 } __rte_packed;
20707
20708 /***********************
20709  * hwrm_port_prbs_test *
20710  ***********************/
20711
20712
20713 /* hwrm_port_prbs_test_input (size:384b/48B) */
20714 struct hwrm_port_prbs_test_input {
20715         /* The HWRM command request type. */
20716         uint16_t        req_type;
20717         /*
20718          * The completion ring to send the completion event on. This should
20719          * be the NQ ID returned from the `nq_alloc` HWRM command.
20720          */
20721         uint16_t        cmpl_ring;
20722         /*
20723          * The sequence ID is used by the driver for tracking multiple
20724          * commands. This ID is treated as opaque data by the firmware and
20725          * the value is returned in the `hwrm_resp_hdr` upon completion.
20726          */
20727         uint16_t        seq_id;
20728         /*
20729          * The target ID of the command:
20730          * * 0x0-0xFFF8 - The function ID
20731          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20732          * * 0xFFFD - Reserved for user-space HWRM interface
20733          * * 0xFFFF - HWRM
20734          */
20735         uint16_t        target_id;
20736         /*
20737          * A physical address pointer pointing to a host buffer that the
20738          * command's response data will be written. This can be either a host
20739          * physical address (HPA) or a guest physical address (GPA) and must
20740          * point to a physically contiguous block of memory.
20741          */
20742         uint64_t        resp_addr;
20743         /* Host address data is to DMA'd to. */
20744         uint64_t        resp_data_addr;
20745         /*
20746          * Size of the buffer pointed to by resp_data_addr. The firmware may
20747          * use this entire buffer or less than the entire buffer, but never more.
20748          */
20749         uint16_t        data_len;
20750         uint16_t        unused_0;
20751         uint32_t        unused_1;
20752         /* Port ID of port where PRBS test to be run. */
20753         uint16_t        port_id;
20754         /* Polynomial selection for PRBS test. */
20755         uint16_t        poly;
20756         /* PRBS7 */
20757         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
20758         /* PRBS9 */
20759         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
20760         /* PRBS11 */
20761         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
20762         /* PRBS15 */
20763         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
20764         /* PRBS23 */
20765         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
20766         /* PRBS31 */
20767         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
20768         /* PRBS58 */
20769         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
20770         /* Invalid */
20771         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
20772         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST \
20773                 HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
20774         /*
20775          * Configuration bits for PRBS test.
20776          * Use enable bit to start/stop test.
20777          * Use tx/rx lane map bits to run test on specific lanes,
20778          * if set to 0 test will be run on all lanes.
20779          */
20780         uint16_t        prbs_config;
20781         /*
20782          * Set 0 to stop test currently in progress
20783          * Set 1 to start test with configuration provided.
20784          */
20785         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP \
20786                 UINT32_C(0x1)
20787         /*
20788          * If set to 1, tx_lane_map bitmap should have lane bits set.
20789          * If set to 0, test will be run on all lanes for this port.
20790          */
20791         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID \
20792                 UINT32_C(0x2)
20793         /*
20794          * If set to 1, rx_lane_map bitmap should have lane bits set.
20795          * If set to 0, test will be run on all lanes for this port.
20796          */
20797         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID \
20798                 UINT32_C(0x4)
20799         /* Duration in seconds to run the PRBS test. */
20800         uint16_t        timeout;
20801         /*
20802          * If tx_lane_map_valid is set to 1, this field is a bitmap
20803          * of tx lanes to run PRBS test. bit0 = lane0,
20804          * bit1 = lane1 ..bit31 = lane31
20805          */
20806         uint32_t        tx_lane_map;
20807         /*
20808          * If rx_lane_map_valid is set to 1, this field is a bitmap
20809          * of rx lanes to run PRBS test. bit0 = lane0,
20810          * bit1 = lane1 ..bit31 = lane31
20811          */
20812         uint32_t        rx_lane_map;
20813 } __rte_packed;
20814
20815 /* hwrm_port_prbs_test_output (size:128b/16B) */
20816 struct hwrm_port_prbs_test_output {
20817         /* The specific error status for the command. */
20818         uint16_t        error_code;
20819         /* The HWRM command request type. */
20820         uint16_t        req_type;
20821         /* The sequence ID from the original command. */
20822         uint16_t        seq_id;
20823         /* The length of the response data in number of bytes. */
20824         uint16_t        resp_len;
20825         /* Total length of stored data. */
20826         uint16_t        total_data_len;
20827         uint16_t        unused_0;
20828         uint8_t unused_1[3];
20829         /*
20830          * This field is used in Output records to indicate that the output
20831          * is completely written to RAM.  This field should be read as '1'
20832          * to indicate that the output has been completely written.
20833          * When writing a command completion or response to an internal processor,
20834          * the order of writes has to be such that this field is written last.
20835          */
20836         uint8_t valid;
20837 } __rte_packed;
20838
20839 /**********************
20840  * hwrm_port_dsc_dump *
20841  **********************/
20842
20843
20844 /* hwrm_port_dsc_dump_input (size:320b/40B) */
20845 struct hwrm_port_dsc_dump_input {
20846         /* The HWRM command request type. */
20847         uint16_t        req_type;
20848         /*
20849          * The completion ring to send the completion event on. This should
20850          * be the NQ ID returned from the `nq_alloc` HWRM command.
20851          */
20852         uint16_t        cmpl_ring;
20853         /*
20854          * The sequence ID is used by the driver for tracking multiple
20855          * commands. This ID is treated as opaque data by the firmware and
20856          * the value is returned in the `hwrm_resp_hdr` upon completion.
20857          */
20858         uint16_t        seq_id;
20859         /*
20860          * The target ID of the command:
20861          * * 0x0-0xFFF8 - The function ID
20862          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20863          * * 0xFFFD - Reserved for user-space HWRM interface
20864          * * 0xFFFF - HWRM
20865          */
20866         uint16_t        target_id;
20867         /*
20868          * A physical address pointer pointing to a host buffer that the
20869          * command's response data will be written. This can be either a host
20870          * physical address (HPA) or a guest physical address (GPA) and must
20871          * point to a physically contiguous block of memory.
20872          */
20873         uint64_t        resp_addr;
20874         /* Host address where response diagnostic data is returned. */
20875         uint64_t        resp_data_addr;
20876         /*
20877          * Size of the buffer pointed to by resp_data_addr. The firmware
20878          * may use this entire buffer or less than the entire buffer, but
20879          * never more.
20880          */
20881         uint16_t        data_len;
20882         uint16_t        unused_0;
20883         uint32_t        unused_1;
20884         /* Port ID of port where dsc dump to be collected. */
20885         uint16_t        port_id;
20886         /* Diag level specified by the user */
20887         uint16_t        diag_level;
20888         /* SRDS_DIAG_LANE */
20889         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE \
20890                 UINT32_C(0x0)
20891         /* SRDS_DIAG_CORE */
20892         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_CORE \
20893                 UINT32_C(0x1)
20894         /* SRDS_DIAG_EVENT */
20895         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT \
20896                 UINT32_C(0x2)
20897         /* SRDS_DIAG_EYE */
20898         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EYE \
20899                 UINT32_C(0x3)
20900         /* SRDS_DIAG_REG_CORE */
20901         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_CORE \
20902                 UINT32_C(0x4)
20903         /* SRDS_DIAG_REG_LANE */
20904         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_LANE \
20905                 UINT32_C(0x5)
20906         /* SRDS_DIAG_UC_CORE */
20907         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_CORE \
20908                 UINT32_C(0x6)
20909         /* SRDS_DIAG_UC_LANE */
20910         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_LANE \
20911                 UINT32_C(0x7)
20912         /* SRDS_DIAG_LANE_DEBUG */
20913         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE_DEBUG \
20914                 UINT32_C(0x8)
20915         /* SRDS_DIAG_BER_VERT */
20916         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_VERT \
20917                 UINT32_C(0x9)
20918         /* SRDS_DIAG_BER_HORZ */
20919         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_HORZ \
20920                 UINT32_C(0xa)
20921         /* SRDS_DIAG_EVENT_SAFE */
20922         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT_SAFE \
20923                 UINT32_C(0xb)
20924         /* SRDS_DIAG_TIMESTAMP */
20925         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP \
20926                 UINT32_C(0xc)
20927         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_LAST \
20928                 HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP
20929         /*
20930          * This field is a lane number
20931          * on which to collect the dsc dump
20932          */
20933         uint16_t        lane_number;
20934         /*
20935          * Configuration bits.
20936          * Use enable bit to start dsc dump or retrieve dump
20937          */
20938         uint16_t        dsc_dump_config;
20939         /*
20940          * Set 0 to retrieve the dsc dump
20941          * Set 1 to start the dsc dump
20942          */
20943         #define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE \
20944                 UINT32_C(0x1)
20945 } __rte_packed;
20946
20947 /* hwrm_port_dsc_dump_output (size:128b/16B) */
20948 struct hwrm_port_dsc_dump_output {
20949         /* The specific error status for the command. */
20950         uint16_t        error_code;
20951         /* The HWRM command request type. */
20952         uint16_t        req_type;
20953         /* The sequence ID from the original command. */
20954         uint16_t        seq_id;
20955         /* The length of the response data in number of bytes. */
20956         uint16_t        resp_len;
20957         /* Total length of stored data. */
20958         uint16_t        total_data_len;
20959         uint16_t        unused_0;
20960         uint8_t unused_1[3];
20961         /*
20962          * This field is used in Output records to indicate that the output
20963          * is completely written to RAM.  This field should be read as '1'
20964          * to indicate that the output has been completely written.
20965          * When writing a command completion or response to an internal processor,
20966          * the order of writes has to be such that this field is written last.
20967          */
20968         uint8_t valid;
20969 } __rte_packed;
20970
20971 /******************************
20972  * hwrm_port_sfp_sideband_cfg *
20973  ******************************/
20974
20975
20976 /* hwrm_port_sfp_sideband_cfg_input (size:256b/32B) */
20977 struct hwrm_port_sfp_sideband_cfg_input {
20978         /* The HWRM command request type. */
20979         uint16_t        req_type;
20980         /*
20981          * The completion ring to send the completion event on. This should
20982          * be the NQ ID returned from the `nq_alloc` HWRM command.
20983          */
20984         uint16_t        cmpl_ring;
20985         /*
20986          * The sequence ID is used by the driver for tracking multiple
20987          * commands. This ID is treated as opaque data by the firmware and
20988          * the value is returned in the `hwrm_resp_hdr` upon completion.
20989          */
20990         uint16_t        seq_id;
20991         /*
20992          * The target ID of the command:
20993          * * 0x0-0xFFF8 - The function ID
20994          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20995          * * 0xFFFD - Reserved for user-space HWRM interface
20996          * * 0xFFFF - HWRM
20997          */
20998         uint16_t        target_id;
20999         /*
21000          * A physical address pointer pointing to a host buffer that the
21001          * command's response data will be written. This can be either a host
21002          * physical address (HPA) or a guest physical address (GPA) and must
21003          * point to a physically contiguous block of memory.
21004          */
21005         uint64_t        resp_addr;
21006         /* Port ID of port that is to be queried. */
21007         uint16_t        port_id;
21008         uint8_t unused_0[6];
21009         /*
21010          * This bitfield is used to specify which bits from the 'flags'
21011          * fields are being configured by the caller.
21012          */
21013         uint32_t        enables;
21014         /* This bit must be '1' for rs0 to be configured. */
21015         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS0 \
21016                 UINT32_C(0x1)
21017         /* This bit must be '1' for rs1 to be configured. */
21018         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS1 \
21019                 UINT32_C(0x2)
21020         /* This bit must be '1' for tx_disable to be configured. */
21021         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_TX_DIS \
21022                 UINT32_C(0x4)
21023         /*
21024          * This bit must be '1' for mod_sel to be configured.
21025          * Valid only on QSFP modules
21026          */
21027         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_MOD_SEL \
21028                 UINT32_C(0x8)
21029         /* This bit must be '1' for reset_l to be configured. */
21030         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RESET_L \
21031                 UINT32_C(0x10)
21032         /* This bit must be '1' for lp_mode to be configured. */
21033         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_LP_MODE \
21034                 UINT32_C(0x20)
21035         /* This bit must be '1' for pwr_disable to be configured. */
21036         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_PWR_DIS \
21037                 UINT32_C(0x40)
21038         /*
21039          * Only bits that have corresponding bits in the 'enables'
21040          * bitfield are processed by the firmware, all other bits
21041          * of 'flags' are ignored.
21042          */
21043         uint32_t        flags;
21044         /*
21045          * This bit along with rs1 configures the current speed of the dual
21046          * rate module. If these pins are GNDed then the speed can be changed
21047          * by driectly writing to EEPROM.
21048          */
21049         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS0 \
21050                 UINT32_C(0x1)
21051         /*
21052          * This bit along with rs0 configures the current speed of the dual
21053          * rate module. If these pins are GNDed then the speed can be changed
21054          * by driectly writing to EEPROM.
21055          */
21056         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS1 \
21057                 UINT32_C(0x2)
21058         /*
21059          * When this bit is set to '1', tx_disable is set.
21060          * On a 1G BASE-T module, if this bit is set,
21061          * module PHY registers will not be accessible.
21062          */
21063         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_TX_DIS \
21064                 UINT32_C(0x4)
21065         /*
21066          * When this bit is set to '1', this module is selected.
21067          * Valid only on QSFP modules
21068          */
21069         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_MOD_SEL \
21070                 UINT32_C(0x8)
21071         /*
21072          * If reset_l is set to 0, Module will be taken out of reset
21073          * and other signals will be set to their requested state once
21074          * the module is out of reset.
21075          * Valid only on QSFP modules
21076          */
21077         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RESET_L \
21078                 UINT32_C(0x10)
21079         /*
21080          * When this bit is set to '1', the module will be configured
21081          * in low power mode.
21082          * Valid only on QSFP modules
21083          */
21084         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_LP_MODE \
21085                 UINT32_C(0x20)
21086         /* When this bit is set to '1', the module will be powered down. */
21087         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS \
21088                 UINT32_C(0x40)
21089 } __rte_packed;
21090
21091 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
21092 struct hwrm_port_sfp_sideband_cfg_output {
21093         /* The specific error status for the command. */
21094         uint16_t        error_code;
21095         /* The HWRM command request type. */
21096         uint16_t        req_type;
21097         /* The sequence ID from the original command. */
21098         uint16_t        seq_id;
21099         /* The length of the response data in number of bytes. */
21100         uint16_t        resp_len;
21101         uint8_t unused[7];
21102         /*
21103          * This field is used in Output records to indicate that the output
21104          * is completely written to RAM.  This field should be read as '1'
21105          * to indicate that the output has been completely written. When
21106          * writing a command completion or response to an internal processor,
21107          * the order of writes has to be such that this field is written last.
21108          */
21109         uint8_t valid;
21110 } __rte_packed;
21111
21112 /*******************************
21113  * hwrm_port_sfp_sideband_qcfg *
21114  *******************************/
21115
21116
21117 /* hwrm_port_sfp_sideband_qcfg_input (size:192b/24B) */
21118 struct hwrm_port_sfp_sideband_qcfg_input {
21119         /* The HWRM command request type. */
21120         uint16_t        req_type;
21121         /*
21122          * The completion ring to send the completion event on. This should
21123          * be the NQ ID returned from the `nq_alloc` HWRM command.
21124          */
21125         uint16_t        cmpl_ring;
21126         /*
21127          * The sequence ID is used by the driver for tracking multiple
21128          * commands. This ID is treated as opaque data by the firmware and
21129          * the value is returned in the `hwrm_resp_hdr` upon completion.
21130          */
21131         uint16_t        seq_id;
21132         /*
21133          * The target ID of the command:
21134          * * 0x0-0xFFF8 - The function ID
21135          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21136          * * 0xFFFD - Reserved for user-space HWRM interface
21137          * * 0xFFFF - HWRM
21138          */
21139         uint16_t        target_id;
21140         /*
21141          * A physical address pointer pointing to a host buffer that the
21142          * command's response data will be written. This can be either a host
21143          * physical address (HPA) or a guest physical address (GPA) and must
21144          * point to a physically contiguous block of memory.
21145          */
21146         uint64_t        resp_addr;
21147         /* Port ID of port that is to be queried. */
21148         uint16_t        port_id;
21149         uint8_t unused_0[6];
21150 } __rte_packed;
21151
21152 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
21153 struct hwrm_port_sfp_sideband_qcfg_output {
21154         /* The specific error status for the command. */
21155         uint16_t        error_code;
21156         /* The HWRM command request type. */
21157         uint16_t        req_type;
21158         /* The sequence ID from the original command. */
21159         uint16_t        seq_id;
21160         /* The length of the response data in number of bytes. */
21161         uint16_t        resp_len;
21162         /*
21163          * Bitmask indicating which sideband signals are valid.
21164          * This is based on the board and nvm cfg that is present on the board.
21165          */
21166         uint32_t        supported_mask;
21167         uint32_t        sideband_signals;
21168         /* When this bit is set to '1', the Module is absent. */
21169         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_ABS \
21170                 UINT32_C(0x1)
21171         /*
21172          * When this bit is set to '1', there is no valid signal on RX.
21173          * This signal is a filtered version of Signal Detect.
21174          */
21175         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RX_LOS \
21176                 UINT32_C(0x2)
21177         /*
21178          * This bit along with rs1 indiactes the current speed of the dual
21179          * rate module.If these pins are grounded then the speed can be
21180          * changed by driectky writing to EEPROM.
21181          */
21182         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS0 \
21183                 UINT32_C(0x4)
21184         /*
21185          * This bit along with rs0 indiactes the current speed of the dual
21186          * rate module.If these pins are grounded then the speed can be
21187          * changed by driectky writing to EEPROM.
21188          */
21189         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS1 \
21190                 UINT32_C(0x8)
21191         /*
21192          * When this bit is set to '1', tx_disable is set.
21193          * On a 1G BASE-T module, if this bit is set, module PHY
21194          * registers will not be accessible.
21195          */
21196         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_DIS \
21197                 UINT32_C(0x10)
21198         /* When this bit is set to '1', tx_fault is set. */
21199         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_FAULT \
21200                 UINT32_C(0x20)
21201         /*
21202          * When this bit is set to '1', module is selected.
21203          * Valid only on QSFP modules
21204          */
21205         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_SEL \
21206                 UINT32_C(0x40)
21207         /*
21208          * When this bit is set to '0', the module is held in reset.
21209          * if reset_l is set to 1,first module is taken out of reset
21210          * and other signals will be set to their requested state.
21211          * Valid only on QSFP modules.
21212          */
21213         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RESET_L \
21214                 UINT32_C(0x80)
21215         /*
21216          * When this bit is set to '1', the module is in low power mode.
21217          * Valid only on QSFP modules
21218          */
21219         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_LP_MODE \
21220                 UINT32_C(0x100)
21221         /* When this bit is set to '1', module is in power down state. */
21222         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_PWR_DIS \
21223                 UINT32_C(0x200)
21224         uint8_t unused[7];
21225         /*
21226          * This field is used in Output records to indicate that the output
21227          * is completely written to RAM.  This field should be read as '1'
21228          * to indicate that the output has been completely written. When
21229          * writing a command completion or response to an internal processor,
21230          * the order of writes has to be such that this field is written last.
21231          */
21232         uint8_t valid;
21233 } __rte_packed;
21234
21235 /**********************************
21236  * hwrm_port_phy_mdio_bus_acquire *
21237  **********************************/
21238
21239
21240 /* hwrm_port_phy_mdio_bus_acquire_input (size:192b/24B) */
21241 struct hwrm_port_phy_mdio_bus_acquire_input {
21242         /* The HWRM command request type. */
21243         uint16_t        req_type;
21244         /*
21245          * The completion ring to send the completion event on. This should
21246          * be the NQ ID returned from the `nq_alloc` HWRM command.
21247          */
21248         uint16_t        cmpl_ring;
21249         /*
21250          * The sequence ID is used by the driver for tracking multiple
21251          * commands. This ID is treated as opaque data by the firmware and
21252          * the value is returned in the `hwrm_resp_hdr` upon completion.
21253          */
21254         uint16_t        seq_id;
21255         /*
21256          * The target ID of the command:
21257          * * 0x0-0xFFF8 - The function ID
21258          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21259          * * 0xFFFD - Reserved for user-space HWRM interface
21260          * * 0xFFFF - HWRM
21261          */
21262         uint16_t        target_id;
21263         /*
21264          * A physical address pointer pointing to a host buffer that the
21265          * command's response data will be written. This can be either a host
21266          * physical address (HPA) or a guest physical address (GPA) and must
21267          * point to a physically contiguous block of memory.
21268          */
21269         uint64_t        resp_addr;
21270         /* Port ID of the port. */
21271         uint16_t        port_id;
21272         /*
21273          * client_id of the client requesting BUS access.
21274          * Any value from 0x10 to 0xFFFF can be used.
21275          * Client should make sure that the returned client_id
21276          * in response matches the client_id in request.
21277          * 0-0xF are reserved for internal use.
21278          */
21279         uint16_t        client_id;
21280         /*
21281          * Timeout in milli seconds, MDIO BUS will be released automatically
21282          * after this time, if another mdio acquire command is not received
21283          * within the timeout window from the same client.
21284          * A 0xFFFF will hold the bus until this bus is released.
21285          */
21286         uint16_t        mdio_bus_timeout;
21287         uint8_t unused_0[2];
21288 } __rte_packed;
21289
21290 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
21291 struct hwrm_port_phy_mdio_bus_acquire_output {
21292         /* The specific error status for the command. */
21293         uint16_t        error_code;
21294         /* The HWRM command request type. */
21295         uint16_t        req_type;
21296         /* The sequence ID from the original command. */
21297         uint16_t        seq_id;
21298         /* The length of the response data in number of bytes. */
21299         uint16_t        resp_len;
21300         uint16_t        unused_0;
21301         /*
21302          * client_id of the module holding the BUS.
21303          * 0-0xF are reserved for internal use.
21304          */
21305         uint16_t        client_id;
21306         uint8_t unused_1[3];
21307         /*
21308          * This field is used in Output records to indicate that the output
21309          * is completely written to RAM.  This field should be read as '1'
21310          * to indicate that the output has been completely written.
21311          * When writing a command completion or response to an internal processor,
21312          * the order of writes has to be such that this field is written last.
21313          */
21314         uint8_t valid;
21315 } __rte_packed;
21316
21317 /**********************************
21318  * hwrm_port_phy_mdio_bus_release *
21319  **********************************/
21320
21321
21322 /* hwrm_port_phy_mdio_bus_release_input (size:192b/24B) */
21323 struct hwrm_port_phy_mdio_bus_release_input {
21324         /* The HWRM command request type. */
21325         uint16_t        req_type;
21326         /*
21327          * The completion ring to send the completion event on. This should
21328          * be the NQ ID returned from the `nq_alloc` HWRM command.
21329          */
21330         uint16_t        cmpl_ring;
21331         /*
21332          * The sequence ID is used by the driver for tracking multiple
21333          * commands. This ID is treated as opaque data by the firmware and
21334          * the value is returned in the `hwrm_resp_hdr` upon completion.
21335          */
21336         uint16_t        seq_id;
21337         /*
21338          * The target ID of the command:
21339          * * 0x0-0xFFF8 - The function ID
21340          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21341          * * 0xFFFD - Reserved for user-space HWRM interface
21342          * * 0xFFFF - HWRM
21343          */
21344         uint16_t        target_id;
21345         /*
21346          * A physical address pointer pointing to a host buffer that the
21347          * command's response data will be written. This can be either a host
21348          * physical address (HPA) or a guest physical address (GPA) and must
21349          * point to a physically contiguous block of memory.
21350          */
21351         uint64_t        resp_addr;
21352         /* Port ID of the port. */
21353         uint16_t        port_id;
21354         /*
21355          * client_id of the client requesting BUS release.
21356          * A client should not release any other clients BUS.
21357          */
21358         uint16_t        client_id;
21359         uint8_t unused_0[4];
21360 } __rte_packed;
21361
21362 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
21363 struct hwrm_port_phy_mdio_bus_release_output {
21364         /* The specific error status for the command. */
21365         uint16_t        error_code;
21366         /* The HWRM command request type. */
21367         uint16_t        req_type;
21368         /* The sequence ID from the original command. */
21369         uint16_t        seq_id;
21370         /* The length of the response data in number of bytes. */
21371         uint16_t        resp_len;
21372         uint16_t        unused_0;
21373         /* The BUS is released if client_id matches the client_id in request. */
21374         uint16_t        clients_id;
21375         uint8_t unused_1[3];
21376         /*
21377          * This field is used in Output records to indicate that the output
21378          * is completely written to RAM.  This field should be read as '1'
21379          * to indicate that the output has been completely written.
21380          * When writing a command completion or response to an internal processor,
21381          * the order of writes has to be such that this field is written last.
21382          */
21383         uint8_t valid;
21384 } __rte_packed;
21385
21386 /***********************
21387  * hwrm_queue_qportcfg *
21388  ***********************/
21389
21390
21391 /* hwrm_queue_qportcfg_input (size:192b/24B) */
21392 struct hwrm_queue_qportcfg_input {
21393         /* The HWRM command request type. */
21394         uint16_t        req_type;
21395         /*
21396          * The completion ring to send the completion event on. This should
21397          * be the NQ ID returned from the `nq_alloc` HWRM command.
21398          */
21399         uint16_t        cmpl_ring;
21400         /*
21401          * The sequence ID is used by the driver for tracking multiple
21402          * commands. This ID is treated as opaque data by the firmware and
21403          * the value is returned in the `hwrm_resp_hdr` upon completion.
21404          */
21405         uint16_t        seq_id;
21406         /*
21407          * The target ID of the command:
21408          * * 0x0-0xFFF8 - The function ID
21409          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21410          * * 0xFFFD - Reserved for user-space HWRM interface
21411          * * 0xFFFF - HWRM
21412          */
21413         uint16_t        target_id;
21414         /*
21415          * A physical address pointer pointing to a host buffer that the
21416          * command's response data will be written. This can be either a host
21417          * physical address (HPA) or a guest physical address (GPA) and must
21418          * point to a physically contiguous block of memory.
21419          */
21420         uint64_t        resp_addr;
21421         uint32_t        flags;
21422         /*
21423          * Enumeration denoting the RX, TX type of the resource.
21424          * This enumeration is used for resources that are similar for both
21425          * TX and RX paths of the chip.
21426          */
21427         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
21428         /* tx path */
21429         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
21430         /* rx path */
21431         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
21432         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
21433                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
21434         /*
21435          * Port ID of port for which the queue configuration is being
21436          * queried. This field is only required when sent by IPC.
21437          */
21438         uint16_t        port_id;
21439         /*
21440          * Drivers will set this capability when it can use
21441          * queue_idx_service_profile to map the queues to application.
21442          */
21443         uint8_t drv_qmap_cap;
21444         /* disabled */
21445         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
21446         /* enabled */
21447         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
21448         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
21449                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
21450         uint8_t unused_0;
21451 } __rte_packed;
21452
21453 /* hwrm_queue_qportcfg_output (size:1344b/168B) */
21454 struct hwrm_queue_qportcfg_output {
21455         /* The specific error status for the command. */
21456         uint16_t        error_code;
21457         /* The HWRM command request type. */
21458         uint16_t        req_type;
21459         /* The sequence ID from the original command. */
21460         uint16_t        seq_id;
21461         /* The length of the response data in number of bytes. */
21462         uint16_t        resp_len;
21463         /*
21464          * The maximum number of queues that can be configured on this
21465          * port.
21466          * Valid values range from 1 through 8.
21467          */
21468         uint8_t max_configurable_queues;
21469         /*
21470          * The maximum number of lossless queues that can be configured
21471          * on this port.
21472          * Valid values range from 0 through 8.
21473          */
21474         uint8_t max_configurable_lossless_queues;
21475         /*
21476          * Bitmask indicating which queues can be configured by the
21477          * hwrm_queue_cfg command.
21478          *
21479          * Each bit represents a specific queue where bit 0 represents
21480          * queue 0 and bit 7 represents queue 7.
21481          * # A value of 0 indicates that the queue is not configurable
21482          * by the hwrm_queue_cfg command.
21483          * # A value of 1 indicates that the queue is configurable.
21484          * # A hwrm_queue_cfg command shall return error when trying to
21485          * configure a queue not configurable.
21486          */
21487         uint8_t queue_cfg_allowed;
21488         /* Information about queue configuration. */
21489         uint8_t queue_cfg_info;
21490         /*
21491          * If this flag is set to '1', then the queues are
21492          * configured asymmetrically on TX and RX sides.
21493          * If this flag is set to '0', then the queues are
21494          * configured symmetrically on TX and RX sides. For
21495          * symmetric configuration, the queue configuration
21496          * including queue ids and service profiles on the
21497          * TX side is the same as the corresponding queue
21498          * configuration on the RX side.
21499          */
21500         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
21501                 UINT32_C(0x1)
21502         /*
21503          * Bitmask indicating which queues can be configured by the
21504          * hwrm_queue_pfcenable_cfg command.
21505          *
21506          * Each bit represents a specific priority where bit 0 represents
21507          * priority 0 and bit 7 represents priority 7.
21508          * # A value of 0 indicates that the priority is not configurable by
21509          * the hwrm_queue_pfcenable_cfg command.
21510          * # A value of 1 indicates that the priority is configurable.
21511          * # A hwrm_queue_pfcenable_cfg command shall return error when
21512          * trying to configure a priority that is not configurable.
21513          */
21514         uint8_t queue_pfcenable_cfg_allowed;
21515         /*
21516          * Bitmask indicating which queues can be configured by the
21517          * hwrm_queue_pri2cos_cfg command.
21518          *
21519          * Each bit represents a specific queue where bit 0 represents
21520          * queue 0 and bit 7 represents queue 7.
21521          * # A value of 0 indicates that the queue is not configurable
21522          * by the hwrm_queue_pri2cos_cfg command.
21523          * # A value of 1 indicates that the queue is configurable.
21524          * # A hwrm_queue_pri2cos_cfg command shall return error when
21525          * trying to configure a queue that is not configurable.
21526          */
21527         uint8_t queue_pri2cos_cfg_allowed;
21528         /*
21529          * Bitmask indicating which queues can be configured by the
21530          * hwrm_queue_pri2cos_cfg command.
21531          *
21532          * Each bit represents a specific queue where bit 0 represents
21533          * queue 0 and bit 7 represents queue 7.
21534          * # A value of 0 indicates that the queue is not configurable
21535          * by the hwrm_queue_pri2cos_cfg command.
21536          * # A value of 1 indicates that the queue is configurable.
21537          * # A hwrm_queue_pri2cos_cfg command shall return error when
21538          * trying to configure a queue not configurable.
21539          */
21540         uint8_t queue_cos2bw_cfg_allowed;
21541         /*
21542          * ID of CoS Queue 0.
21543          * FF - Invalid id
21544          *
21545          * # This ID can be used on any subsequent call to an hwrm command
21546          * that takes a queue id.
21547          * # IDs must always be queried by this command before any use
21548          * by the driver or software.
21549          * # Any driver or software should not make any assumptions about
21550          * queue IDs.
21551          * # A value of 0xff indicates that the queue is not available.
21552          * # Available queues may not be in sequential order.
21553          */
21554         uint8_t queue_id0;
21555         /* This value is applicable to CoS queues only. */
21556         uint8_t queue_id0_service_profile;
21557         /* Lossy (best-effort) */
21558         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
21559                 UINT32_C(0x0)
21560         /* Lossless (legacy) */
21561         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
21562                 UINT32_C(0x1)
21563         /* Lossless RoCE */
21564         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
21565                 UINT32_C(0x1)
21566         /* Lossy RoCE CNP */
21567         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21568                 UINT32_C(0x2)
21569         /* Lossless NIC */
21570         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
21571                 UINT32_C(0x3)
21572         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21573         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
21574                 UINT32_C(0xff)
21575         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
21576                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
21577         /*
21578          * ID of CoS Queue 1.
21579          * FF - Invalid id
21580          *
21581          * # This ID can be used on any subsequent call to an hwrm command
21582          * that takes a queue id.
21583          * # IDs must always be queried by this command before any use
21584          * by the driver or software.
21585          * # Any driver or software should not make any assumptions about
21586          * queue IDs.
21587          * # A value of 0xff indicates that the queue is not available.
21588          * # Available queues may not be in sequential order.
21589          */
21590         uint8_t queue_id1;
21591         /* This value is applicable to CoS queues only. */
21592         uint8_t queue_id1_service_profile;
21593         /* Lossy (best-effort) */
21594         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
21595                 UINT32_C(0x0)
21596         /* Lossless (legacy) */
21597         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
21598                 UINT32_C(0x1)
21599         /* Lossless RoCE */
21600         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
21601                 UINT32_C(0x1)
21602         /* Lossy RoCE CNP */
21603         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21604                 UINT32_C(0x2)
21605         /* Lossless NIC */
21606         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
21607                 UINT32_C(0x3)
21608         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21609         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
21610                 UINT32_C(0xff)
21611         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
21612                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
21613         /*
21614          * ID of CoS Queue 2.
21615          * FF - Invalid id
21616          *
21617          * # This ID can be used on any subsequent call to an hwrm command
21618          * that takes a queue id.
21619          * # IDs must always be queried by this command before any use
21620          * by the driver or software.
21621          * # Any driver or software should not make any assumptions about
21622          * queue IDs.
21623          * # A value of 0xff indicates that the queue is not available.
21624          * # Available queues may not be in sequential order.
21625          */
21626         uint8_t queue_id2;
21627         /* This value is applicable to CoS queues only. */
21628         uint8_t queue_id2_service_profile;
21629         /* Lossy (best-effort) */
21630         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
21631                 UINT32_C(0x0)
21632         /* Lossless (legacy) */
21633         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
21634                 UINT32_C(0x1)
21635         /* Lossless RoCE */
21636         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
21637                 UINT32_C(0x1)
21638         /* Lossy RoCE CNP */
21639         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21640                 UINT32_C(0x2)
21641         /* Lossless NIC */
21642         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
21643                 UINT32_C(0x3)
21644         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21645         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
21646                 UINT32_C(0xff)
21647         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
21648                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
21649         /*
21650          * ID of CoS Queue 3.
21651          * FF - Invalid id
21652          *
21653          * # This ID can be used on any subsequent call to an hwrm command
21654          * that takes a queue id.
21655          * # IDs must always be queried by this command before any use
21656          * by the driver or software.
21657          * # Any driver or software should not make any assumptions about
21658          * queue IDs.
21659          * # A value of 0xff indicates that the queue is not available.
21660          * # Available queues may not be in sequential order.
21661          */
21662         uint8_t queue_id3;
21663         /* This value is applicable to CoS queues only. */
21664         uint8_t queue_id3_service_profile;
21665         /* Lossy (best-effort) */
21666         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
21667                 UINT32_C(0x0)
21668         /* Lossless (legacy) */
21669         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
21670                 UINT32_C(0x1)
21671         /* Lossless RoCE */
21672         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
21673                 UINT32_C(0x1)
21674         /* Lossy RoCE CNP */
21675         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21676                 UINT32_C(0x2)
21677         /* Lossless NIC */
21678         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
21679                 UINT32_C(0x3)
21680         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21681         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
21682                 UINT32_C(0xff)
21683         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
21684                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
21685         /*
21686          * ID of CoS Queue 4.
21687          * FF - Invalid id
21688          *
21689          * # This ID can be used on any subsequent call to an hwrm command
21690          * that takes a queue id.
21691          * # IDs must always be queried by this command before any use
21692          * by the driver or software.
21693          * # Any driver or software should not make any assumptions about
21694          * queue IDs.
21695          * # A value of 0xff indicates that the queue is not available.
21696          * # Available queues may not be in sequential order.
21697          */
21698         uint8_t queue_id4;
21699         /* This value is applicable to CoS queues only. */
21700         uint8_t queue_id4_service_profile;
21701         /* Lossy (best-effort) */
21702         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
21703                 UINT32_C(0x0)
21704         /* Lossless (legacy) */
21705         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
21706                 UINT32_C(0x1)
21707         /* Lossless RoCE */
21708         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
21709                 UINT32_C(0x1)
21710         /* Lossy RoCE CNP */
21711         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21712                 UINT32_C(0x2)
21713         /* Lossless NIC */
21714         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
21715                 UINT32_C(0x3)
21716         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21717         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
21718                 UINT32_C(0xff)
21719         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
21720                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
21721         /*
21722          * ID of CoS Queue 5.
21723          * FF - Invalid id
21724          *
21725          * # This ID can be used on any subsequent call to an hwrm command
21726          * that takes a queue id.
21727          * # IDs must always be queried by this command before any use
21728          * by the driver or software.
21729          * # Any driver or software should not make any assumptions about
21730          * queue IDs.
21731          * # A value of 0xff indicates that the queue is not available.
21732          * # Available queues may not be in sequential order.
21733          */
21734         uint8_t queue_id5;
21735         /* This value is applicable to CoS queues only. */
21736         uint8_t queue_id5_service_profile;
21737         /* Lossy (best-effort) */
21738         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
21739                 UINT32_C(0x0)
21740         /* Lossless (legacy) */
21741         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
21742                 UINT32_C(0x1)
21743         /* Lossless RoCE */
21744         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
21745                 UINT32_C(0x1)
21746         /* Lossy RoCE CNP */
21747         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21748                 UINT32_C(0x2)
21749         /* Lossless NIC */
21750         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
21751                 UINT32_C(0x3)
21752         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21753         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
21754                 UINT32_C(0xff)
21755         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
21756                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
21757         /*
21758          * ID of CoS Queue 6.
21759          * FF - Invalid id
21760          *
21761          * # This ID can be used on any subsequent call to an hwrm command
21762          * that takes a queue id.
21763          * # IDs must always be queried by this command before any use
21764          * by the driver or software.
21765          * # Any driver or software should not make any assumptions about
21766          * queue IDs.
21767          * # A value of 0xff indicates that the queue is not available.
21768          * # Available queues may not be in sequential order.
21769          */
21770         uint8_t queue_id6;
21771         /* This value is applicable to CoS queues only. */
21772         uint8_t queue_id6_service_profile;
21773         /* Lossy (best-effort) */
21774         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
21775                 UINT32_C(0x0)
21776         /* Lossless (legacy) */
21777         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
21778                 UINT32_C(0x1)
21779         /* Lossless RoCE */
21780         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
21781                 UINT32_C(0x1)
21782         /* Lossy RoCE CNP */
21783         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21784                 UINT32_C(0x2)
21785         /* Lossless NIC */
21786         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
21787                 UINT32_C(0x3)
21788         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21789         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
21790                 UINT32_C(0xff)
21791         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
21792                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
21793         /*
21794          * ID of CoS Queue 7.
21795          * FF - Invalid id
21796          *
21797          * # This ID can be used on any subsequent call to an hwrm command
21798          * that takes a queue id.
21799          * # IDs must always be queried by this command before any use
21800          * by the driver or software.
21801          * # Any driver or software should not make any assumptions about
21802          * queue IDs.
21803          * # A value of 0xff indicates that the queue is not available.
21804          * # Available queues may not be in sequential order.
21805          */
21806         uint8_t queue_id7;
21807         /* This value is applicable to CoS queues only. */
21808         uint8_t queue_id7_service_profile;
21809         /* Lossy (best-effort) */
21810         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
21811                 UINT32_C(0x0)
21812         /* Lossless (legacy) */
21813         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
21814                 UINT32_C(0x1)
21815         /* Lossless RoCE */
21816         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
21817                 UINT32_C(0x1)
21818         /* Lossy RoCE CNP */
21819         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
21820                 UINT32_C(0x2)
21821         /* Lossless NIC */
21822         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
21823                 UINT32_C(0x3)
21824         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21825         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
21826                 UINT32_C(0xff)
21827         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
21828                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
21829         uint8_t unused_0;
21830         /*
21831          * Up to 16 bytes of null padded ASCII string describing this queue.
21832          * The queue name includes a CoS queue index and, in some cases, text
21833          * that distinguishes the queue from other queues in the group.
21834          */
21835         char    qid0_name[16];
21836         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21837         char    qid1_name[16];
21838         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21839         char    qid2_name[16];
21840         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21841         char    qid3_name[16];
21842         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21843         char    qid4_name[16];
21844         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21845         char    qid5_name[16];
21846         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21847         char    qid6_name[16];
21848         /* Up to 16 bytes of null padded ASCII string describing this queue. */
21849         char    qid7_name[16];
21850         uint8_t unused_1[7];
21851         /*
21852          * This field is used in Output records to indicate that the output
21853          * is completely written to RAM. This field should be read as '1'
21854          * to indicate that the output has been completely written.
21855          * When writing a command completion or response to an internal processor,
21856          * the order of writes has to be such that this field is written last.
21857          */
21858         uint8_t valid;
21859 } __rte_packed;
21860
21861 /*******************
21862  * hwrm_queue_qcfg *
21863  *******************/
21864
21865
21866 /* hwrm_queue_qcfg_input (size:192b/24B) */
21867 struct hwrm_queue_qcfg_input {
21868         /* The HWRM command request type. */
21869         uint16_t        req_type;
21870         /*
21871          * The completion ring to send the completion event on. This should
21872          * be the NQ ID returned from the `nq_alloc` HWRM command.
21873          */
21874         uint16_t        cmpl_ring;
21875         /*
21876          * The sequence ID is used by the driver for tracking multiple
21877          * commands. This ID is treated as opaque data by the firmware and
21878          * the value is returned in the `hwrm_resp_hdr` upon completion.
21879          */
21880         uint16_t        seq_id;
21881         /*
21882          * The target ID of the command:
21883          * * 0x0-0xFFF8 - The function ID
21884          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21885          * * 0xFFFD - Reserved for user-space HWRM interface
21886          * * 0xFFFF - HWRM
21887          */
21888         uint16_t        target_id;
21889         /*
21890          * A physical address pointer pointing to a host buffer that the
21891          * command's response data will be written. This can be either a host
21892          * physical address (HPA) or a guest physical address (GPA) and must
21893          * point to a physically contiguous block of memory.
21894          */
21895         uint64_t        resp_addr;
21896         uint32_t        flags;
21897         /*
21898          * Enumeration denoting the RX, TX type of the resource.
21899          * This enumeration is used for resources that are similar for both
21900          * TX and RX paths of the chip.
21901          */
21902         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
21903         /* tx path */
21904         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
21905         /* rx path */
21906         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
21907         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
21908                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
21909         /* Queue ID of the queue. */
21910         uint32_t        queue_id;
21911 } __rte_packed;
21912
21913 /* hwrm_queue_qcfg_output (size:128b/16B) */
21914 struct hwrm_queue_qcfg_output {
21915         /* The specific error status for the command. */
21916         uint16_t        error_code;
21917         /* The HWRM command request type. */
21918         uint16_t        req_type;
21919         /* The sequence ID from the original command. */
21920         uint16_t        seq_id;
21921         /* The length of the response data in number of bytes. */
21922         uint16_t        resp_len;
21923         /*
21924          * This value is the estimate packet length used in the
21925          * TX arbiter.
21926          */
21927         uint32_t        queue_len;
21928         /* This value is applicable to CoS queues only. */
21929         uint8_t service_profile;
21930         /* Lossy (best-effort) */
21931         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
21932         /* Lossless */
21933         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
21934         /* Set to 0xFF... (All Fs) if there is no service profile specified */
21935         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
21936         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
21937                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
21938         /* Information about queue configuration. */
21939         uint8_t queue_cfg_info;
21940         /*
21941          * If this flag is set to '1', then the queue is
21942          * configured asymmetrically on TX and RX sides.
21943          * If this flag is set to '0', then this queue is
21944          * configured symmetrically on TX and RX sides.
21945          */
21946         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
21947                 UINT32_C(0x1)
21948         uint8_t unused_0;
21949         /*
21950          * This field is used in Output records to indicate that the output
21951          * is completely written to RAM. This field should be read as '1'
21952          * to indicate that the output has been completely written.
21953          * When writing a command completion or response to an internal processor,
21954          * the order of writes has to be such that this field is written last.
21955          */
21956         uint8_t valid;
21957 } __rte_packed;
21958
21959 /******************
21960  * hwrm_queue_cfg *
21961  ******************/
21962
21963
21964 /* hwrm_queue_cfg_input (size:320b/40B) */
21965 struct hwrm_queue_cfg_input {
21966         /* The HWRM command request type. */
21967         uint16_t        req_type;
21968         /*
21969          * The completion ring to send the completion event on. This should
21970          * be the NQ ID returned from the `nq_alloc` HWRM command.
21971          */
21972         uint16_t        cmpl_ring;
21973         /*
21974          * The sequence ID is used by the driver for tracking multiple
21975          * commands. This ID is treated as opaque data by the firmware and
21976          * the value is returned in the `hwrm_resp_hdr` upon completion.
21977          */
21978         uint16_t        seq_id;
21979         /*
21980          * The target ID of the command:
21981          * * 0x0-0xFFF8 - The function ID
21982          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21983          * * 0xFFFD - Reserved for user-space HWRM interface
21984          * * 0xFFFF - HWRM
21985          */
21986         uint16_t        target_id;
21987         /*
21988          * A physical address pointer pointing to a host buffer that the
21989          * command's response data will be written. This can be either a host
21990          * physical address (HPA) or a guest physical address (GPA) and must
21991          * point to a physically contiguous block of memory.
21992          */
21993         uint64_t        resp_addr;
21994         uint32_t        flags;
21995         /*
21996          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
21997          * This enumeration is used for resources that are similar for both
21998          * TX and RX paths of the chip.
21999          */
22000         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
22001         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
22002         /* tx path */
22003         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
22004         /* rx path */
22005         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
22006         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
22007         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
22008         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
22009                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
22010         uint32_t        enables;
22011         /*
22012          * This bit must be '1' for the dflt_len field to be
22013          * configured.
22014          */
22015         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
22016         /*
22017          * This bit must be '1' for the service_profile field to be
22018          * configured.
22019          */
22020         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
22021         /* Queue ID of queue that is to be configured by this function. */
22022         uint32_t        queue_id;
22023         /*
22024          * This value is a the estimate packet length used in the
22025          * TX arbiter.
22026          * Set to 0xFF... (All Fs) to not adjust this value.
22027          */
22028         uint32_t        dflt_len;
22029         /* This value is applicable to CoS queues only. */
22030         uint8_t service_profile;
22031         /* Lossy (best-effort) */
22032         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
22033         /* Lossless */
22034         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
22035         /* Set to 0xFF... (All Fs) if there is no service profile specified */
22036         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
22037         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
22038                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
22039         uint8_t unused_0[7];
22040 } __rte_packed;
22041
22042 /* hwrm_queue_cfg_output (size:128b/16B) */
22043 struct hwrm_queue_cfg_output {
22044         /* The specific error status for the command. */
22045         uint16_t        error_code;
22046         /* The HWRM command request type. */
22047         uint16_t        req_type;
22048         /* The sequence ID from the original command. */
22049         uint16_t        seq_id;
22050         /* The length of the response data in number of bytes. */
22051         uint16_t        resp_len;
22052         uint8_t unused_0[7];
22053         /*
22054          * This field is used in Output records to indicate that the output
22055          * is completely written to RAM. This field should be read as '1'
22056          * to indicate that the output has been completely written.
22057          * When writing a command completion or response to an internal processor,
22058          * the order of writes has to be such that this field is written last.
22059          */
22060         uint8_t valid;
22061 } __rte_packed;
22062
22063 /*****************************
22064  * hwrm_queue_pfcenable_qcfg *
22065  *****************************/
22066
22067
22068 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
22069 struct hwrm_queue_pfcenable_qcfg_input {
22070         /* The HWRM command request type. */
22071         uint16_t        req_type;
22072         /*
22073          * The completion ring to send the completion event on. This should
22074          * be the NQ ID returned from the `nq_alloc` HWRM command.
22075          */
22076         uint16_t        cmpl_ring;
22077         /*
22078          * The sequence ID is used by the driver for tracking multiple
22079          * commands. This ID is treated as opaque data by the firmware and
22080          * the value is returned in the `hwrm_resp_hdr` upon completion.
22081          */
22082         uint16_t        seq_id;
22083         /*
22084          * The target ID of the command:
22085          * * 0x0-0xFFF8 - The function ID
22086          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22087          * * 0xFFFD - Reserved for user-space HWRM interface
22088          * * 0xFFFF - HWRM
22089          */
22090         uint16_t        target_id;
22091         /*
22092          * A physical address pointer pointing to a host buffer that the
22093          * command's response data will be written. This can be either a host
22094          * physical address (HPA) or a guest physical address (GPA) and must
22095          * point to a physically contiguous block of memory.
22096          */
22097         uint64_t        resp_addr;
22098         /*
22099          * Port ID of port for which the table is being configured.
22100          * The HWRM needs to check whether this function is allowed
22101          * to configure pri2cos mapping on this port.
22102          */
22103         uint16_t        port_id;
22104         uint8_t unused_0[6];
22105 } __rte_packed;
22106
22107 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
22108 struct hwrm_queue_pfcenable_qcfg_output {
22109         /* The specific error status for the command. */
22110         uint16_t        error_code;
22111         /* The HWRM command request type. */
22112         uint16_t        req_type;
22113         /* The sequence ID from the original command. */
22114         uint16_t        seq_id;
22115         /* The length of the response data in number of bytes. */
22116         uint16_t        resp_len;
22117         uint32_t        flags;
22118         /* If set to 1, then PFC is enabled on PRI 0. */
22119         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
22120                 UINT32_C(0x1)
22121         /* If set to 1, then PFC is enabled on PRI 1. */
22122         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
22123                 UINT32_C(0x2)
22124         /* If set to 1, then PFC is enabled on PRI 2. */
22125         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
22126                 UINT32_C(0x4)
22127         /* If set to 1, then PFC is enabled on PRI 3. */
22128         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
22129                 UINT32_C(0x8)
22130         /* If set to 1, then PFC is enabled on PRI 4. */
22131         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
22132                 UINT32_C(0x10)
22133         /* If set to 1, then PFC is enabled on PRI 5. */
22134         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
22135                 UINT32_C(0x20)
22136         /* If set to 1, then PFC is enabled on PRI 6. */
22137         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
22138                 UINT32_C(0x40)
22139         /* If set to 1, then PFC is enabled on PRI 7. */
22140         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
22141                 UINT32_C(0x80)
22142         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
22143         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED \
22144                 UINT32_C(0x100)
22145         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
22146         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED \
22147                 UINT32_C(0x200)
22148         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
22149         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED \
22150                 UINT32_C(0x400)
22151         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
22152         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED \
22153                 UINT32_C(0x800)
22154         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
22155         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED \
22156                 UINT32_C(0x1000)
22157         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
22158         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED \
22159                 UINT32_C(0x2000)
22160         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
22161         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED \
22162                 UINT32_C(0x4000)
22163         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
22164         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED \
22165                 UINT32_C(0x8000)
22166         uint8_t unused_0[3];
22167         /*
22168          * This field is used in Output records to indicate that the output
22169          * is completely written to RAM. This field should be read as '1'
22170          * to indicate that the output has been completely written.
22171          * When writing a command completion or response to an internal processor,
22172          * the order of writes has to be such that this field is written last.
22173          */
22174         uint8_t valid;
22175 } __rte_packed;
22176
22177 /****************************
22178  * hwrm_queue_pfcenable_cfg *
22179  ****************************/
22180
22181
22182 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
22183 struct hwrm_queue_pfcenable_cfg_input {
22184         /* The HWRM command request type. */
22185         uint16_t        req_type;
22186         /*
22187          * The completion ring to send the completion event on. This should
22188          * be the NQ ID returned from the `nq_alloc` HWRM command.
22189          */
22190         uint16_t        cmpl_ring;
22191         /*
22192          * The sequence ID is used by the driver for tracking multiple
22193          * commands. This ID is treated as opaque data by the firmware and
22194          * the value is returned in the `hwrm_resp_hdr` upon completion.
22195          */
22196         uint16_t        seq_id;
22197         /*
22198          * The target ID of the command:
22199          * * 0x0-0xFFF8 - The function ID
22200          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22201          * * 0xFFFD - Reserved for user-space HWRM interface
22202          * * 0xFFFF - HWRM
22203          */
22204         uint16_t        target_id;
22205         /*
22206          * A physical address pointer pointing to a host buffer that the
22207          * command's response data will be written. This can be either a host
22208          * physical address (HPA) or a guest physical address (GPA) and must
22209          * point to a physically contiguous block of memory.
22210          */
22211         uint64_t        resp_addr;
22212         uint32_t        flags;
22213         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
22214         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
22215                 UINT32_C(0x1)
22216         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
22217         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
22218                 UINT32_C(0x2)
22219         /* If set to 1, then PFC is requested to be enabled on PRI 2. */
22220         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
22221                 UINT32_C(0x4)
22222         /* If set to 1, then PFC is requested to be enabled on PRI 3. */
22223         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
22224                 UINT32_C(0x8)
22225         /* If set to 1, then PFC is requested to be enabled on PRI 4. */
22226         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
22227                 UINT32_C(0x10)
22228         /* If set to 1, then PFC is requested to be enabled on PRI 5. */
22229         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
22230                 UINT32_C(0x20)
22231         /* If set to 1, then PFC is requested to be enabled on PRI 6. */
22232         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
22233                 UINT32_C(0x40)
22234         /* If set to 1, then PFC is requested to be enabled on PRI 7. */
22235         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
22236                 UINT32_C(0x80)
22237         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
22238         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED \
22239                 UINT32_C(0x100)
22240         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
22241         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED \
22242                 UINT32_C(0x200)
22243         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
22244         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED \
22245                 UINT32_C(0x400)
22246         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
22247         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED \
22248                 UINT32_C(0x800)
22249         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
22250         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED \
22251                 UINT32_C(0x1000)
22252         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
22253         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED \
22254                 UINT32_C(0x2000)
22255         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
22256         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED \
22257                 UINT32_C(0x4000)
22258         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
22259         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED \
22260                 UINT32_C(0x8000)
22261         /*
22262          * Port ID of port for which the table is being configured.
22263          * The HWRM needs to check whether this function is allowed
22264          * to configure pri2cos mapping on this port.
22265          */
22266         uint16_t        port_id;
22267         uint8_t unused_0[2];
22268 } __rte_packed;
22269
22270 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
22271 struct hwrm_queue_pfcenable_cfg_output {
22272         /* The specific error status for the command. */
22273         uint16_t        error_code;
22274         /* The HWRM command request type. */
22275         uint16_t        req_type;
22276         /* The sequence ID from the original command. */
22277         uint16_t        seq_id;
22278         /* The length of the response data in number of bytes. */
22279         uint16_t        resp_len;
22280         uint8_t unused_0[7];
22281         /*
22282          * This field is used in Output records to indicate that the output
22283          * is completely written to RAM. This field should be read as '1'
22284          * to indicate that the output has been completely written.
22285          * When writing a command completion or response to an internal processor,
22286          * the order of writes has to be such that this field is written last.
22287          */
22288         uint8_t valid;
22289 } __rte_packed;
22290
22291 /***************************
22292  * hwrm_queue_pri2cos_qcfg *
22293  ***************************/
22294
22295
22296 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
22297 struct hwrm_queue_pri2cos_qcfg_input {
22298         /* The HWRM command request type. */
22299         uint16_t        req_type;
22300         /*
22301          * The completion ring to send the completion event on. This should
22302          * be the NQ ID returned from the `nq_alloc` HWRM command.
22303          */
22304         uint16_t        cmpl_ring;
22305         /*
22306          * The sequence ID is used by the driver for tracking multiple
22307          * commands. This ID is treated as opaque data by the firmware and
22308          * the value is returned in the `hwrm_resp_hdr` upon completion.
22309          */
22310         uint16_t        seq_id;
22311         /*
22312          * The target ID of the command:
22313          * * 0x0-0xFFF8 - The function ID
22314          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22315          * * 0xFFFD - Reserved for user-space HWRM interface
22316          * * 0xFFFF - HWRM
22317          */
22318         uint16_t        target_id;
22319         /*
22320          * A physical address pointer pointing to a host buffer that the
22321          * command's response data will be written. This can be either a host
22322          * physical address (HPA) or a guest physical address (GPA) and must
22323          * point to a physically contiguous block of memory.
22324          */
22325         uint64_t        resp_addr;
22326         uint32_t        flags;
22327         /*
22328          * Enumeration denoting the RX, TX type of the resource.
22329          * This enumeration is used for resources that are similar for both
22330          * TX and RX paths of the chip.
22331          */
22332         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
22333         /* tx path */
22334         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
22335         /* rx path */
22336         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
22337         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
22338                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
22339         /*
22340          * When this bit is set to '0', the query is
22341          * for PRI from tunnel headers.
22342          * When this bit is set to '1', the query is
22343          * for PRI from inner packet headers.
22344          */
22345         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
22346         /*
22347          * Port ID of port for which the table is being configured.
22348          * The HWRM needs to check whether this function is allowed
22349          * to configure pri2cos mapping on this port.
22350          */
22351         uint8_t port_id;
22352         uint8_t unused_0[3];
22353 } __rte_packed;
22354
22355 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
22356 struct hwrm_queue_pri2cos_qcfg_output {
22357         /* The specific error status for the command. */
22358         uint16_t        error_code;
22359         /* The HWRM command request type. */
22360         uint16_t        req_type;
22361         /* The sequence ID from the original command. */
22362         uint16_t        seq_id;
22363         /* The length of the response data in number of bytes. */
22364         uint16_t        resp_len;
22365         /*
22366          * CoS Queue assigned to priority 0. This value can only
22367          * be changed before traffic has started.
22368          * A value of 0xff indicates that no CoS queue is assigned to the
22369          * specified priority.
22370          */
22371         uint8_t pri0_cos_queue_id;
22372         /*
22373          * CoS Queue assigned to priority 1. This value can only
22374          * be changed before traffic has started.
22375          * A value of 0xff indicates that no CoS queue is assigned to the
22376          * specified priority.
22377          */
22378         uint8_t pri1_cos_queue_id;
22379         /*
22380          * CoS Queue assigned to priority 2. This value can only
22381          * be changed before traffic has started.
22382          * A value of 0xff indicates that no CoS queue is assigned to the
22383          * specified priority.
22384          */
22385         uint8_t pri2_cos_queue_id;
22386         /*
22387          * CoS Queue assigned to priority 3. This value can only
22388          * be changed before traffic has started.
22389          * A value of 0xff indicates that no CoS queue is assigned to the
22390          * specified priority.
22391          */
22392         uint8_t pri3_cos_queue_id;
22393         /*
22394          * CoS Queue assigned to priority 4. This value can only
22395          * be changed before traffic has started.
22396          * A value of 0xff indicates that no CoS queue is assigned to the
22397          * specified priority.
22398          */
22399         uint8_t pri4_cos_queue_id;
22400         /*
22401          * CoS Queue assigned to priority 5. This value can only
22402          * be changed before traffic has started.
22403          * A value of 0xff indicates that no CoS queue is assigned to the
22404          * specified priority.
22405          */
22406         uint8_t pri5_cos_queue_id;
22407         /*
22408          * CoS Queue assigned to priority 6. This value can only
22409          * be changed before traffic has started.
22410          * A value of 0xff indicates that no CoS queue is assigned to the
22411          * specified priority.
22412          */
22413         uint8_t pri6_cos_queue_id;
22414         /*
22415          * CoS Queue assigned to priority 7. This value can only
22416          * be changed before traffic has started.
22417          * A value of 0xff indicates that no CoS queue is assigned to the
22418          * specified priority.
22419          */
22420         uint8_t pri7_cos_queue_id;
22421         /* Information about queue configuration. */
22422         uint8_t queue_cfg_info;
22423         /*
22424          * If this flag is set to '1', then the PRI to CoS
22425          * configuration is asymmetric on TX and RX sides.
22426          * If this flag is set to '0', then PRI to CoS configuration
22427          * is symmetric on TX and RX sides.
22428          */
22429         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
22430                 UINT32_C(0x1)
22431         uint8_t unused_0[6];
22432         /*
22433          * This field is used in Output records to indicate that the output
22434          * is completely written to RAM. This field should be read as '1'
22435          * to indicate that the output has been completely written.
22436          * When writing a command completion or response to an internal processor,
22437          * the order of writes has to be such that this field is written last.
22438          */
22439         uint8_t valid;
22440 } __rte_packed;
22441
22442 /**************************
22443  * hwrm_queue_pri2cos_cfg *
22444  **************************/
22445
22446
22447 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
22448 struct hwrm_queue_pri2cos_cfg_input {
22449         /* The HWRM command request type. */
22450         uint16_t        req_type;
22451         /*
22452          * The completion ring to send the completion event on. This should
22453          * be the NQ ID returned from the `nq_alloc` HWRM command.
22454          */
22455         uint16_t        cmpl_ring;
22456         /*
22457          * The sequence ID is used by the driver for tracking multiple
22458          * commands. This ID is treated as opaque data by the firmware and
22459          * the value is returned in the `hwrm_resp_hdr` upon completion.
22460          */
22461         uint16_t        seq_id;
22462         /*
22463          * The target ID of the command:
22464          * * 0x0-0xFFF8 - The function ID
22465          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22466          * * 0xFFFD - Reserved for user-space HWRM interface
22467          * * 0xFFFF - HWRM
22468          */
22469         uint16_t        target_id;
22470         /*
22471          * A physical address pointer pointing to a host buffer that the
22472          * command's response data will be written. This can be either a host
22473          * physical address (HPA) or a guest physical address (GPA) and must
22474          * point to a physically contiguous block of memory.
22475          */
22476         uint64_t        resp_addr;
22477         uint32_t        flags;
22478         /*
22479          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
22480          * This enumeration is used for resources that are similar for both
22481          * TX and RX paths of the chip.
22482          */
22483         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
22484         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
22485         /* tx path */
22486         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
22487         /* rx path */
22488         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
22489         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
22490         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
22491         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
22492                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
22493         /*
22494          * When this bit is set to '0', the mapping is requested
22495          * for PRI from tunnel headers.
22496          * When this bit is set to '1', the mapping is requested
22497          * for PRI from inner packet headers.
22498          */
22499         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
22500         uint32_t        enables;
22501         /*
22502          * This bit must be '1' for the pri0_cos_queue_id field to be
22503          * configured.
22504          */
22505         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
22506                 UINT32_C(0x1)
22507         /*
22508          * This bit must be '1' for the pri1_cos_queue_id field to be
22509          * configured.
22510          */
22511         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
22512                 UINT32_C(0x2)
22513         /*
22514          * This bit must be '1' for the pri2_cos_queue_id field to be
22515          * configured.
22516          */
22517         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
22518                 UINT32_C(0x4)
22519         /*
22520          * This bit must be '1' for the pri3_cos_queue_id field to be
22521          * configured.
22522          */
22523         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
22524                 UINT32_C(0x8)
22525         /*
22526          * This bit must be '1' for the pri4_cos_queue_id field to be
22527          * configured.
22528          */
22529         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
22530                 UINT32_C(0x10)
22531         /*
22532          * This bit must be '1' for the pri5_cos_queue_id field to be
22533          * configured.
22534          */
22535         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
22536                 UINT32_C(0x20)
22537         /*
22538          * This bit must be '1' for the pri6_cos_queue_id field to be
22539          * configured.
22540          */
22541         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
22542                 UINT32_C(0x40)
22543         /*
22544          * This bit must be '1' for the pri7_cos_queue_id field to be
22545          * configured.
22546          */
22547         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
22548                 UINT32_C(0x80)
22549         /*
22550          * Port ID of port for which the table is being configured.
22551          * The HWRM needs to check whether this function is allowed
22552          * to configure pri2cos mapping on this port.
22553          */
22554         uint8_t port_id;
22555         /*
22556          * CoS Queue assigned to priority 0. This value can only
22557          * be changed before traffic has started.
22558          */
22559         uint8_t pri0_cos_queue_id;
22560         /*
22561          * CoS Queue assigned to priority 1. This value can only
22562          * be changed before traffic has started.
22563          */
22564         uint8_t pri1_cos_queue_id;
22565         /*
22566          * CoS Queue assigned to priority 2  This value can only
22567          * be changed before traffic has started.
22568          */
22569         uint8_t pri2_cos_queue_id;
22570         /*
22571          * CoS Queue assigned to priority 3. This value can only
22572          * be changed before traffic has started.
22573          */
22574         uint8_t pri3_cos_queue_id;
22575         /*
22576          * CoS Queue assigned to priority 4. This value can only
22577          * be changed before traffic has started.
22578          */
22579         uint8_t pri4_cos_queue_id;
22580         /*
22581          * CoS Queue assigned to priority 5. This value can only
22582          * be changed before traffic has started.
22583          */
22584         uint8_t pri5_cos_queue_id;
22585         /*
22586          * CoS Queue assigned to priority 6. This value can only
22587          * be changed before traffic has started.
22588          */
22589         uint8_t pri6_cos_queue_id;
22590         /*
22591          * CoS Queue assigned to priority 7. This value can only
22592          * be changed before traffic has started.
22593          */
22594         uint8_t pri7_cos_queue_id;
22595         uint8_t unused_0[7];
22596 } __rte_packed;
22597
22598 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
22599 struct hwrm_queue_pri2cos_cfg_output {
22600         /* The specific error status for the command. */
22601         uint16_t        error_code;
22602         /* The HWRM command request type. */
22603         uint16_t        req_type;
22604         /* The sequence ID from the original command. */
22605         uint16_t        seq_id;
22606         /* The length of the response data in number of bytes. */
22607         uint16_t        resp_len;
22608         uint8_t unused_0[7];
22609         /*
22610          * This field is used in Output records to indicate that the output
22611          * is completely written to RAM. This field should be read as '1'
22612          * to indicate that the output has been completely written.
22613          * When writing a command completion or response to an internal processor,
22614          * the order of writes has to be such that this field is written last.
22615          */
22616         uint8_t valid;
22617 } __rte_packed;
22618
22619 /**************************
22620  * hwrm_queue_cos2bw_qcfg *
22621  **************************/
22622
22623
22624 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
22625 struct hwrm_queue_cos2bw_qcfg_input {
22626         /* The HWRM command request type. */
22627         uint16_t        req_type;
22628         /*
22629          * The completion ring to send the completion event on. This should
22630          * be the NQ ID returned from the `nq_alloc` HWRM command.
22631          */
22632         uint16_t        cmpl_ring;
22633         /*
22634          * The sequence ID is used by the driver for tracking multiple
22635          * commands. This ID is treated as opaque data by the firmware and
22636          * the value is returned in the `hwrm_resp_hdr` upon completion.
22637          */
22638         uint16_t        seq_id;
22639         /*
22640          * The target ID of the command:
22641          * * 0x0-0xFFF8 - The function ID
22642          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22643          * * 0xFFFD - Reserved for user-space HWRM interface
22644          * * 0xFFFF - HWRM
22645          */
22646         uint16_t        target_id;
22647         /*
22648          * A physical address pointer pointing to a host buffer that the
22649          * command's response data will be written. This can be either a host
22650          * physical address (HPA) or a guest physical address (GPA) and must
22651          * point to a physically contiguous block of memory.
22652          */
22653         uint64_t        resp_addr;
22654         /*
22655          * Port ID of port for which the table is being configured.
22656          * The HWRM needs to check whether this function is allowed
22657          * to configure TC BW assignment on this port.
22658          */
22659         uint16_t        port_id;
22660         uint8_t unused_0[6];
22661 } __rte_packed;
22662
22663 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
22664 struct hwrm_queue_cos2bw_qcfg_output {
22665         /* The specific error status for the command. */
22666         uint16_t        error_code;
22667         /* The HWRM command request type. */
22668         uint16_t        req_type;
22669         /* The sequence ID from the original command. */
22670         uint16_t        seq_id;
22671         /* The length of the response data in number of bytes. */
22672         uint16_t        resp_len;
22673         /* ID of CoS Queue 0. */
22674         uint8_t queue_id0;
22675         uint8_t unused_0;
22676         uint16_t        unused_1;
22677         /*
22678          * Minimum BW allocated to CoS Queue.
22679          * The HWRM will translate this value into byte counter and
22680          * time interval used for this COS inside the device.
22681          */
22682         uint32_t        queue_id0_min_bw;
22683         /* The bandwidth value. */
22684         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
22685                 UINT32_C(0xfffffff)
22686         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
22687                 0
22688         /* The granularity of the value (bits or bytes). */
22689         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
22690                 UINT32_C(0x10000000)
22691         /* Value is in bits. */
22692         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
22693                 (UINT32_C(0x0) << 28)
22694         /* Value is in bytes. */
22695         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
22696                 (UINT32_C(0x1) << 28)
22697         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
22698                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
22699         /* bw_value_unit is 3 b */
22700         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
22701                 UINT32_C(0xe0000000)
22702         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
22703                 29
22704         /* Value is in Mb or MB (base 10). */
22705         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
22706                 (UINT32_C(0x0) << 29)
22707         /* Value is in Kb or KB (base 10). */
22708         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
22709                 (UINT32_C(0x2) << 29)
22710         /* Value is in bits or bytes. */
22711         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
22712                 (UINT32_C(0x4) << 29)
22713         /* Value is in Gb or GB (base 10). */
22714         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
22715                 (UINT32_C(0x6) << 29)
22716         /* Value is in 1/100th of a percentage of total bandwidth. */
22717         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
22718                 (UINT32_C(0x1) << 29)
22719         /* Invalid unit */
22720         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
22721                 (UINT32_C(0x7) << 29)
22722         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
22723                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
22724         /*
22725          * Maximum BW allocated to CoS Queue.
22726          * The HWRM will translate this value into byte counter and
22727          * time interval used for this COS inside the device.
22728          */
22729         uint32_t        queue_id0_max_bw;
22730         /* The bandwidth value. */
22731         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
22732                 UINT32_C(0xfffffff)
22733         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
22734                 0
22735         /* The granularity of the value (bits or bytes). */
22736         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
22737                 UINT32_C(0x10000000)
22738         /* Value is in bits. */
22739         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
22740                 (UINT32_C(0x0) << 28)
22741         /* Value is in bytes. */
22742         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
22743                 (UINT32_C(0x1) << 28)
22744         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
22745                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
22746         /* bw_value_unit is 3 b */
22747         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
22748                 UINT32_C(0xe0000000)
22749         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
22750                 29
22751         /* Value is in Mb or MB (base 10). */
22752         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
22753                 (UINT32_C(0x0) << 29)
22754         /* Value is in Kb or KB (base 10). */
22755         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
22756                 (UINT32_C(0x2) << 29)
22757         /* Value is in bits or bytes. */
22758         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
22759                 (UINT32_C(0x4) << 29)
22760         /* Value is in Gb or GB (base 10). */
22761         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
22762                 (UINT32_C(0x6) << 29)
22763         /* Value is in 1/100th of a percentage of total bandwidth. */
22764         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
22765                 (UINT32_C(0x1) << 29)
22766         /* Invalid unit */
22767         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
22768                 (UINT32_C(0x7) << 29)
22769         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
22770                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
22771         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
22772         uint8_t queue_id0_tsa_assign;
22773         /* Strict Priority */
22774         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
22775                 UINT32_C(0x0)
22776         /* Enhanced Transmission Selection */
22777         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
22778                 UINT32_C(0x1)
22779         /* reserved. */
22780         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
22781                 UINT32_C(0x2)
22782         /* reserved. */
22783         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
22784                 UINT32_C(0xff)
22785         /*
22786          * Priority level for strict priority. Valid only when the
22787          * tsa_assign is 0 - Strict Priority (SP)
22788          * 0..7 - Valid values.
22789          * 8..255 - Reserved.
22790          */
22791         uint8_t queue_id0_pri_lvl;
22792         /*
22793          * Weight used to allocate remaining BW for this COS after
22794          * servicing guaranteed bandwidths for all COS.
22795          */
22796         uint8_t queue_id0_bw_weight;
22797         /* ID of CoS Queue 1. */
22798         uint8_t queue_id1;
22799         /*
22800          * Minimum BW allocated to CoS Queue.
22801          * The HWRM will translate this value into byte counter and
22802          * time interval used for this COS inside the device.
22803          */
22804         uint32_t        queue_id1_min_bw;
22805         /* The bandwidth value. */
22806         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
22807                 UINT32_C(0xfffffff)
22808         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
22809                 0
22810         /* The granularity of the value (bits or bytes). */
22811         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
22812                 UINT32_C(0x10000000)
22813         /* Value is in bits. */
22814         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
22815                 (UINT32_C(0x0) << 28)
22816         /* Value is in bytes. */
22817         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
22818                 (UINT32_C(0x1) << 28)
22819         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
22820                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
22821         /* bw_value_unit is 3 b */
22822         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
22823                 UINT32_C(0xe0000000)
22824         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
22825                 29
22826         /* Value is in Mb or MB (base 10). */
22827         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
22828                 (UINT32_C(0x0) << 29)
22829         /* Value is in Kb or KB (base 10). */
22830         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
22831                 (UINT32_C(0x2) << 29)
22832         /* Value is in bits or bytes. */
22833         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
22834                 (UINT32_C(0x4) << 29)
22835         /* Value is in Gb or GB (base 10). */
22836         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
22837                 (UINT32_C(0x6) << 29)
22838         /* Value is in 1/100th of a percentage of total bandwidth. */
22839         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
22840                 (UINT32_C(0x1) << 29)
22841         /* Invalid unit */
22842         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
22843                 (UINT32_C(0x7) << 29)
22844         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
22845                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
22846         /*
22847          * Maximum BW allocated to CoS queue.
22848          * The HWRM will translate this value into byte counter and
22849          * time interval used for this COS inside the device.
22850          */
22851         uint32_t        queue_id1_max_bw;
22852         /* The bandwidth value. */
22853         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
22854                 UINT32_C(0xfffffff)
22855         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
22856                 0
22857         /* The granularity of the value (bits or bytes). */
22858         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
22859                 UINT32_C(0x10000000)
22860         /* Value is in bits. */
22861         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
22862                 (UINT32_C(0x0) << 28)
22863         /* Value is in bytes. */
22864         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
22865                 (UINT32_C(0x1) << 28)
22866         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
22867                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
22868         /* bw_value_unit is 3 b */
22869         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
22870                 UINT32_C(0xe0000000)
22871         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
22872                 29
22873         /* Value is in Mb or MB (base 10). */
22874         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
22875                 (UINT32_C(0x0) << 29)
22876         /* Value is in Kb or KB (base 10). */
22877         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
22878                 (UINT32_C(0x2) << 29)
22879         /* Value is in bits or bytes. */
22880         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
22881                 (UINT32_C(0x4) << 29)
22882         /* Value is in Gb or GB (base 10). */
22883         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
22884                 (UINT32_C(0x6) << 29)
22885         /* Value is in 1/100th of a percentage of total bandwidth. */
22886         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
22887                 (UINT32_C(0x1) << 29)
22888         /* Invalid unit */
22889         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
22890                 (UINT32_C(0x7) << 29)
22891         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
22892                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
22893         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
22894         uint8_t queue_id1_tsa_assign;
22895         /* Strict Priority */
22896         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
22897                 UINT32_C(0x0)
22898         /* Enhanced Transmission Selection */
22899         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
22900                 UINT32_C(0x1)
22901         /* reserved. */
22902         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
22903                 UINT32_C(0x2)
22904         /* reserved. */
22905         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
22906                 UINT32_C(0xff)
22907         /*
22908          * Priority level for strict priority. Valid only when the
22909          * tsa_assign is 0 - Strict Priority (SP)
22910          * 0..7 - Valid values.
22911          * 8..255 - Reserved.
22912          */
22913         uint8_t queue_id1_pri_lvl;
22914         /*
22915          * Weight used to allocate remaining BW for this COS after
22916          * servicing guaranteed bandwidths for all COS.
22917          */
22918         uint8_t queue_id1_bw_weight;
22919         /* ID of CoS Queue 2. */
22920         uint8_t queue_id2;
22921         /*
22922          * Minimum BW allocated to CoS Queue.
22923          * The HWRM will translate this value into byte counter and
22924          * time interval used for this COS inside the device.
22925          */
22926         uint32_t        queue_id2_min_bw;
22927         /* The bandwidth value. */
22928         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
22929                 UINT32_C(0xfffffff)
22930         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
22931                 0
22932         /* The granularity of the value (bits or bytes). */
22933         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
22934                 UINT32_C(0x10000000)
22935         /* Value is in bits. */
22936         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
22937                 (UINT32_C(0x0) << 28)
22938         /* Value is in bytes. */
22939         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
22940                 (UINT32_C(0x1) << 28)
22941         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
22942                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
22943         /* bw_value_unit is 3 b */
22944         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
22945                 UINT32_C(0xe0000000)
22946         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
22947                 29
22948         /* Value is in Mb or MB (base 10). */
22949         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
22950                 (UINT32_C(0x0) << 29)
22951         /* Value is in Kb or KB (base 10). */
22952         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
22953                 (UINT32_C(0x2) << 29)
22954         /* Value is in bits or bytes. */
22955         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
22956                 (UINT32_C(0x4) << 29)
22957         /* Value is in Gb or GB (base 10). */
22958         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
22959                 (UINT32_C(0x6) << 29)
22960         /* Value is in 1/100th of a percentage of total bandwidth. */
22961         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
22962                 (UINT32_C(0x1) << 29)
22963         /* Invalid unit */
22964         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
22965                 (UINT32_C(0x7) << 29)
22966         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
22967                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
22968         /*
22969          * Maximum BW allocated to CoS queue.
22970          * The HWRM will translate this value into byte counter and
22971          * time interval used for this COS inside the device.
22972          */
22973         uint32_t        queue_id2_max_bw;
22974         /* The bandwidth value. */
22975         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
22976                 UINT32_C(0xfffffff)
22977         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
22978                 0
22979         /* The granularity of the value (bits or bytes). */
22980         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
22981                 UINT32_C(0x10000000)
22982         /* Value is in bits. */
22983         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
22984                 (UINT32_C(0x0) << 28)
22985         /* Value is in bytes. */
22986         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
22987                 (UINT32_C(0x1) << 28)
22988         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
22989                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
22990         /* bw_value_unit is 3 b */
22991         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
22992                 UINT32_C(0xe0000000)
22993         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
22994                 29
22995         /* Value is in Mb or MB (base 10). */
22996         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
22997                 (UINT32_C(0x0) << 29)
22998         /* Value is in Kb or KB (base 10). */
22999         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
23000                 (UINT32_C(0x2) << 29)
23001         /* Value is in bits or bytes. */
23002         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
23003                 (UINT32_C(0x4) << 29)
23004         /* Value is in Gb or GB (base 10). */
23005         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
23006                 (UINT32_C(0x6) << 29)
23007         /* Value is in 1/100th of a percentage of total bandwidth. */
23008         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23009                 (UINT32_C(0x1) << 29)
23010         /* Invalid unit */
23011         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
23012                 (UINT32_C(0x7) << 29)
23013         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
23014                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
23015         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23016         uint8_t queue_id2_tsa_assign;
23017         /* Strict Priority */
23018         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
23019                 UINT32_C(0x0)
23020         /* Enhanced Transmission Selection */
23021         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
23022                 UINT32_C(0x1)
23023         /* reserved. */
23024         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
23025                 UINT32_C(0x2)
23026         /* reserved. */
23027         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
23028                 UINT32_C(0xff)
23029         /*
23030          * Priority level for strict priority. Valid only when the
23031          * tsa_assign is 0 - Strict Priority (SP)
23032          * 0..7 - Valid values.
23033          * 8..255 - Reserved.
23034          */
23035         uint8_t queue_id2_pri_lvl;
23036         /*
23037          * Weight used to allocate remaining BW for this COS after
23038          * servicing guaranteed bandwidths for all COS.
23039          */
23040         uint8_t queue_id2_bw_weight;
23041         /* ID of CoS Queue 3. */
23042         uint8_t queue_id3;
23043         /*
23044          * Minimum BW allocated to CoS Queue.
23045          * The HWRM will translate this value into byte counter and
23046          * time interval used for this COS inside the device.
23047          */
23048         uint32_t        queue_id3_min_bw;
23049         /* The bandwidth value. */
23050         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
23051                 UINT32_C(0xfffffff)
23052         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
23053                 0
23054         /* The granularity of the value (bits or bytes). */
23055         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
23056                 UINT32_C(0x10000000)
23057         /* Value is in bits. */
23058         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
23059                 (UINT32_C(0x0) << 28)
23060         /* Value is in bytes. */
23061         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
23062                 (UINT32_C(0x1) << 28)
23063         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
23064                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
23065         /* bw_value_unit is 3 b */
23066         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
23067                 UINT32_C(0xe0000000)
23068         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
23069                 29
23070         /* Value is in Mb or MB (base 10). */
23071         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
23072                 (UINT32_C(0x0) << 29)
23073         /* Value is in Kb or KB (base 10). */
23074         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
23075                 (UINT32_C(0x2) << 29)
23076         /* Value is in bits or bytes. */
23077         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
23078                 (UINT32_C(0x4) << 29)
23079         /* Value is in Gb or GB (base 10). */
23080         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
23081                 (UINT32_C(0x6) << 29)
23082         /* Value is in 1/100th of a percentage of total bandwidth. */
23083         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23084                 (UINT32_C(0x1) << 29)
23085         /* Invalid unit */
23086         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
23087                 (UINT32_C(0x7) << 29)
23088         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
23089                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
23090         /*
23091          * Maximum BW allocated to CoS queue.
23092          * The HWRM will translate this value into byte counter and
23093          * time interval used for this COS inside the device.
23094          */
23095         uint32_t        queue_id3_max_bw;
23096         /* The bandwidth value. */
23097         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
23098                 UINT32_C(0xfffffff)
23099         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
23100                 0
23101         /* The granularity of the value (bits or bytes). */
23102         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
23103                 UINT32_C(0x10000000)
23104         /* Value is in bits. */
23105         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
23106                 (UINT32_C(0x0) << 28)
23107         /* Value is in bytes. */
23108         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
23109                 (UINT32_C(0x1) << 28)
23110         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
23111                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
23112         /* bw_value_unit is 3 b */
23113         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
23114                 UINT32_C(0xe0000000)
23115         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
23116                 29
23117         /* Value is in Mb or MB (base 10). */
23118         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
23119                 (UINT32_C(0x0) << 29)
23120         /* Value is in Kb or KB (base 10). */
23121         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
23122                 (UINT32_C(0x2) << 29)
23123         /* Value is in bits or bytes. */
23124         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
23125                 (UINT32_C(0x4) << 29)
23126         /* Value is in Gb or GB (base 10). */
23127         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
23128                 (UINT32_C(0x6) << 29)
23129         /* Value is in 1/100th of a percentage of total bandwidth. */
23130         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23131                 (UINT32_C(0x1) << 29)
23132         /* Invalid unit */
23133         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
23134                 (UINT32_C(0x7) << 29)
23135         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
23136                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
23137         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23138         uint8_t queue_id3_tsa_assign;
23139         /* Strict Priority */
23140         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
23141                 UINT32_C(0x0)
23142         /* Enhanced Transmission Selection */
23143         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
23144                 UINT32_C(0x1)
23145         /* reserved. */
23146         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
23147                 UINT32_C(0x2)
23148         /* reserved. */
23149         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
23150                 UINT32_C(0xff)
23151         /*
23152          * Priority level for strict priority. Valid only when the
23153          * tsa_assign is 0 - Strict Priority (SP)
23154          * 0..7 - Valid values.
23155          * 8..255 - Reserved.
23156          */
23157         uint8_t queue_id3_pri_lvl;
23158         /*
23159          * Weight used to allocate remaining BW for this COS after
23160          * servicing guaranteed bandwidths for all COS.
23161          */
23162         uint8_t queue_id3_bw_weight;
23163         /* ID of CoS Queue 4. */
23164         uint8_t queue_id4;
23165         /*
23166          * Minimum BW allocated to CoS Queue.
23167          * The HWRM will translate this value into byte counter and
23168          * time interval used for this COS inside the device.
23169          */
23170         uint32_t        queue_id4_min_bw;
23171         /* The bandwidth value. */
23172         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
23173                 UINT32_C(0xfffffff)
23174         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
23175                 0
23176         /* The granularity of the value (bits or bytes). */
23177         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
23178                 UINT32_C(0x10000000)
23179         /* Value is in bits. */
23180         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
23181                 (UINT32_C(0x0) << 28)
23182         /* Value is in bytes. */
23183         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
23184                 (UINT32_C(0x1) << 28)
23185         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
23186                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
23187         /* bw_value_unit is 3 b */
23188         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
23189                 UINT32_C(0xe0000000)
23190         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
23191                 29
23192         /* Value is in Mb or MB (base 10). */
23193         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
23194                 (UINT32_C(0x0) << 29)
23195         /* Value is in Kb or KB (base 10). */
23196         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
23197                 (UINT32_C(0x2) << 29)
23198         /* Value is in bits or bytes. */
23199         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
23200                 (UINT32_C(0x4) << 29)
23201         /* Value is in Gb or GB (base 10). */
23202         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
23203                 (UINT32_C(0x6) << 29)
23204         /* Value is in 1/100th of a percentage of total bandwidth. */
23205         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23206                 (UINT32_C(0x1) << 29)
23207         /* Invalid unit */
23208         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
23209                 (UINT32_C(0x7) << 29)
23210         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
23211                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
23212         /*
23213          * Maximum BW allocated to CoS queue.
23214          * The HWRM will translate this value into byte counter and
23215          * time interval used for this COS inside the device.
23216          */
23217         uint32_t        queue_id4_max_bw;
23218         /* The bandwidth value. */
23219         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
23220                 UINT32_C(0xfffffff)
23221         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
23222                 0
23223         /* The granularity of the value (bits or bytes). */
23224         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
23225                 UINT32_C(0x10000000)
23226         /* Value is in bits. */
23227         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
23228                 (UINT32_C(0x0) << 28)
23229         /* Value is in bytes. */
23230         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
23231                 (UINT32_C(0x1) << 28)
23232         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
23233                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
23234         /* bw_value_unit is 3 b */
23235         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
23236                 UINT32_C(0xe0000000)
23237         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
23238                 29
23239         /* Value is in Mb or MB (base 10). */
23240         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
23241                 (UINT32_C(0x0) << 29)
23242         /* Value is in Kb or KB (base 10). */
23243         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
23244                 (UINT32_C(0x2) << 29)
23245         /* Value is in bits or bytes. */
23246         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
23247                 (UINT32_C(0x4) << 29)
23248         /* Value is in Gb or GB (base 10). */
23249         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
23250                 (UINT32_C(0x6) << 29)
23251         /* Value is in 1/100th of a percentage of total bandwidth. */
23252         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23253                 (UINT32_C(0x1) << 29)
23254         /* Invalid unit */
23255         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
23256                 (UINT32_C(0x7) << 29)
23257         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
23258                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
23259         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23260         uint8_t queue_id4_tsa_assign;
23261         /* Strict Priority */
23262         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
23263                 UINT32_C(0x0)
23264         /* Enhanced Transmission Selection */
23265         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
23266                 UINT32_C(0x1)
23267         /* reserved. */
23268         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
23269                 UINT32_C(0x2)
23270         /* reserved. */
23271         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
23272                 UINT32_C(0xff)
23273         /*
23274          * Priority level for strict priority. Valid only when the
23275          * tsa_assign is 0 - Strict Priority (SP)
23276          * 0..7 - Valid values.
23277          * 8..255 - Reserved.
23278          */
23279         uint8_t queue_id4_pri_lvl;
23280         /*
23281          * Weight used to allocate remaining BW for this COS after
23282          * servicing guaranteed bandwidths for all COS.
23283          */
23284         uint8_t queue_id4_bw_weight;
23285         /* ID of CoS Queue 5. */
23286         uint8_t queue_id5;
23287         /*
23288          * Minimum BW allocated to CoS Queue.
23289          * The HWRM will translate this value into byte counter and
23290          * time interval used for this COS inside the device.
23291          */
23292         uint32_t        queue_id5_min_bw;
23293         /* The bandwidth value. */
23294         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
23295                 UINT32_C(0xfffffff)
23296         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
23297                 0
23298         /* The granularity of the value (bits or bytes). */
23299         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
23300                 UINT32_C(0x10000000)
23301         /* Value is in bits. */
23302         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
23303                 (UINT32_C(0x0) << 28)
23304         /* Value is in bytes. */
23305         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
23306                 (UINT32_C(0x1) << 28)
23307         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
23308                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
23309         /* bw_value_unit is 3 b */
23310         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
23311                 UINT32_C(0xe0000000)
23312         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
23313                 29
23314         /* Value is in Mb or MB (base 10). */
23315         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
23316                 (UINT32_C(0x0) << 29)
23317         /* Value is in Kb or KB (base 10). */
23318         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
23319                 (UINT32_C(0x2) << 29)
23320         /* Value is in bits or bytes. */
23321         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
23322                 (UINT32_C(0x4) << 29)
23323         /* Value is in Gb or GB (base 10). */
23324         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
23325                 (UINT32_C(0x6) << 29)
23326         /* Value is in 1/100th of a percentage of total bandwidth. */
23327         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23328                 (UINT32_C(0x1) << 29)
23329         /* Invalid unit */
23330         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
23331                 (UINT32_C(0x7) << 29)
23332         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
23333                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
23334         /*
23335          * Maximum BW allocated to CoS queue.
23336          * The HWRM will translate this value into byte counter and
23337          * time interval used for this COS inside the device.
23338          */
23339         uint32_t        queue_id5_max_bw;
23340         /* The bandwidth value. */
23341         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
23342                 UINT32_C(0xfffffff)
23343         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
23344                 0
23345         /* The granularity of the value (bits or bytes). */
23346         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
23347                 UINT32_C(0x10000000)
23348         /* Value is in bits. */
23349         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
23350                 (UINT32_C(0x0) << 28)
23351         /* Value is in bytes. */
23352         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
23353                 (UINT32_C(0x1) << 28)
23354         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
23355                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
23356         /* bw_value_unit is 3 b */
23357         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
23358                 UINT32_C(0xe0000000)
23359         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
23360                 29
23361         /* Value is in Mb or MB (base 10). */
23362         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
23363                 (UINT32_C(0x0) << 29)
23364         /* Value is in Kb or KB (base 10). */
23365         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
23366                 (UINT32_C(0x2) << 29)
23367         /* Value is in bits or bytes. */
23368         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
23369                 (UINT32_C(0x4) << 29)
23370         /* Value is in Gb or GB (base 10). */
23371         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
23372                 (UINT32_C(0x6) << 29)
23373         /* Value is in 1/100th of a percentage of total bandwidth. */
23374         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23375                 (UINT32_C(0x1) << 29)
23376         /* Invalid unit */
23377         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
23378                 (UINT32_C(0x7) << 29)
23379         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
23380                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
23381         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23382         uint8_t queue_id5_tsa_assign;
23383         /* Strict Priority */
23384         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
23385                 UINT32_C(0x0)
23386         /* Enhanced Transmission Selection */
23387         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
23388                 UINT32_C(0x1)
23389         /* reserved. */
23390         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
23391                 UINT32_C(0x2)
23392         /* reserved. */
23393         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
23394                 UINT32_C(0xff)
23395         /*
23396          * Priority level for strict priority. Valid only when the
23397          * tsa_assign is 0 - Strict Priority (SP)
23398          * 0..7 - Valid values.
23399          * 8..255 - Reserved.
23400          */
23401         uint8_t queue_id5_pri_lvl;
23402         /*
23403          * Weight used to allocate remaining BW for this COS after
23404          * servicing guaranteed bandwidths for all COS.
23405          */
23406         uint8_t queue_id5_bw_weight;
23407         /* ID of CoS Queue 6. */
23408         uint8_t queue_id6;
23409         /*
23410          * Minimum BW allocated to CoS Queue.
23411          * The HWRM will translate this value into byte counter and
23412          * time interval used for this COS inside the device.
23413          */
23414         uint32_t        queue_id6_min_bw;
23415         /* The bandwidth value. */
23416         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
23417                 UINT32_C(0xfffffff)
23418         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
23419                 0
23420         /* The granularity of the value (bits or bytes). */
23421         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
23422                 UINT32_C(0x10000000)
23423         /* Value is in bits. */
23424         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
23425                 (UINT32_C(0x0) << 28)
23426         /* Value is in bytes. */
23427         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
23428                 (UINT32_C(0x1) << 28)
23429         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
23430                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
23431         /* bw_value_unit is 3 b */
23432         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
23433                 UINT32_C(0xe0000000)
23434         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
23435                 29
23436         /* Value is in Mb or MB (base 10). */
23437         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
23438                 (UINT32_C(0x0) << 29)
23439         /* Value is in Kb or KB (base 10). */
23440         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
23441                 (UINT32_C(0x2) << 29)
23442         /* Value is in bits or bytes. */
23443         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
23444                 (UINT32_C(0x4) << 29)
23445         /* Value is in Gb or GB (base 10). */
23446         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
23447                 (UINT32_C(0x6) << 29)
23448         /* Value is in 1/100th of a percentage of total bandwidth. */
23449         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23450                 (UINT32_C(0x1) << 29)
23451         /* Invalid unit */
23452         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
23453                 (UINT32_C(0x7) << 29)
23454         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
23455                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
23456         /*
23457          * Maximum BW allocated to CoS queue.
23458          * The HWRM will translate this value into byte counter and
23459          * time interval used for this COS inside the device.
23460          */
23461         uint32_t        queue_id6_max_bw;
23462         /* The bandwidth value. */
23463         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
23464                 UINT32_C(0xfffffff)
23465         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
23466                 0
23467         /* The granularity of the value (bits or bytes). */
23468         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
23469                 UINT32_C(0x10000000)
23470         /* Value is in bits. */
23471         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
23472                 (UINT32_C(0x0) << 28)
23473         /* Value is in bytes. */
23474         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
23475                 (UINT32_C(0x1) << 28)
23476         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
23477                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
23478         /* bw_value_unit is 3 b */
23479         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
23480                 UINT32_C(0xe0000000)
23481         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
23482                 29
23483         /* Value is in Mb or MB (base 10). */
23484         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
23485                 (UINT32_C(0x0) << 29)
23486         /* Value is in Kb or KB (base 10). */
23487         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
23488                 (UINT32_C(0x2) << 29)
23489         /* Value is in bits or bytes. */
23490         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
23491                 (UINT32_C(0x4) << 29)
23492         /* Value is in Gb or GB (base 10). */
23493         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
23494                 (UINT32_C(0x6) << 29)
23495         /* Value is in 1/100th of a percentage of total bandwidth. */
23496         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23497                 (UINT32_C(0x1) << 29)
23498         /* Invalid unit */
23499         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
23500                 (UINT32_C(0x7) << 29)
23501         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
23502                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
23503         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23504         uint8_t queue_id6_tsa_assign;
23505         /* Strict Priority */
23506         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
23507                 UINT32_C(0x0)
23508         /* Enhanced Transmission Selection */
23509         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
23510                 UINT32_C(0x1)
23511         /* reserved. */
23512         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
23513                 UINT32_C(0x2)
23514         /* reserved. */
23515         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
23516                 UINT32_C(0xff)
23517         /*
23518          * Priority level for strict priority. Valid only when the
23519          * tsa_assign is 0 - Strict Priority (SP)
23520          * 0..7 - Valid values.
23521          * 8..255 - Reserved.
23522          */
23523         uint8_t queue_id6_pri_lvl;
23524         /*
23525          * Weight used to allocate remaining BW for this COS after
23526          * servicing guaranteed bandwidths for all COS.
23527          */
23528         uint8_t queue_id6_bw_weight;
23529         /* ID of CoS Queue 7. */
23530         uint8_t queue_id7;
23531         /*
23532          * Minimum BW allocated to CoS Queue.
23533          * The HWRM will translate this value into byte counter and
23534          * time interval used for this COS inside the device.
23535          */
23536         uint32_t        queue_id7_min_bw;
23537         /* The bandwidth value. */
23538         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
23539                 UINT32_C(0xfffffff)
23540         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
23541                 0
23542         /* The granularity of the value (bits or bytes). */
23543         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
23544                 UINT32_C(0x10000000)
23545         /* Value is in bits. */
23546         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
23547                 (UINT32_C(0x0) << 28)
23548         /* Value is in bytes. */
23549         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
23550                 (UINT32_C(0x1) << 28)
23551         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
23552                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
23553         /* bw_value_unit is 3 b */
23554         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
23555                 UINT32_C(0xe0000000)
23556         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
23557                 29
23558         /* Value is in Mb or MB (base 10). */
23559         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
23560                 (UINT32_C(0x0) << 29)
23561         /* Value is in Kb or KB (base 10). */
23562         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
23563                 (UINT32_C(0x2) << 29)
23564         /* Value is in bits or bytes. */
23565         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
23566                 (UINT32_C(0x4) << 29)
23567         /* Value is in Gb or GB (base 10). */
23568         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
23569                 (UINT32_C(0x6) << 29)
23570         /* Value is in 1/100th of a percentage of total bandwidth. */
23571         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23572                 (UINT32_C(0x1) << 29)
23573         /* Invalid unit */
23574         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
23575                 (UINT32_C(0x7) << 29)
23576         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
23577                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
23578         /*
23579          * Maximum BW allocated to CoS queue.
23580          * The HWRM will translate this value into byte counter and
23581          * time interval used for this COS inside the device.
23582          */
23583         uint32_t        queue_id7_max_bw;
23584         /* The bandwidth value. */
23585         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
23586                 UINT32_C(0xfffffff)
23587         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
23588                 0
23589         /* The granularity of the value (bits or bytes). */
23590         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
23591                 UINT32_C(0x10000000)
23592         /* Value is in bits. */
23593         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
23594                 (UINT32_C(0x0) << 28)
23595         /* Value is in bytes. */
23596         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
23597                 (UINT32_C(0x1) << 28)
23598         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
23599                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
23600         /* bw_value_unit is 3 b */
23601         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
23602                 UINT32_C(0xe0000000)
23603         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
23604                 29
23605         /* Value is in Mb or MB (base 10). */
23606         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
23607                 (UINT32_C(0x0) << 29)
23608         /* Value is in Kb or KB (base 10). */
23609         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
23610                 (UINT32_C(0x2) << 29)
23611         /* Value is in bits or bytes. */
23612         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
23613                 (UINT32_C(0x4) << 29)
23614         /* Value is in Gb or GB (base 10). */
23615         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
23616                 (UINT32_C(0x6) << 29)
23617         /* Value is in 1/100th of a percentage of total bandwidth. */
23618         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23619                 (UINT32_C(0x1) << 29)
23620         /* Invalid unit */
23621         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
23622                 (UINT32_C(0x7) << 29)
23623         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
23624                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
23625         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23626         uint8_t queue_id7_tsa_assign;
23627         /* Strict Priority */
23628         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
23629                 UINT32_C(0x0)
23630         /* Enhanced Transmission Selection */
23631         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
23632                 UINT32_C(0x1)
23633         /* reserved. */
23634         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
23635                 UINT32_C(0x2)
23636         /* reserved. */
23637         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
23638                 UINT32_C(0xff)
23639         /*
23640          * Priority level for strict priority. Valid only when the
23641          * tsa_assign is 0 - Strict Priority (SP)
23642          * 0..7 - Valid values.
23643          * 8..255 - Reserved.
23644          */
23645         uint8_t queue_id7_pri_lvl;
23646         /*
23647          * Weight used to allocate remaining BW for this COS after
23648          * servicing guaranteed bandwidths for all COS.
23649          */
23650         uint8_t queue_id7_bw_weight;
23651         uint8_t unused_2[4];
23652         /*
23653          * This field is used in Output records to indicate that the output
23654          * is completely written to RAM. This field should be read as '1'
23655          * to indicate that the output has been completely written.
23656          * When writing a command completion or response to an internal processor,
23657          * the order of writes has to be such that this field is written last.
23658          */
23659         uint8_t valid;
23660 } __rte_packed;
23661
23662 /*************************
23663  * hwrm_queue_cos2bw_cfg *
23664  *************************/
23665
23666
23667 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
23668 struct hwrm_queue_cos2bw_cfg_input {
23669         /* The HWRM command request type. */
23670         uint16_t        req_type;
23671         /*
23672          * The completion ring to send the completion event on. This should
23673          * be the NQ ID returned from the `nq_alloc` HWRM command.
23674          */
23675         uint16_t        cmpl_ring;
23676         /*
23677          * The sequence ID is used by the driver for tracking multiple
23678          * commands. This ID is treated as opaque data by the firmware and
23679          * the value is returned in the `hwrm_resp_hdr` upon completion.
23680          */
23681         uint16_t        seq_id;
23682         /*
23683          * The target ID of the command:
23684          * * 0x0-0xFFF8 - The function ID
23685          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23686          * * 0xFFFD - Reserved for user-space HWRM interface
23687          * * 0xFFFF - HWRM
23688          */
23689         uint16_t        target_id;
23690         /*
23691          * A physical address pointer pointing to a host buffer that the
23692          * command's response data will be written. This can be either a host
23693          * physical address (HPA) or a guest physical address (GPA) and must
23694          * point to a physically contiguous block of memory.
23695          */
23696         uint64_t        resp_addr;
23697         uint32_t        flags;
23698         uint32_t        enables;
23699         /*
23700          * If this bit is set to 1, then all queue_id0 related
23701          * parameters in this command are valid.
23702          */
23703         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
23704                 UINT32_C(0x1)
23705         /*
23706          * If this bit is set to 1, then all queue_id1 related
23707          * parameters in this command are valid.
23708          */
23709         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
23710                 UINT32_C(0x2)
23711         /*
23712          * If this bit is set to 1, then all queue_id2 related
23713          * parameters in this command are valid.
23714          */
23715         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
23716                 UINT32_C(0x4)
23717         /*
23718          * If this bit is set to 1, then all queue_id3 related
23719          * parameters in this command are valid.
23720          */
23721         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
23722                 UINT32_C(0x8)
23723         /*
23724          * If this bit is set to 1, then all queue_id4 related
23725          * parameters in this command are valid.
23726          */
23727         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
23728                 UINT32_C(0x10)
23729         /*
23730          * If this bit is set to 1, then all queue_id5 related
23731          * parameters in this command are valid.
23732          */
23733         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
23734                 UINT32_C(0x20)
23735         /*
23736          * If this bit is set to 1, then all queue_id6 related
23737          * parameters in this command are valid.
23738          */
23739         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
23740                 UINT32_C(0x40)
23741         /*
23742          * If this bit is set to 1, then all queue_id7 related
23743          * parameters in this command are valid.
23744          */
23745         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
23746                 UINT32_C(0x80)
23747         /*
23748          * Port ID of port for which the table is being configured.
23749          * The HWRM needs to check whether this function is allowed
23750          * to configure TC BW assignment on this port.
23751          */
23752         uint16_t        port_id;
23753         /* ID of CoS Queue 0. */
23754         uint8_t queue_id0;
23755         uint8_t unused_0;
23756         /*
23757          * Minimum BW allocated to CoS Queue.
23758          * The HWRM will translate this value into byte counter and
23759          * time interval used for this COS inside the device.
23760          */
23761         uint32_t        queue_id0_min_bw;
23762         /* The bandwidth value. */
23763         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
23764                 UINT32_C(0xfffffff)
23765         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
23766                 0
23767         /* The granularity of the value (bits or bytes). */
23768         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
23769                 UINT32_C(0x10000000)
23770         /* Value is in bits. */
23771         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
23772                 (UINT32_C(0x0) << 28)
23773         /* Value is in bytes. */
23774         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
23775                 (UINT32_C(0x1) << 28)
23776         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
23777                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
23778         /* bw_value_unit is 3 b */
23779         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
23780                 UINT32_C(0xe0000000)
23781         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
23782                 29
23783         /* Value is in Mb or MB (base 10). */
23784         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
23785                 (UINT32_C(0x0) << 29)
23786         /* Value is in Kb or KB (base 10). */
23787         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
23788                 (UINT32_C(0x2) << 29)
23789         /* Value is in bits or bytes. */
23790         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
23791                 (UINT32_C(0x4) << 29)
23792         /* Value is in Gb or GB (base 10). */
23793         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
23794                 (UINT32_C(0x6) << 29)
23795         /* Value is in 1/100th of a percentage of total bandwidth. */
23796         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23797                 (UINT32_C(0x1) << 29)
23798         /* Invalid unit */
23799         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
23800                 (UINT32_C(0x7) << 29)
23801         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
23802                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
23803         /*
23804          * Maximum BW allocated to CoS Queue.
23805          * The HWRM will translate this value into byte counter and
23806          * time interval used for this COS inside the device.
23807          */
23808         uint32_t        queue_id0_max_bw;
23809         /* The bandwidth value. */
23810         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
23811                 UINT32_C(0xfffffff)
23812         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
23813                 0
23814         /* The granularity of the value (bits or bytes). */
23815         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
23816                 UINT32_C(0x10000000)
23817         /* Value is in bits. */
23818         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
23819                 (UINT32_C(0x0) << 28)
23820         /* Value is in bytes. */
23821         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
23822                 (UINT32_C(0x1) << 28)
23823         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
23824                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
23825         /* bw_value_unit is 3 b */
23826         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
23827                 UINT32_C(0xe0000000)
23828         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
23829                 29
23830         /* Value is in Mb or MB (base 10). */
23831         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
23832                 (UINT32_C(0x0) << 29)
23833         /* Value is in Kb or KB (base 10). */
23834         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
23835                 (UINT32_C(0x2) << 29)
23836         /* Value is in bits or bytes. */
23837         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
23838                 (UINT32_C(0x4) << 29)
23839         /* Value is in Gb or GB (base 10). */
23840         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
23841                 (UINT32_C(0x6) << 29)
23842         /* Value is in 1/100th of a percentage of total bandwidth. */
23843         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23844                 (UINT32_C(0x1) << 29)
23845         /* Invalid unit */
23846         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
23847                 (UINT32_C(0x7) << 29)
23848         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
23849                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
23850         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23851         uint8_t queue_id0_tsa_assign;
23852         /* Strict Priority */
23853         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
23854                 UINT32_C(0x0)
23855         /* Enhanced Transmission Selection */
23856         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
23857                 UINT32_C(0x1)
23858         /* reserved. */
23859         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
23860                 UINT32_C(0x2)
23861         /* reserved. */
23862         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
23863                 UINT32_C(0xff)
23864         /*
23865          * Priority level for strict priority. Valid only when the
23866          * tsa_assign is 0 - Strict Priority (SP)
23867          * 0..7 - Valid values.
23868          * 8..255 - Reserved.
23869          */
23870         uint8_t queue_id0_pri_lvl;
23871         /*
23872          * Weight used to allocate remaining BW for this COS after
23873          * servicing guaranteed bandwidths for all COS.
23874          */
23875         uint8_t queue_id0_bw_weight;
23876         /* ID of CoS Queue 1. */
23877         uint8_t queue_id1;
23878         /*
23879          * Minimum BW allocated to CoS Queue.
23880          * The HWRM will translate this value into byte counter and
23881          * time interval used for this COS inside the device.
23882          */
23883         uint32_t        queue_id1_min_bw;
23884         /* The bandwidth value. */
23885         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
23886                 UINT32_C(0xfffffff)
23887         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
23888                 0
23889         /* The granularity of the value (bits or bytes). */
23890         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
23891                 UINT32_C(0x10000000)
23892         /* Value is in bits. */
23893         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
23894                 (UINT32_C(0x0) << 28)
23895         /* Value is in bytes. */
23896         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
23897                 (UINT32_C(0x1) << 28)
23898         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
23899                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
23900         /* bw_value_unit is 3 b */
23901         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
23902                 UINT32_C(0xe0000000)
23903         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
23904                 29
23905         /* Value is in Mb or MB (base 10). */
23906         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
23907                 (UINT32_C(0x0) << 29)
23908         /* Value is in Kb or KB (base 10). */
23909         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
23910                 (UINT32_C(0x2) << 29)
23911         /* Value is in bits or bytes. */
23912         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
23913                 (UINT32_C(0x4) << 29)
23914         /* Value is in Gb or GB (base 10). */
23915         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
23916                 (UINT32_C(0x6) << 29)
23917         /* Value is in 1/100th of a percentage of total bandwidth. */
23918         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
23919                 (UINT32_C(0x1) << 29)
23920         /* Invalid unit */
23921         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
23922                 (UINT32_C(0x7) << 29)
23923         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
23924                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
23925         /*
23926          * Maximum BW allocated to CoS queue.
23927          * The HWRM will translate this value into byte counter and
23928          * time interval used for this COS inside the device.
23929          */
23930         uint32_t        queue_id1_max_bw;
23931         /* The bandwidth value. */
23932         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
23933                 UINT32_C(0xfffffff)
23934         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
23935                 0
23936         /* The granularity of the value (bits or bytes). */
23937         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
23938                 UINT32_C(0x10000000)
23939         /* Value is in bits. */
23940         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
23941                 (UINT32_C(0x0) << 28)
23942         /* Value is in bytes. */
23943         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
23944                 (UINT32_C(0x1) << 28)
23945         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
23946                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
23947         /* bw_value_unit is 3 b */
23948         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
23949                 UINT32_C(0xe0000000)
23950         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
23951                 29
23952         /* Value is in Mb or MB (base 10). */
23953         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
23954                 (UINT32_C(0x0) << 29)
23955         /* Value is in Kb or KB (base 10). */
23956         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
23957                 (UINT32_C(0x2) << 29)
23958         /* Value is in bits or bytes. */
23959         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
23960                 (UINT32_C(0x4) << 29)
23961         /* Value is in Gb or GB (base 10). */
23962         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
23963                 (UINT32_C(0x6) << 29)
23964         /* Value is in 1/100th of a percentage of total bandwidth. */
23965         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
23966                 (UINT32_C(0x1) << 29)
23967         /* Invalid unit */
23968         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
23969                 (UINT32_C(0x7) << 29)
23970         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
23971                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
23972         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
23973         uint8_t queue_id1_tsa_assign;
23974         /* Strict Priority */
23975         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
23976                 UINT32_C(0x0)
23977         /* Enhanced Transmission Selection */
23978         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
23979                 UINT32_C(0x1)
23980         /* reserved. */
23981         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
23982                 UINT32_C(0x2)
23983         /* reserved. */
23984         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
23985                 UINT32_C(0xff)
23986         /*
23987          * Priority level for strict priority. Valid only when the
23988          * tsa_assign is 0 - Strict Priority (SP)
23989          * 0..7 - Valid values.
23990          * 8..255 - Reserved.
23991          */
23992         uint8_t queue_id1_pri_lvl;
23993         /*
23994          * Weight used to allocate remaining BW for this COS after
23995          * servicing guaranteed bandwidths for all COS.
23996          */
23997         uint8_t queue_id1_bw_weight;
23998         /* ID of CoS Queue 2. */
23999         uint8_t queue_id2;
24000         /*
24001          * Minimum BW allocated to CoS Queue.
24002          * The HWRM will translate this value into byte counter and
24003          * time interval used for this COS inside the device.
24004          */
24005         uint32_t        queue_id2_min_bw;
24006         /* The bandwidth value. */
24007         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
24008                 UINT32_C(0xfffffff)
24009         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
24010                 0
24011         /* The granularity of the value (bits or bytes). */
24012         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
24013                 UINT32_C(0x10000000)
24014         /* Value is in bits. */
24015         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
24016                 (UINT32_C(0x0) << 28)
24017         /* Value is in bytes. */
24018         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
24019                 (UINT32_C(0x1) << 28)
24020         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
24021                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
24022         /* bw_value_unit is 3 b */
24023         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
24024                 UINT32_C(0xe0000000)
24025         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
24026                 29
24027         /* Value is in Mb or MB (base 10). */
24028         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
24029                 (UINT32_C(0x0) << 29)
24030         /* Value is in Kb or KB (base 10). */
24031         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
24032                 (UINT32_C(0x2) << 29)
24033         /* Value is in bits or bytes. */
24034         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
24035                 (UINT32_C(0x4) << 29)
24036         /* Value is in Gb or GB (base 10). */
24037         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
24038                 (UINT32_C(0x6) << 29)
24039         /* Value is in 1/100th of a percentage of total bandwidth. */
24040         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
24041                 (UINT32_C(0x1) << 29)
24042         /* Invalid unit */
24043         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
24044                 (UINT32_C(0x7) << 29)
24045         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
24046                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
24047         /*
24048          * Maximum BW allocated to CoS queue.
24049          * The HWRM will translate this value into byte counter and
24050          * time interval used for this COS inside the device.
24051          */
24052         uint32_t        queue_id2_max_bw;
24053         /* The bandwidth value. */
24054         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
24055                 UINT32_C(0xfffffff)
24056         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
24057                 0
24058         /* The granularity of the value (bits or bytes). */
24059         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
24060                 UINT32_C(0x10000000)
24061         /* Value is in bits. */
24062         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
24063                 (UINT32_C(0x0) << 28)
24064         /* Value is in bytes. */
24065         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
24066                 (UINT32_C(0x1) << 28)
24067         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
24068                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
24069         /* bw_value_unit is 3 b */
24070         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
24071                 UINT32_C(0xe0000000)
24072         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
24073                 29
24074         /* Value is in Mb or MB (base 10). */
24075         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
24076                 (UINT32_C(0x0) << 29)
24077         /* Value is in Kb or KB (base 10). */
24078         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
24079                 (UINT32_C(0x2) << 29)
24080         /* Value is in bits or bytes. */
24081         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
24082                 (UINT32_C(0x4) << 29)
24083         /* Value is in Gb or GB (base 10). */
24084         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
24085                 (UINT32_C(0x6) << 29)
24086         /* Value is in 1/100th of a percentage of total bandwidth. */
24087         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
24088                 (UINT32_C(0x1) << 29)
24089         /* Invalid unit */
24090         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
24091                 (UINT32_C(0x7) << 29)
24092         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
24093                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
24094         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
24095         uint8_t queue_id2_tsa_assign;
24096         /* Strict Priority */
24097         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
24098                 UINT32_C(0x0)
24099         /* Enhanced Transmission Selection */
24100         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
24101                 UINT32_C(0x1)
24102         /* reserved. */
24103         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
24104                 UINT32_C(0x2)
24105         /* reserved. */
24106         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
24107                 UINT32_C(0xff)
24108         /*
24109          * Priority level for strict priority. Valid only when the
24110          * tsa_assign is 0 - Strict Priority (SP)
24111          * 0..7 - Valid values.
24112          * 8..255 - Reserved.
24113          */
24114         uint8_t queue_id2_pri_lvl;
24115         /*
24116          * Weight used to allocate remaining BW for this COS after
24117          * servicing guaranteed bandwidths for all COS.
24118          */
24119         uint8_t queue_id2_bw_weight;
24120         /* ID of CoS Queue 3. */
24121         uint8_t queue_id3;
24122         /*
24123          * Minimum BW allocated to CoS Queue.
24124          * The HWRM will translate this value into byte counter and
24125          * time interval used for this COS inside the device.
24126          */
24127         uint32_t        queue_id3_min_bw;
24128         /* The bandwidth value. */
24129         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
24130                 UINT32_C(0xfffffff)
24131         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
24132                 0
24133         /* The granularity of the value (bits or bytes). */
24134         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
24135                 UINT32_C(0x10000000)
24136         /* Value is in bits. */
24137         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
24138                 (UINT32_C(0x0) << 28)
24139         /* Value is in bytes. */
24140         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
24141                 (UINT32_C(0x1) << 28)
24142         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
24143                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
24144         /* bw_value_unit is 3 b */
24145         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
24146                 UINT32_C(0xe0000000)
24147         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
24148                 29
24149         /* Value is in Mb or MB (base 10). */
24150         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
24151                 (UINT32_C(0x0) << 29)
24152         /* Value is in Kb or KB (base 10). */
24153         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
24154                 (UINT32_C(0x2) << 29)
24155         /* Value is in bits or bytes. */
24156         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
24157                 (UINT32_C(0x4) << 29)
24158         /* Value is in Gb or GB (base 10). */
24159         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
24160                 (UINT32_C(0x6) << 29)
24161         /* Value is in 1/100th of a percentage of total bandwidth. */
24162         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
24163                 (UINT32_C(0x1) << 29)
24164         /* Invalid unit */
24165         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
24166                 (UINT32_C(0x7) << 29)
24167         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
24168                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
24169         /*
24170          * Maximum BW allocated to CoS queue.
24171          * The HWRM will translate this value into byte counter and
24172          * time interval used for this COS inside the device.
24173          */
24174         uint32_t        queue_id3_max_bw;
24175         /* The bandwidth value. */
24176         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
24177                 UINT32_C(0xfffffff)
24178         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
24179                 0
24180         /* The granularity of the value (bits or bytes). */
24181         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
24182                 UINT32_C(0x10000000)
24183         /* Value is in bits. */
24184         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
24185                 (UINT32_C(0x0) << 28)
24186         /* Value is in bytes. */
24187         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
24188                 (UINT32_C(0x1) << 28)
24189         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
24190                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
24191         /* bw_value_unit is 3 b */
24192         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
24193                 UINT32_C(0xe0000000)
24194         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
24195                 29
24196         /* Value is in Mb or MB (base 10). */
24197         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
24198                 (UINT32_C(0x0) << 29)
24199         /* Value is in Kb or KB (base 10). */
24200         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
24201                 (UINT32_C(0x2) << 29)
24202         /* Value is in bits or bytes. */
24203         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
24204                 (UINT32_C(0x4) << 29)
24205         /* Value is in Gb or GB (base 10). */
24206         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
24207                 (UINT32_C(0x6) << 29)
24208         /* Value is in 1/100th of a percentage of total bandwidth. */
24209         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
24210                 (UINT32_C(0x1) << 29)
24211         /* Invalid unit */
24212         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
24213                 (UINT32_C(0x7) << 29)
24214         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
24215                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
24216         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
24217         uint8_t queue_id3_tsa_assign;
24218         /* Strict Priority */
24219         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
24220                 UINT32_C(0x0)
24221         /* Enhanced Transmission Selection */
24222         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
24223                 UINT32_C(0x1)
24224         /* reserved. */
24225         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
24226                 UINT32_C(0x2)
24227         /* reserved. */
24228         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
24229                 UINT32_C(0xff)
24230         /*
24231          * Priority level for strict priority. Valid only when the
24232          * tsa_assign is 0 - Strict Priority (SP)
24233          * 0..7 - Valid values.
24234          * 8..255 - Reserved.
24235          */
24236         uint8_t queue_id3_pri_lvl;
24237         /*
24238          * Weight used to allocate remaining BW for this COS after
24239          * servicing guaranteed bandwidths for all COS.
24240          */
24241         uint8_t queue_id3_bw_weight;
24242         /* ID of CoS Queue 4. */
24243         uint8_t queue_id4;
24244         /*
24245          * Minimum BW allocated to CoS Queue.
24246          * The HWRM will translate this value into byte counter and
24247          * time interval used for this COS inside the device.
24248          */
24249         uint32_t        queue_id4_min_bw;
24250         /* The bandwidth value. */
24251         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
24252                 UINT32_C(0xfffffff)
24253         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
24254                 0
24255         /* The granularity of the value (bits or bytes). */
24256         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
24257                 UINT32_C(0x10000000)
24258         /* Value is in bits. */
24259         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
24260                 (UINT32_C(0x0) << 28)
24261         /* Value is in bytes. */
24262         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
24263                 (UINT32_C(0x1) << 28)
24264         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
24265                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
24266         /* bw_value_unit is 3 b */
24267         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
24268                 UINT32_C(0xe0000000)
24269         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
24270                 29
24271         /* Value is in Mb or MB (base 10). */
24272         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
24273                 (UINT32_C(0x0) << 29)
24274         /* Value is in Kb or KB (base 10). */
24275         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
24276                 (UINT32_C(0x2) << 29)
24277         /* Value is in bits or bytes. */
24278         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
24279                 (UINT32_C(0x4) << 29)
24280         /* Value is in Gb or GB (base 10). */
24281         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
24282                 (UINT32_C(0x6) << 29)
24283         /* Value is in 1/100th of a percentage of total bandwidth. */
24284         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
24285                 (UINT32_C(0x1) << 29)
24286         /* Invalid unit */
24287         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
24288                 (UINT32_C(0x7) << 29)
24289         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
24290                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
24291         /*
24292          * Maximum BW allocated to CoS queue.
24293          * The HWRM will translate this value into byte counter and
24294          * time interval used for this COS inside the device.
24295          */
24296         uint32_t        queue_id4_max_bw;
24297         /* The bandwidth value. */
24298         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
24299                 UINT32_C(0xfffffff)
24300         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
24301                 0
24302         /* The granularity of the value (bits or bytes). */
24303         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
24304                 UINT32_C(0x10000000)
24305         /* Value is in bits. */
24306         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
24307                 (UINT32_C(0x0) << 28)
24308         /* Value is in bytes. */
24309         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
24310                 (UINT32_C(0x1) << 28)
24311         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
24312                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
24313         /* bw_value_unit is 3 b */
24314         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
24315                 UINT32_C(0xe0000000)
24316         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
24317                 29
24318         /* Value is in Mb or MB (base 10). */
24319         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
24320                 (UINT32_C(0x0) << 29)
24321         /* Value is in Kb or KB (base 10). */
24322         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
24323                 (UINT32_C(0x2) << 29)
24324         /* Value is in bits or bytes. */
24325         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
24326                 (UINT32_C(0x4) << 29)
24327         /* Value is in Gb or GB (base 10). */
24328         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
24329                 (UINT32_C(0x6) << 29)
24330         /* Value is in 1/100th of a percentage of total bandwidth. */
24331         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
24332                 (UINT32_C(0x1) << 29)
24333         /* Invalid unit */
24334         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
24335                 (UINT32_C(0x7) << 29)
24336         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
24337                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
24338         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
24339         uint8_t queue_id4_tsa_assign;
24340         /* Strict Priority */
24341         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
24342                 UINT32_C(0x0)
24343         /* Enhanced Transmission Selection */
24344         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
24345                 UINT32_C(0x1)
24346         /* reserved. */
24347         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
24348                 UINT32_C(0x2)
24349         /* reserved. */
24350         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
24351                 UINT32_C(0xff)
24352         /*
24353          * Priority level for strict priority. Valid only when the
24354          * tsa_assign is 0 - Strict Priority (SP)
24355          * 0..7 - Valid values.
24356          * 8..255 - Reserved.
24357          */
24358         uint8_t queue_id4_pri_lvl;
24359         /*
24360          * Weight used to allocate remaining BW for this COS after
24361          * servicing guaranteed bandwidths for all COS.
24362          */
24363         uint8_t queue_id4_bw_weight;
24364         /* ID of CoS Queue 5. */
24365         uint8_t queue_id5;
24366         /*
24367          * Minimum BW allocated to CoS Queue.
24368          * The HWRM will translate this value into byte counter and
24369          * time interval used for this COS inside the device.
24370          */
24371         uint32_t        queue_id5_min_bw;
24372         /* The bandwidth value. */
24373         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
24374                 UINT32_C(0xfffffff)
24375         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
24376                 0
24377         /* The granularity of the value (bits or bytes). */
24378         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
24379                 UINT32_C(0x10000000)
24380         /* Value is in bits. */
24381         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
24382                 (UINT32_C(0x0) << 28)
24383         /* Value is in bytes. */
24384         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
24385                 (UINT32_C(0x1) << 28)
24386         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
24387                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
24388         /* bw_value_unit is 3 b */
24389         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
24390                 UINT32_C(0xe0000000)
24391         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
24392                 29
24393         /* Value is in Mb or MB (base 10). */
24394         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
24395                 (UINT32_C(0x0) << 29)
24396         /* Value is in Kb or KB (base 10). */
24397         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
24398                 (UINT32_C(0x2) << 29)
24399         /* Value is in bits or bytes. */
24400         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
24401                 (UINT32_C(0x4) << 29)
24402         /* Value is in Gb or GB (base 10). */
24403         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
24404                 (UINT32_C(0x6) << 29)
24405         /* Value is in 1/100th of a percentage of total bandwidth. */
24406         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
24407                 (UINT32_C(0x1) << 29)
24408         /* Invalid unit */
24409         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
24410                 (UINT32_C(0x7) << 29)
24411         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
24412                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
24413         /*
24414          * Maximum BW allocated to CoS queue.
24415          * The HWRM will translate this value into byte counter and
24416          * time interval used for this COS inside the device.
24417          */
24418         uint32_t        queue_id5_max_bw;
24419         /* The bandwidth value. */
24420         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
24421                 UINT32_C(0xfffffff)
24422         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
24423                 0
24424         /* The granularity of the value (bits or bytes). */
24425         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
24426                 UINT32_C(0x10000000)
24427         /* Value is in bits. */
24428         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
24429                 (UINT32_C(0x0) << 28)
24430         /* Value is in bytes. */
24431         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
24432                 (UINT32_C(0x1) << 28)
24433         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
24434                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
24435         /* bw_value_unit is 3 b */
24436         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
24437                 UINT32_C(0xe0000000)
24438         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
24439                 29
24440         /* Value is in Mb or MB (base 10). */
24441         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
24442                 (UINT32_C(0x0) << 29)
24443         /* Value is in Kb or KB (base 10). */
24444         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
24445                 (UINT32_C(0x2) << 29)
24446         /* Value is in bits or bytes. */
24447         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
24448                 (UINT32_C(0x4) << 29)
24449         /* Value is in Gb or GB (base 10). */
24450         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
24451                 (UINT32_C(0x6) << 29)
24452         /* Value is in 1/100th of a percentage of total bandwidth. */
24453         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
24454                 (UINT32_C(0x1) << 29)
24455         /* Invalid unit */
24456         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
24457                 (UINT32_C(0x7) << 29)
24458         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
24459                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
24460         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
24461         uint8_t queue_id5_tsa_assign;
24462         /* Strict Priority */
24463         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
24464                 UINT32_C(0x0)
24465         /* Enhanced Transmission Selection */
24466         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
24467                 UINT32_C(0x1)
24468         /* reserved. */
24469         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
24470                 UINT32_C(0x2)
24471         /* reserved. */
24472         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
24473                 UINT32_C(0xff)
24474         /*
24475          * Priority level for strict priority. Valid only when the
24476          * tsa_assign is 0 - Strict Priority (SP)
24477          * 0..7 - Valid values.
24478          * 8..255 - Reserved.
24479          */
24480         uint8_t queue_id5_pri_lvl;
24481         /*
24482          * Weight used to allocate remaining BW for this COS after
24483          * servicing guaranteed bandwidths for all COS.
24484          */
24485         uint8_t queue_id5_bw_weight;
24486         /* ID of CoS Queue 6. */
24487         uint8_t queue_id6;
24488         /*
24489          * Minimum BW allocated to CoS Queue.
24490          * The HWRM will translate this value into byte counter and
24491          * time interval used for this COS inside the device.
24492          */
24493         uint32_t        queue_id6_min_bw;
24494         /* The bandwidth value. */
24495         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
24496                 UINT32_C(0xfffffff)
24497         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
24498                 0
24499         /* The granularity of the value (bits or bytes). */
24500         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
24501                 UINT32_C(0x10000000)
24502         /* Value is in bits. */
24503         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
24504                 (UINT32_C(0x0) << 28)
24505         /* Value is in bytes. */
24506         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
24507                 (UINT32_C(0x1) << 28)
24508         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
24509                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
24510         /* bw_value_unit is 3 b */
24511         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
24512                 UINT32_C(0xe0000000)
24513         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
24514                 29
24515         /* Value is in Mb or MB (base 10). */
24516         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
24517                 (UINT32_C(0x0) << 29)
24518         /* Value is in Kb or KB (base 10). */
24519         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
24520                 (UINT32_C(0x2) << 29)
24521         /* Value is in bits or bytes. */
24522         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
24523                 (UINT32_C(0x4) << 29)
24524         /* Value is in Gb or GB (base 10). */
24525         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
24526                 (UINT32_C(0x6) << 29)
24527         /* Value is in 1/100th of a percentage of total bandwidth. */
24528         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
24529                 (UINT32_C(0x1) << 29)
24530         /* Invalid unit */
24531         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
24532                 (UINT32_C(0x7) << 29)
24533         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
24534                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
24535         /*
24536          * Maximum BW allocated to CoS queue.
24537          * The HWRM will translate this value into byte counter and
24538          * time interval used for this COS inside the device.
24539          */
24540         uint32_t        queue_id6_max_bw;
24541         /* The bandwidth value. */
24542         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
24543                 UINT32_C(0xfffffff)
24544         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
24545                 0
24546         /* The granularity of the value (bits or bytes). */
24547         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
24548                 UINT32_C(0x10000000)
24549         /* Value is in bits. */
24550         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
24551                 (UINT32_C(0x0) << 28)
24552         /* Value is in bytes. */
24553         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
24554                 (UINT32_C(0x1) << 28)
24555         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
24556                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
24557         /* bw_value_unit is 3 b */
24558         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
24559                 UINT32_C(0xe0000000)
24560         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
24561                 29
24562         /* Value is in Mb or MB (base 10). */
24563         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
24564                 (UINT32_C(0x0) << 29)
24565         /* Value is in Kb or KB (base 10). */
24566         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
24567                 (UINT32_C(0x2) << 29)
24568         /* Value is in bits or bytes. */
24569         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
24570                 (UINT32_C(0x4) << 29)
24571         /* Value is in Gb or GB (base 10). */
24572         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
24573                 (UINT32_C(0x6) << 29)
24574         /* Value is in 1/100th of a percentage of total bandwidth. */
24575         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
24576                 (UINT32_C(0x1) << 29)
24577         /* Invalid unit */
24578         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
24579                 (UINT32_C(0x7) << 29)
24580         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
24581                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
24582         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
24583         uint8_t queue_id6_tsa_assign;
24584         /* Strict Priority */
24585         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
24586                 UINT32_C(0x0)
24587         /* Enhanced Transmission Selection */
24588         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
24589                 UINT32_C(0x1)
24590         /* reserved. */
24591         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
24592                 UINT32_C(0x2)
24593         /* reserved. */
24594         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
24595                 UINT32_C(0xff)
24596         /*
24597          * Priority level for strict priority. Valid only when the
24598          * tsa_assign is 0 - Strict Priority (SP)
24599          * 0..7 - Valid values.
24600          * 8..255 - Reserved.
24601          */
24602         uint8_t queue_id6_pri_lvl;
24603         /*
24604          * Weight used to allocate remaining BW for this COS after
24605          * servicing guaranteed bandwidths for all COS.
24606          */
24607         uint8_t queue_id6_bw_weight;
24608         /* ID of CoS Queue 7. */
24609         uint8_t queue_id7;
24610         /*
24611          * Minimum BW allocated to CoS Queue.
24612          * The HWRM will translate this value into byte counter and
24613          * time interval used for this COS inside the device.
24614          */
24615         uint32_t        queue_id7_min_bw;
24616         /* The bandwidth value. */
24617         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
24618                 UINT32_C(0xfffffff)
24619         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
24620                 0
24621         /* The granularity of the value (bits or bytes). */
24622         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
24623                 UINT32_C(0x10000000)
24624         /* Value is in bits. */
24625         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
24626                 (UINT32_C(0x0) << 28)
24627         /* Value is in bytes. */
24628         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
24629                 (UINT32_C(0x1) << 28)
24630         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
24631                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
24632         /* bw_value_unit is 3 b */
24633         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
24634                 UINT32_C(0xe0000000)
24635         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
24636                 29
24637         /* Value is in Mb or MB (base 10). */
24638         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
24639                 (UINT32_C(0x0) << 29)
24640         /* Value is in Kb or KB (base 10). */
24641         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
24642                 (UINT32_C(0x2) << 29)
24643         /* Value is in bits or bytes. */
24644         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
24645                 (UINT32_C(0x4) << 29)
24646         /* Value is in Gb or GB (base 10). */
24647         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
24648                 (UINT32_C(0x6) << 29)
24649         /* Value is in 1/100th of a percentage of total bandwidth. */
24650         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
24651                 (UINT32_C(0x1) << 29)
24652         /* Invalid unit */
24653         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
24654                 (UINT32_C(0x7) << 29)
24655         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
24656                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
24657         /*
24658          * Maximum BW allocated to CoS queue.
24659          * The HWRM will translate this value into byte counter and
24660          * time interval used for this COS inside the device.
24661          */
24662         uint32_t        queue_id7_max_bw;
24663         /* The bandwidth value. */
24664         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
24665                 UINT32_C(0xfffffff)
24666         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
24667                 0
24668         /* The granularity of the value (bits or bytes). */
24669         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
24670                 UINT32_C(0x10000000)
24671         /* Value is in bits. */
24672         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
24673                 (UINT32_C(0x0) << 28)
24674         /* Value is in bytes. */
24675         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
24676                 (UINT32_C(0x1) << 28)
24677         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
24678                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
24679         /* bw_value_unit is 3 b */
24680         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
24681                 UINT32_C(0xe0000000)
24682         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
24683                 29
24684         /* Value is in Mb or MB (base 10). */
24685         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
24686                 (UINT32_C(0x0) << 29)
24687         /* Value is in Kb or KB (base 10). */
24688         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
24689                 (UINT32_C(0x2) << 29)
24690         /* Value is in bits or bytes. */
24691         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
24692                 (UINT32_C(0x4) << 29)
24693         /* Value is in Gb or GB (base 10). */
24694         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
24695                 (UINT32_C(0x6) << 29)
24696         /* Value is in 1/100th of a percentage of total bandwidth. */
24697         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
24698                 (UINT32_C(0x1) << 29)
24699         /* Invalid unit */
24700         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
24701                 (UINT32_C(0x7) << 29)
24702         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
24703                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
24704         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
24705         uint8_t queue_id7_tsa_assign;
24706         /* Strict Priority */
24707         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
24708                 UINT32_C(0x0)
24709         /* Enhanced Transmission Selection */
24710         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
24711                 UINT32_C(0x1)
24712         /* reserved. */
24713         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
24714                 UINT32_C(0x2)
24715         /* reserved. */
24716         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
24717                 UINT32_C(0xff)
24718         /*
24719          * Priority level for strict priority. Valid only when the
24720          * tsa_assign is 0 - Strict Priority (SP)
24721          * 0..7 - Valid values.
24722          * 8..255 - Reserved.
24723          */
24724         uint8_t queue_id7_pri_lvl;
24725         /*
24726          * Weight used to allocate remaining BW for this COS after
24727          * servicing guaranteed bandwidths for all COS.
24728          */
24729         uint8_t queue_id7_bw_weight;
24730         uint8_t unused_1[5];
24731 } __rte_packed;
24732
24733 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
24734 struct hwrm_queue_cos2bw_cfg_output {
24735         /* The specific error status for the command. */
24736         uint16_t        error_code;
24737         /* The HWRM command request type. */
24738         uint16_t        req_type;
24739         /* The sequence ID from the original command. */
24740         uint16_t        seq_id;
24741         /* The length of the response data in number of bytes. */
24742         uint16_t        resp_len;
24743         uint8_t unused_0[7];
24744         /*
24745          * This field is used in Output records to indicate that the output
24746          * is completely written to RAM. This field should be read as '1'
24747          * to indicate that the output has been completely written.
24748          * When writing a command completion or response to an internal processor,
24749          * the order of writes has to be such that this field is written last.
24750          */
24751         uint8_t valid;
24752 } __rte_packed;
24753
24754 /*************************
24755  * hwrm_queue_dscp_qcaps *
24756  *************************/
24757
24758
24759 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
24760 struct hwrm_queue_dscp_qcaps_input {
24761         /* The HWRM command request type. */
24762         uint16_t        req_type;
24763         /*
24764          * The completion ring to send the completion event on. This should
24765          * be the NQ ID returned from the `nq_alloc` HWRM command.
24766          */
24767         uint16_t        cmpl_ring;
24768         /*
24769          * The sequence ID is used by the driver for tracking multiple
24770          * commands. This ID is treated as opaque data by the firmware and
24771          * the value is returned in the `hwrm_resp_hdr` upon completion.
24772          */
24773         uint16_t        seq_id;
24774         /*
24775          * The target ID of the command:
24776          * * 0x0-0xFFF8 - The function ID
24777          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24778          * * 0xFFFD - Reserved for user-space HWRM interface
24779          * * 0xFFFF - HWRM
24780          */
24781         uint16_t        target_id;
24782         /*
24783          * A physical address pointer pointing to a host buffer that the
24784          * command's response data will be written. This can be either a host
24785          * physical address (HPA) or a guest physical address (GPA) and must
24786          * point to a physically contiguous block of memory.
24787          */
24788         uint64_t        resp_addr;
24789         /*
24790          * Port ID of port for which the table is being configured.
24791          * The HWRM needs to check whether this function is allowed
24792          * to configure pri2cos mapping on this port.
24793          */
24794         uint8_t port_id;
24795         uint8_t unused_0[7];
24796 } __rte_packed;
24797
24798 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
24799 struct hwrm_queue_dscp_qcaps_output {
24800         /* The specific error status for the command. */
24801         uint16_t        error_code;
24802         /* The HWRM command request type. */
24803         uint16_t        req_type;
24804         /* The sequence ID from the original command. */
24805         uint16_t        seq_id;
24806         /* The length of the response data in number of bytes. */
24807         uint16_t        resp_len;
24808         /* The number of bits provided by the hardware for the DSCP value. */
24809         uint8_t num_dscp_bits;
24810         uint8_t unused_0;
24811         /* Max number of DSCP-MASK-PRI entries supported. */
24812         uint16_t        max_entries;
24813         uint8_t unused_1[3];
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_queue_dscp2pri_qcfg *
24826  ****************************/
24827
24828
24829 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
24830 struct hwrm_queue_dscp2pri_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         /*
24860          * This is the host address where the 24-bits DSCP-MASK-PRI
24861          * tuple(s) will be copied to.
24862          */
24863         uint64_t        dest_data_addr;
24864         /*
24865          * Port ID of port for which the table is being configured.
24866          * The HWRM needs to check whether this function is allowed
24867          * to configure pri2cos mapping on this port.
24868          */
24869         uint8_t port_id;
24870         uint8_t unused_0;
24871         /* Size of the buffer pointed to by dest_data_addr. */
24872         uint16_t        dest_data_buffer_size;
24873         uint8_t unused_1[4];
24874 } __rte_packed;
24875
24876 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
24877 struct hwrm_queue_dscp2pri_qcfg_output {
24878         /* The specific error status for the command. */
24879         uint16_t        error_code;
24880         /* The HWRM command request type. */
24881         uint16_t        req_type;
24882         /* The sequence ID from the original command. */
24883         uint16_t        seq_id;
24884         /* The length of the response data in number of bytes. */
24885         uint16_t        resp_len;
24886         /*
24887          * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
24888          * by the dest_data_addr.
24889          */
24890         uint16_t        entry_cnt;
24891         /*
24892          * This is the default PRI which un-initialized DSCP values are
24893          * mapped to.
24894          */
24895         uint8_t default_pri;
24896         uint8_t unused_0[4];
24897         /*
24898          * This field is used in Output records to indicate that the output
24899          * is completely written to RAM. This field should be read as '1'
24900          * to indicate that the output has been completely written.
24901          * When writing a command completion or response to an internal processor,
24902          * the order of writes has to be such that this field is written last.
24903          */
24904         uint8_t valid;
24905 } __rte_packed;
24906
24907 /***************************
24908  * hwrm_queue_dscp2pri_cfg *
24909  ***************************/
24910
24911
24912 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
24913 struct hwrm_queue_dscp2pri_cfg_input {
24914         /* The HWRM command request type. */
24915         uint16_t        req_type;
24916         /*
24917          * The completion ring to send the completion event on. This should
24918          * be the NQ ID returned from the `nq_alloc` HWRM command.
24919          */
24920         uint16_t        cmpl_ring;
24921         /*
24922          * The sequence ID is used by the driver for tracking multiple
24923          * commands. This ID is treated as opaque data by the firmware and
24924          * the value is returned in the `hwrm_resp_hdr` upon completion.
24925          */
24926         uint16_t        seq_id;
24927         /*
24928          * The target ID of the command:
24929          * * 0x0-0xFFF8 - The function ID
24930          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24931          * * 0xFFFD - Reserved for user-space HWRM interface
24932          * * 0xFFFF - HWRM
24933          */
24934         uint16_t        target_id;
24935         /*
24936          * A physical address pointer pointing to a host buffer that the
24937          * command's response data will be written. This can be either a host
24938          * physical address (HPA) or a guest physical address (GPA) and must
24939          * point to a physically contiguous block of memory.
24940          */
24941         uint64_t        resp_addr;
24942         /*
24943          * This is the host address where the 24-bits DSCP-MASK-PRI tuple
24944          * will be copied from.
24945          */
24946         uint64_t        src_data_addr;
24947         uint32_t        flags;
24948         /* use_hw_default_pri is 1 b */
24949         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI \
24950                 UINT32_C(0x1)
24951         uint32_t        enables;
24952         /*
24953          * This bit must be '1' for the default_pri field to be
24954          * configured.
24955          */
24956         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI \
24957                 UINT32_C(0x1)
24958         /*
24959          * Port ID of port for which the table is being configured.
24960          * The HWRM needs to check whether this function is allowed
24961          * to configure pri2cos mapping on this port.
24962          */
24963         uint8_t port_id;
24964         /*
24965          * This is the default PRI which un-initialized DSCP values will be
24966          * mapped to.
24967          */
24968         uint8_t default_pri;
24969         /*
24970          * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
24971          * to by src_data_addr.
24972          */
24973         uint16_t        entry_cnt;
24974         uint8_t unused_0[4];
24975 } __rte_packed;
24976
24977 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
24978 struct hwrm_queue_dscp2pri_cfg_output {
24979         /* The specific error status for the command. */
24980         uint16_t        error_code;
24981         /* The HWRM command request type. */
24982         uint16_t        req_type;
24983         /* The sequence ID from the original command. */
24984         uint16_t        seq_id;
24985         /* The length of the response data in number of bytes. */
24986         uint16_t        resp_len;
24987         uint8_t unused_0[7];
24988         /*
24989          * This field is used in Output records to indicate that the output
24990          * is completely written to RAM. This field should be read as '1'
24991          * to indicate that the output has been completely written.
24992          * When writing a command completion or response to an internal processor,
24993          * the order of writes has to be such that this field is written last.
24994          */
24995         uint8_t valid;
24996 } __rte_packed;
24997
24998 /*************************
24999  * hwrm_queue_mpls_qcaps *
25000  *************************/
25001
25002
25003 /* hwrm_queue_mpls_qcaps_input (size:192b/24B) */
25004 struct hwrm_queue_mpls_qcaps_input {
25005         /* The HWRM command request type. */
25006         uint16_t        req_type;
25007         /*
25008          * The completion ring to send the completion event on. This should
25009          * be the NQ ID returned from the `nq_alloc` HWRM command.
25010          */
25011         uint16_t        cmpl_ring;
25012         /*
25013          * The sequence ID is used by the driver for tracking multiple
25014          * commands. This ID is treated as opaque data by the firmware and
25015          * the value is returned in the `hwrm_resp_hdr` upon completion.
25016          */
25017         uint16_t        seq_id;
25018         /*
25019          * The target ID of the command:
25020          * * 0x0-0xFFF8 - The function ID
25021          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25022          * * 0xFFFD - Reserved for user-space HWRM interface
25023          * * 0xFFFF - HWRM
25024          */
25025         uint16_t        target_id;
25026         /*
25027          * A physical address pointer pointing to a host buffer that the
25028          * command's response data will be written. This can be either a host
25029          * physical address (HPA) or a guest physical address (GPA) and must
25030          * point to a physically contiguous block of memory.
25031          */
25032         uint64_t        resp_addr;
25033         /*
25034          * Port ID of port for which the table is being configured.
25035          * The HWRM needs to check whether this function is allowed
25036          * to configure MPLS TC(EXP) to pri mapping on this port.
25037          */
25038         uint8_t port_id;
25039         uint8_t unused_0[7];
25040 } __rte_packed;
25041
25042 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
25043 struct hwrm_queue_mpls_qcaps_output {
25044         /* The specific error status for the command. */
25045         uint16_t        error_code;
25046         /* The HWRM command request type. */
25047         uint16_t        req_type;
25048         /* The sequence ID from the original command. */
25049         uint16_t        seq_id;
25050         /* The length of the response data in number of bytes. */
25051         uint16_t        resp_len;
25052         /*
25053          * Bitmask indicating which queues can be configured by the
25054          * hwrm_queue_mplstc2pri_cfg command.
25055          *
25056          * Each bit represents a specific pri where bit 0 represents
25057          * pri 0 and bit 7 represents pri 7.
25058          * # A value of 0 indicates that the pri is not configurable
25059          * by the hwrm_queue_mplstc2pri_cfg command.
25060          * # A value of 1 indicates that the pri is configurable.
25061          * # A hwrm_queue_mplstc2pri_cfg command shall return error when
25062          * trying to configure a pri that is not configurable.
25063          */
25064         uint8_t queue_mplstc2pri_cfg_allowed;
25065         /*
25066          * This is the default PRI which un-initialized MPLS values will be
25067          * mapped to.
25068          */
25069         uint8_t hw_default_pri;
25070         uint8_t unused_0[5];
25071         /*
25072          * This field is used in Output records to indicate that the output
25073          * is completely written to RAM. This field should be read as '1'
25074          * to indicate that the output has been completely written.
25075          * When writing a command completion or response to an internal processor,
25076          * the order of writes has to be such that this field is written last.
25077          */
25078         uint8_t valid;
25079 } __rte_packed;
25080
25081 /******************************
25082  * hwrm_queue_mplstc2pri_qcfg *
25083  ******************************/
25084
25085
25086 /* hwrm_queue_mplstc2pri_qcfg_input (size:192b/24B) */
25087 struct hwrm_queue_mplstc2pri_qcfg_input {
25088         /* The HWRM command request type. */
25089         uint16_t        req_type;
25090         /*
25091          * The completion ring to send the completion event on. This should
25092          * be the NQ ID returned from the `nq_alloc` HWRM command.
25093          */
25094         uint16_t        cmpl_ring;
25095         /*
25096          * The sequence ID is used by the driver for tracking multiple
25097          * commands. This ID is treated as opaque data by the firmware and
25098          * the value is returned in the `hwrm_resp_hdr` upon completion.
25099          */
25100         uint16_t        seq_id;
25101         /*
25102          * The target ID of the command:
25103          * * 0x0-0xFFF8 - The function ID
25104          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25105          * * 0xFFFD - Reserved for user-space HWRM interface
25106          * * 0xFFFF - HWRM
25107          */
25108         uint16_t        target_id;
25109         /*
25110          * A physical address pointer pointing to a host buffer that the
25111          * command's response data will be written. This can be either a host
25112          * physical address (HPA) or a guest physical address (GPA) and must
25113          * point to a physically contiguous block of memory.
25114          */
25115         uint64_t        resp_addr;
25116         /*
25117          * Port ID of port for which the table is being configured.
25118          * The HWRM needs to check whether this function is allowed
25119          * to configure MPLS TC(EXP) to pri mapping on this port.
25120          */
25121         uint8_t port_id;
25122         uint8_t unused_0[7];
25123 } __rte_packed;
25124
25125 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
25126 struct hwrm_queue_mplstc2pri_qcfg_output {
25127         /* The specific error status for the command. */
25128         uint16_t        error_code;
25129         /* The HWRM command request type. */
25130         uint16_t        req_type;
25131         /* The sequence ID from the original command. */
25132         uint16_t        seq_id;
25133         /* The length of the response data in number of bytes. */
25134         uint16_t        resp_len;
25135         /*
25136          * pri assigned to MPLS TC(EXP) 0. This value can only be changed
25137          * before traffic has started.
25138          * A value of 0xff indicates that no pri is assigned to the
25139          * MPLS TC(EXP) 0.
25140          */
25141         uint8_t tc0_pri_queue_id;
25142         /*
25143          * pri assigned to MPLS TC(EXP) 1. This value can only be changed
25144          * before traffic has started.
25145          * A value of 0xff indicates that no pri is assigned to the
25146          * MPLS TC(EXP) 1.
25147          */
25148         uint8_t tc1_pri_queue_id;
25149         /*
25150          * pri assigned to MPLS TC(EXP) 2. This value can only be changed
25151          * before traffic has started.
25152          * A value of 0xff indicates that no pri is assigned to the
25153          * MPLS TC(EXP) 2.
25154          */
25155         uint8_t tc2_pri_queue_id;
25156         /*
25157          * pri assigned to MPLS TC(EXP) 3. This value can only be changed
25158          * before traffic has started.
25159          * A value of 0xff indicates that no pri is assigned to the
25160          * MPLS TC(EXP) 3.
25161          */
25162         uint8_t tc3_pri_queue_id;
25163         /*
25164          * pri assigned to MPLS TC(EXP) 4. This value can only be changed
25165          * before traffic has started.
25166          * A value of 0xff indicates that no pri is assigned to the
25167          * MPLS TC(EXP) 4.
25168          */
25169         uint8_t tc4_pri_queue_id;
25170         /*
25171          * pri assigned to MPLS TC(EXP) 5. This value can only be changed
25172          * before traffic has started.
25173          * A value of 0xff indicates that no pri is assigned to the
25174          * MPLS TC(EXP) 5.
25175          */
25176         uint8_t tc5_pri_queue_id;
25177         /*
25178          * pri assigned to MPLS TC(EXP) 6. This value can only
25179          * be changed before traffic has started.
25180          * A value of 0xff indicates that no pri is assigned to the
25181          * MPLS TC(EXP) 6.
25182          */
25183         uint8_t tc6_pri_queue_id;
25184         /*
25185          * pri assigned to MPLS TC(EXP) 7. This value can only
25186          * be changed before traffic has started.
25187          * A value of 0xff indicates that no pri is assigned to the
25188          * MPLS TC(EXP) 7.
25189          */
25190         uint8_t tc7_pri_queue_id;
25191         uint8_t unused_0[7];
25192         /*
25193          * This field is used in Output records to indicate that the output
25194          * is completely written to RAM. This field should be read as '1'
25195          * to indicate that the output has been completely written.
25196          * When writing a command completion or response to an internal processor,
25197          * the order of writes has to be such that this field is written last.
25198          */
25199         uint8_t valid;
25200 } __rte_packed;
25201
25202 /*****************************
25203  * hwrm_queue_mplstc2pri_cfg *
25204  *****************************/
25205
25206
25207 /* hwrm_queue_mplstc2pri_cfg_input (size:256b/32B) */
25208 struct hwrm_queue_mplstc2pri_cfg_input {
25209         /* The HWRM command request type. */
25210         uint16_t        req_type;
25211         /*
25212          * The completion ring to send the completion event on. This should
25213          * be the NQ ID returned from the `nq_alloc` HWRM command.
25214          */
25215         uint16_t        cmpl_ring;
25216         /*
25217          * The sequence ID is used by the driver for tracking multiple
25218          * commands. This ID is treated as opaque data by the firmware and
25219          * the value is returned in the `hwrm_resp_hdr` upon completion.
25220          */
25221         uint16_t        seq_id;
25222         /*
25223          * The target ID of the command:
25224          * * 0x0-0xFFF8 - The function ID
25225          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25226          * * 0xFFFD - Reserved for user-space HWRM interface
25227          * * 0xFFFF - HWRM
25228          */
25229         uint16_t        target_id;
25230         /*
25231          * A physical address pointer pointing to a host buffer that the
25232          * command's response data will be written. This can be either a host
25233          * physical address (HPA) or a guest physical address (GPA) and must
25234          * point to a physically contiguous block of memory.
25235          */
25236         uint64_t        resp_addr;
25237         uint32_t        enables;
25238         /*
25239          * This bit must be '1' for the mplstc0_pri_queue_id field to be
25240          * configured.
25241          */
25242         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC0_PRI_QUEUE_ID \
25243                 UINT32_C(0x1)
25244         /*
25245          * This bit must be '1' for the mplstc1_pri_queue_id field to be
25246          * configured.
25247          */
25248         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC1_PRI_QUEUE_ID \
25249                 UINT32_C(0x2)
25250         /*
25251          * This bit must be '1' for the mplstc2_pri_queue_id field to be
25252          * configured.
25253          */
25254         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC2_PRI_QUEUE_ID \
25255                 UINT32_C(0x4)
25256         /*
25257          * This bit must be '1' for the mplstc3_pri_queue_id field to be
25258          * configured.
25259          */
25260         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC3_PRI_QUEUE_ID \
25261                 UINT32_C(0x8)
25262         /*
25263          * This bit must be '1' for the mplstc4_pri_queue_id field to be
25264          * configured.
25265          */
25266         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC4_PRI_QUEUE_ID \
25267                 UINT32_C(0x10)
25268         /*
25269          * This bit must be '1' for the mplstc5_pri_queue_id field to be
25270          * configured.
25271          */
25272         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC5_PRI_QUEUE_ID \
25273                 UINT32_C(0x20)
25274         /*
25275          * This bit must be '1' for the mplstc6_pri_queue_id field to be
25276          * configured.
25277          */
25278         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC6_PRI_QUEUE_ID \
25279                 UINT32_C(0x40)
25280         /*
25281          * This bit must be '1' for the mplstc7_pri_queue_id field to be
25282          * configured.
25283          */
25284         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC7_PRI_QUEUE_ID \
25285                 UINT32_C(0x80)
25286         /*
25287          * Port ID of port for which the table is being configured.
25288          * The HWRM needs to check whether this function is allowed
25289          * to configure MPLS TC(EXP)to pri mapping on this port.
25290          */
25291         uint8_t port_id;
25292         uint8_t unused_0[3];
25293         /*
25294          * pri assigned to MPLS TC(EXP) 0. This value can only
25295          * be changed before traffic has started.
25296          */
25297         uint8_t tc0_pri_queue_id;
25298         /*
25299          * pri assigned to MPLS TC(EXP) 1. This value can only
25300          * be changed before traffic has started.
25301          */
25302         uint8_t tc1_pri_queue_id;
25303         /*
25304          * pri assigned to MPLS TC(EXP) 2  This value can only
25305          * be changed before traffic has started.
25306          */
25307         uint8_t tc2_pri_queue_id;
25308         /*
25309          * pri assigned to MPLS TC(EXP) 3. This value can only
25310          * be changed before traffic has started.
25311          */
25312         uint8_t tc3_pri_queue_id;
25313         /*
25314          * pri assigned to MPLS TC(EXP) 4. This value can only
25315          * be changed before traffic has started.
25316          */
25317         uint8_t tc4_pri_queue_id;
25318         /*
25319          * pri assigned to MPLS TC(EXP) 5. This value can only
25320          * be changed before traffic has started.
25321          */
25322         uint8_t tc5_pri_queue_id;
25323         /*
25324          * pri assigned to MPLS TC(EXP) 6. This value can only
25325          * be changed before traffic has started.
25326          */
25327         uint8_t tc6_pri_queue_id;
25328         /*
25329          * pri assigned to MPLS TC(EXP) 7. This value can only
25330          * be changed before traffic has started.
25331          */
25332         uint8_t tc7_pri_queue_id;
25333 } __rte_packed;
25334
25335 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
25336 struct hwrm_queue_mplstc2pri_cfg_output {
25337         /* The specific error status for the command. */
25338         uint16_t        error_code;
25339         /* The HWRM command request type. */
25340         uint16_t        req_type;
25341         /* The sequence ID from the original command. */
25342         uint16_t        seq_id;
25343         /* The length of the response data in number of bytes. */
25344         uint16_t        resp_len;
25345         uint8_t unused_0[7];
25346         /*
25347          * This field is used in Output records to indicate that the output
25348          * is completely written to RAM. This field should be read as '1'
25349          * to indicate that the output has been completely written.
25350          * When writing a command completion or response to an internal processor,
25351          * the order of writes has to be such that this field is written last.
25352          */
25353         uint8_t valid;
25354 } __rte_packed;
25355
25356 /*******************
25357  * hwrm_vnic_alloc *
25358  *******************/
25359
25360
25361 /* hwrm_vnic_alloc_input (size:192b/24B) */
25362 struct hwrm_vnic_alloc_input {
25363         /* The HWRM command request type. */
25364         uint16_t        req_type;
25365         /*
25366          * The completion ring to send the completion event on. This should
25367          * be the NQ ID returned from the `nq_alloc` HWRM command.
25368          */
25369         uint16_t        cmpl_ring;
25370         /*
25371          * The sequence ID is used by the driver for tracking multiple
25372          * commands. This ID is treated as opaque data by the firmware and
25373          * the value is returned in the `hwrm_resp_hdr` upon completion.
25374          */
25375         uint16_t        seq_id;
25376         /*
25377          * The target ID of the command:
25378          * * 0x0-0xFFF8 - The function ID
25379          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25380          * * 0xFFFD - Reserved for user-space HWRM interface
25381          * * 0xFFFF - HWRM
25382          */
25383         uint16_t        target_id;
25384         /*
25385          * A physical address pointer pointing to a host buffer that the
25386          * command's response data will be written. This can be either a host
25387          * physical address (HPA) or a guest physical address (GPA) and must
25388          * point to a physically contiguous block of memory.
25389          */
25390         uint64_t        resp_addr;
25391         uint32_t        flags;
25392         /*
25393          * When this bit is '1', this VNIC is requested to
25394          * be the default VNIC for this function.
25395          */
25396         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
25397         uint8_t unused_0[4];
25398 } __rte_packed;
25399
25400 /* hwrm_vnic_alloc_output (size:128b/16B) */
25401 struct hwrm_vnic_alloc_output {
25402         /* The specific error status for the command. */
25403         uint16_t        error_code;
25404         /* The HWRM command request type. */
25405         uint16_t        req_type;
25406         /* The sequence ID from the original command. */
25407         uint16_t        seq_id;
25408         /* The length of the response data in number of bytes. */
25409         uint16_t        resp_len;
25410         /* Logical vnic ID */
25411         uint32_t        vnic_id;
25412         uint8_t unused_0[3];
25413         /*
25414          * This field is used in Output records to indicate that the output
25415          * is completely written to RAM.  This field should be read as '1'
25416          * to indicate that the output has been completely written.
25417          * When writing a command completion or response to an internal processor,
25418          * the order of writes has to be such that this field is written last.
25419          */
25420         uint8_t valid;
25421 } __rte_packed;
25422
25423 /******************
25424  * hwrm_vnic_free *
25425  ******************/
25426
25427
25428 /* hwrm_vnic_free_input (size:192b/24B) */
25429 struct hwrm_vnic_free_input {
25430         /* The HWRM command request type. */
25431         uint16_t        req_type;
25432         /*
25433          * The completion ring to send the completion event on. This should
25434          * be the NQ ID returned from the `nq_alloc` HWRM command.
25435          */
25436         uint16_t        cmpl_ring;
25437         /*
25438          * The sequence ID is used by the driver for tracking multiple
25439          * commands. This ID is treated as opaque data by the firmware and
25440          * the value is returned in the `hwrm_resp_hdr` upon completion.
25441          */
25442         uint16_t        seq_id;
25443         /*
25444          * The target ID of the command:
25445          * * 0x0-0xFFF8 - The function ID
25446          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25447          * * 0xFFFD - Reserved for user-space HWRM interface
25448          * * 0xFFFF - HWRM
25449          */
25450         uint16_t        target_id;
25451         /*
25452          * A physical address pointer pointing to a host buffer that the
25453          * command's response data will be written. This can be either a host
25454          * physical address (HPA) or a guest physical address (GPA) and must
25455          * point to a physically contiguous block of memory.
25456          */
25457         uint64_t        resp_addr;
25458         /* Logical vnic ID */
25459         uint32_t        vnic_id;
25460         uint8_t unused_0[4];
25461 } __rte_packed;
25462
25463 /* hwrm_vnic_free_output (size:128b/16B) */
25464 struct hwrm_vnic_free_output {
25465         /* The specific error status for the command. */
25466         uint16_t        error_code;
25467         /* The HWRM command request type. */
25468         uint16_t        req_type;
25469         /* The sequence ID from the original command. */
25470         uint16_t        seq_id;
25471         /* The length of the response data in number of bytes. */
25472         uint16_t        resp_len;
25473         uint8_t unused_0[7];
25474         /*
25475          * This field is used in Output records to indicate that the output
25476          * is completely written to RAM.  This field should be read as '1'
25477          * to indicate that the output has been completely written.
25478          * When writing a command completion or response to an internal processor,
25479          * the order of writes has to be such that this field is written last.
25480          */
25481         uint8_t valid;
25482 } __rte_packed;
25483
25484 /*****************
25485  * hwrm_vnic_cfg *
25486  *****************/
25487
25488
25489 /* hwrm_vnic_cfg_input (size:384b/48B) */
25490 struct hwrm_vnic_cfg_input {
25491         /* The HWRM command request type. */
25492         uint16_t        req_type;
25493         /*
25494          * The completion ring to send the completion event on. This should
25495          * be the NQ ID returned from the `nq_alloc` HWRM command.
25496          */
25497         uint16_t        cmpl_ring;
25498         /*
25499          * The sequence ID is used by the driver for tracking multiple
25500          * commands. This ID is treated as opaque data by the firmware and
25501          * the value is returned in the `hwrm_resp_hdr` upon completion.
25502          */
25503         uint16_t        seq_id;
25504         /*
25505          * The target ID of the command:
25506          * * 0x0-0xFFF8 - The function ID
25507          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25508          * * 0xFFFD - Reserved for user-space HWRM interface
25509          * * 0xFFFF - HWRM
25510          */
25511         uint16_t        target_id;
25512         /*
25513          * A physical address pointer pointing to a host buffer that the
25514          * command's response data will be written. This can be either a host
25515          * physical address (HPA) or a guest physical address (GPA) and must
25516          * point to a physically contiguous block of memory.
25517          */
25518         uint64_t        resp_addr;
25519         uint32_t        flags;
25520         /*
25521          * When this bit is '1', the VNIC is requested to
25522          * be the default VNIC for the function.
25523          */
25524         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
25525                 UINT32_C(0x1)
25526         /*
25527          * When this bit is '1', the VNIC is being configured to
25528          * strip VLAN in the RX path.
25529          * If set to '0', then VLAN stripping is disabled on
25530          * this VNIC.
25531          */
25532         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
25533                 UINT32_C(0x2)
25534         /*
25535          * When this bit is '1', the VNIC is being configured to
25536          * buffer receive packets in the hardware until the host
25537          * posts new receive buffers.
25538          * If set to '0', then bd_stall is being configured to be
25539          * disabled on this VNIC.
25540          */
25541         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
25542                 UINT32_C(0x4)
25543         /*
25544          * When this bit is '1', the VNIC is being configured to
25545          * receive both RoCE and non-RoCE traffic.
25546          * If set to '0', then this VNIC is not configured to be
25547          * operating in dual VNIC mode.
25548          */
25549         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
25550                 UINT32_C(0x8)
25551         /*
25552          * When this flag is set to '1', the VNIC is requested to
25553          * be configured to receive only RoCE traffic.
25554          * If this flag is set to '0', then this flag shall be
25555          * ignored by the HWRM.
25556          * If roce_dual_vnic_mode flag is set to '1'
25557          * or roce_mirroring_capable_vnic_mode flag to 1,
25558          * then the HWRM client shall not set this flag to '1'.
25559          */
25560         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
25561                 UINT32_C(0x10)
25562         /*
25563          * When a VNIC uses one destination ring group for certain
25564          * application (e.g. Receive Flow Steering) where
25565          * exact match is used to direct packets to a VNIC with one
25566          * destination ring group only, there is no need to configure
25567          * RSS indirection table for that VNIC as only one destination
25568          * ring group is used.
25569          *
25570          * This flag is used to enable a mode where
25571          * RSS is enabled in the VNIC using a RSS context
25572          * for computing RSS hash but the RSS indirection table is
25573          * not configured using hwrm_vnic_rss_cfg.
25574          *
25575          * If this mode is enabled, then the driver should not program
25576          * RSS indirection table for the RSS context that is used for
25577          * computing RSS hash only.
25578          */
25579         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
25580                 UINT32_C(0x20)
25581         /*
25582          * When this bit is '1', the VNIC is being configured to
25583          * receive both RoCE and non-RoCE traffic, but forward only the
25584          * RoCE traffic further. Also, RoCE traffic can be mirrored to
25585          * L2 driver.
25586          */
25587         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
25588                 UINT32_C(0x40)
25589         uint32_t        enables;
25590         /*
25591          * This bit must be '1' for the dflt_ring_grp field to be
25592          * configured.
25593          */
25594         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
25595                 UINT32_C(0x1)
25596         /*
25597          * This bit must be '1' for the rss_rule field to be
25598          * configured.
25599          */
25600         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
25601                 UINT32_C(0x2)
25602         /*
25603          * This bit must be '1' for the cos_rule field to be
25604          * configured.
25605          */
25606         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
25607                 UINT32_C(0x4)
25608         /*
25609          * This bit must be '1' for the lb_rule field to be
25610          * configured.
25611          */
25612         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
25613                 UINT32_C(0x8)
25614         /*
25615          * This bit must be '1' for the mru field to be
25616          * configured.
25617          */
25618         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
25619                 UINT32_C(0x10)
25620         /*
25621          * This bit must be '1' for the default_rx_ring_id field to be
25622          * configured.
25623          */
25624         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
25625                 UINT32_C(0x20)
25626         /*
25627          * This bit must be '1' for the default_cmpl_ring_id field to be
25628          * configured.
25629          */
25630         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
25631                 UINT32_C(0x40)
25632         /* This bit must be '1' for the queue_id field to be configured. */
25633         #define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID \
25634                 UINT32_C(0x80)
25635         /* This bit must be '1' for the rx_csum_v2_mode field to be configured. */
25636         #define HWRM_VNIC_CFG_INPUT_ENABLES_RX_CSUM_V2_MODE \
25637                 UINT32_C(0x100)
25638         /* Logical vnic ID */
25639         uint16_t        vnic_id;
25640         /*
25641          * Default Completion ring for the VNIC.  This ring will
25642          * be chosen if packet does not match any RSS rules and if
25643          * there is no COS rule.
25644          */
25645         uint16_t        dflt_ring_grp;
25646         /*
25647          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
25648          * there is no RSS rule.
25649          */
25650         uint16_t        rss_rule;
25651         /*
25652          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
25653          * there is no COS rule.
25654          */
25655         uint16_t        cos_rule;
25656         /*
25657          * RSS ID for load balancing rule/table structure.
25658          * 0xFF... (All Fs) if there is no LB rule.
25659          */
25660         uint16_t        lb_rule;
25661         /*
25662          * The maximum receive unit of the vnic.
25663          * Each vnic is associated with a function.
25664          * The vnic mru value overwrites the mru setting of the
25665          * associated function.
25666          * The HWRM shall make sure that vnic mru does not exceed
25667          * the mru of the port the function is associated with.
25668          */
25669         uint16_t        mru;
25670         /*
25671          * Default Rx ring for the VNIC.  This ring will
25672          * be chosen if packet does not match any RSS rules.
25673          * The aggregation ring associated with the Rx ring is
25674          * implied based on the Rx ring specified when the
25675          * aggregation ring was allocated.
25676          */
25677         uint16_t        default_rx_ring_id;
25678         /*
25679          * Default completion ring for the VNIC.  This ring will
25680          * be chosen if packet does not match any RSS rules.
25681          */
25682         uint16_t        default_cmpl_ring_id;
25683         /*
25684          * When specified, only incoming packets classified to the specified CoS
25685          * queue ID will be arriving on this VNIC.  Packet priority to CoS mapping
25686          * rules can be specified using HWRM_QUEUE_PRI2COS_CFG.  In this mode,
25687          * ntuple filters with VNIC destination specified are invalid since they
25688          * conflict with the the CoS to VNIC steering rules in this mode.
25689          *
25690          * If this field is not specified, packet to VNIC steering will be
25691          * subject to the standard L2 filter rules and any additional ntuple
25692          * filter rules with destination VNIC specified.
25693          */
25694         uint16_t        queue_id;
25695         /*
25696          * If the device supports the RX V2 and RX TPA start V2 completion
25697          * records as indicated by the HWRM_VNIC_QCAPS command, this field is
25698          * used to specify the two RX checksum modes supported by these
25699          * completion records.
25700          */
25701         uint8_t rx_csum_v2_mode;
25702         /*
25703          * When configured with this checksum mode, the number of header
25704          * groups in the delivered packet with a valid IP checksum and
25705          * the number of header groups in the delivered packet with a valid
25706          * L4 checksum are reported. Valid checksums are counted from the
25707          * outermost header group to the innermost header group, stopping at
25708          * the first error.  This is the default checksum mode supported if
25709          * the driver doesn't explicitly configure the RX checksum mode.
25710          */
25711         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
25712         /*
25713          * When configured with this checksum mode, the checksum status is
25714          * reported using 'all ok' mode. In the RX completion record, one
25715          * bit indicates if the IP checksum is valid for all the parsed
25716          * header groups with an IP checksum. Another bit indicates if the
25717          * L4 checksum is valid for all the parsed header groups with an L4
25718          * checksum. The number of header groups that were parsed by the
25719          * chip and passed in the delivered packet is also reported.
25720          */
25721         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
25722         /*
25723          * Any rx_csum_v2_mode value larger than or equal to this is not
25724          * valid
25725          */
25726         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX     UINT32_C(0x2)
25727         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_LAST \
25728                 HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX
25729         uint8_t unused0[5];
25730 } __rte_packed;
25731
25732 /* hwrm_vnic_cfg_output (size:128b/16B) */
25733 struct hwrm_vnic_cfg_output {
25734         /* The specific error status for the command. */
25735         uint16_t        error_code;
25736         /* The HWRM command request type. */
25737         uint16_t        req_type;
25738         /* The sequence ID from the original command. */
25739         uint16_t        seq_id;
25740         /* The length of the response data in number of bytes. */
25741         uint16_t        resp_len;
25742         uint8_t unused_0[7];
25743         /*
25744          * This field is used in Output records to indicate that the output
25745          * is completely written to RAM.  This field should be read as '1'
25746          * to indicate that the output has been completely written.
25747          * When writing a command completion or response to an internal processor,
25748          * the order of writes has to be such that this field is written last.
25749          */
25750         uint8_t valid;
25751 } __rte_packed;
25752
25753 /******************
25754  * hwrm_vnic_qcfg *
25755  ******************/
25756
25757
25758 /* hwrm_vnic_qcfg_input (size:256b/32B) */
25759 struct hwrm_vnic_qcfg_input {
25760         /* The HWRM command request type. */
25761         uint16_t        req_type;
25762         /*
25763          * The completion ring to send the completion event on. This should
25764          * be the NQ ID returned from the `nq_alloc` HWRM command.
25765          */
25766         uint16_t        cmpl_ring;
25767         /*
25768          * The sequence ID is used by the driver for tracking multiple
25769          * commands. This ID is treated as opaque data by the firmware and
25770          * the value is returned in the `hwrm_resp_hdr` upon completion.
25771          */
25772         uint16_t        seq_id;
25773         /*
25774          * The target ID of the command:
25775          * * 0x0-0xFFF8 - The function ID
25776          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25777          * * 0xFFFD - Reserved for user-space HWRM interface
25778          * * 0xFFFF - HWRM
25779          */
25780         uint16_t        target_id;
25781         /*
25782          * A physical address pointer pointing to a host buffer that the
25783          * command's response data will be written. This can be either a host
25784          * physical address (HPA) or a guest physical address (GPA) and must
25785          * point to a physically contiguous block of memory.
25786          */
25787         uint64_t        resp_addr;
25788         uint32_t        enables;
25789         /*
25790          * This bit must be '1' for the vf_id_valid field to be
25791          * configured.
25792          */
25793         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
25794         /* Logical vnic ID */
25795         uint32_t        vnic_id;
25796         /* ID of Virtual Function whose VNIC resource is being queried. */
25797         uint16_t        vf_id;
25798         uint8_t unused_0[6];
25799 } __rte_packed;
25800
25801 /* hwrm_vnic_qcfg_output (size:256b/32B) */
25802 struct hwrm_vnic_qcfg_output {
25803         /* The specific error status for the command. */
25804         uint16_t        error_code;
25805         /* The HWRM command request type. */
25806         uint16_t        req_type;
25807         /* The sequence ID from the original command. */
25808         uint16_t        seq_id;
25809         /* The length of the response data in number of bytes. */
25810         uint16_t        resp_len;
25811         /* Default Completion ring for the VNIC. */
25812         uint16_t        dflt_ring_grp;
25813         /*
25814          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
25815          * there is no RSS rule.
25816          */
25817         uint16_t        rss_rule;
25818         /*
25819          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
25820          * there is no COS rule.
25821          */
25822         uint16_t        cos_rule;
25823         /*
25824          * RSS ID for load balancing rule/table structure.
25825          * 0xFF... (All Fs) if there is no LB rule.
25826          */
25827         uint16_t        lb_rule;
25828         /* The maximum receive unit of the vnic. */
25829         uint16_t        mru;
25830         uint8_t unused_0[2];
25831         uint32_t        flags;
25832         /*
25833          * When this bit is '1', the VNIC is the default VNIC for
25834          * the function.
25835          */
25836         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
25837                 UINT32_C(0x1)
25838         /*
25839          * When this bit is '1', the VNIC is configured to
25840          * strip VLAN in the RX path.
25841          * If set to '0', then VLAN stripping is disabled on
25842          * this VNIC.
25843          */
25844         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
25845                 UINT32_C(0x2)
25846         /*
25847          * When this bit is '1', the VNIC is configured to
25848          * buffer receive packets in the hardware until the host
25849          * posts new receive buffers.
25850          * If set to '0', then bd_stall is disabled on
25851          * this VNIC.
25852          */
25853         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
25854                 UINT32_C(0x4)
25855         /*
25856          * When this bit is '1', the VNIC is configured to
25857          * receive both RoCE and non-RoCE traffic.
25858          * If set to '0', then this VNIC is not configured to
25859          * operate in dual VNIC mode.
25860          */
25861         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
25862                 UINT32_C(0x8)
25863         /*
25864          * When this flag is set to '1', the VNIC is configured to
25865          * receive only RoCE traffic.
25866          * When this flag is set to '0', the VNIC is not configured
25867          * to receive only RoCE traffic.
25868          * If roce_dual_vnic_mode flag and this flag both are set
25869          * to '1', then it is an invalid configuration of the
25870          * VNIC. The HWRM should not allow that type of
25871          * mis-configuration by HWRM clients.
25872          */
25873         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
25874                 UINT32_C(0x10)
25875         /*
25876          * When a VNIC uses one destination ring group for certain
25877          * application (e.g. Receive Flow Steering) where
25878          * exact match is used to direct packets to a VNIC with one
25879          * destination ring group only, there is no need to configure
25880          * RSS indirection table for that VNIC as only one destination
25881          * ring group is used.
25882          *
25883          * When this bit is set to '1', then the VNIC is enabled in a
25884          * mode where RSS is enabled in the VNIC using a RSS context
25885          * for computing RSS hash but the RSS indirection table is
25886          * not configured.
25887          */
25888         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
25889                 UINT32_C(0x20)
25890         /*
25891          * When this bit is '1', the VNIC is configured to
25892          * receive both RoCE and non-RoCE traffic, but forward only
25893          * RoCE traffic further. Also RoCE traffic can be mirrored to
25894          * L2 driver.
25895          */
25896         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
25897                 UINT32_C(0x40)
25898         /*
25899          * When returned with a valid CoS Queue id, the CoS Queue/VNIC association
25900          * is valid.  Otherwise it will return 0xFFFF to indicate no VNIC/CoS
25901          * queue association.
25902          */
25903         uint16_t        queue_id;
25904         /*
25905          * If the device supports the RX V2 and RX TPA start V2 completion
25906          * records as indicated by the HWRM_VNIC_QCAPS command, this field is
25907          * used to specify the current RX checksum mode configured for all the
25908          * RX rings of a VNIC.
25909          */
25910         uint8_t rx_csum_v2_mode;
25911         /*
25912          * This value indicates that the VNIC is configured to use the
25913          * default RX checksum mode for all the rings associated with this
25914          * VNIC.
25915          */
25916         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
25917         /*
25918          * This value indicates that the VNIC is configured to use the RX
25919          * checksum ‘all_ok’ mode for all the rings associated with this
25920          * VNIC.
25921          */
25922         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
25923         /*
25924          * Any rx_csum_v2_mode value larger than or equal to this is not
25925          * valid
25926          */
25927         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX     UINT32_C(0x2)
25928         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_LAST \
25929                 HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX
25930         uint8_t unused_1[4];
25931         /*
25932          * This field is used in Output records to indicate that the output
25933          * is completely written to RAM.  This field should be read as '1'
25934          * to indicate that the output has been completely written.
25935          * When writing a command completion or response to an internal processor,
25936          * the order of writes has to be such that this field is written last.
25937          */
25938         uint8_t valid;
25939 } __rte_packed;
25940
25941 /*******************
25942  * hwrm_vnic_qcaps *
25943  *******************/
25944
25945
25946 /* hwrm_vnic_qcaps_input (size:192b/24B) */
25947 struct hwrm_vnic_qcaps_input {
25948         /* The HWRM command request type. */
25949         uint16_t        req_type;
25950         /*
25951          * The completion ring to send the completion event on. This should
25952          * be the NQ ID returned from the `nq_alloc` HWRM command.
25953          */
25954         uint16_t        cmpl_ring;
25955         /*
25956          * The sequence ID is used by the driver for tracking multiple
25957          * commands. This ID is treated as opaque data by the firmware and
25958          * the value is returned in the `hwrm_resp_hdr` upon completion.
25959          */
25960         uint16_t        seq_id;
25961         /*
25962          * The target ID of the command:
25963          * * 0x0-0xFFF8 - The function ID
25964          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25965          * * 0xFFFD - Reserved for user-space HWRM interface
25966          * * 0xFFFF - HWRM
25967          */
25968         uint16_t        target_id;
25969         /*
25970          * A physical address pointer pointing to a host buffer that the
25971          * command's response data will be written. This can be either a host
25972          * physical address (HPA) or a guest physical address (GPA) and must
25973          * point to a physically contiguous block of memory.
25974          */
25975         uint64_t        resp_addr;
25976         uint32_t        enables;
25977         uint8_t unused_0[4];
25978 } __rte_packed;
25979
25980 /* hwrm_vnic_qcaps_output (size:192b/24B) */
25981 struct hwrm_vnic_qcaps_output {
25982         /* The specific error status for the command. */
25983         uint16_t        error_code;
25984         /* The HWRM command request type. */
25985         uint16_t        req_type;
25986         /* The sequence ID from the original command. */
25987         uint16_t        seq_id;
25988         /* The length of the response data in number of bytes. */
25989         uint16_t        resp_len;
25990         /* The maximum receive unit that is settable on a vnic. */
25991         uint16_t        mru;
25992         uint8_t unused_0[2];
25993         uint32_t        flags;
25994         /* Unused. */
25995         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
25996                 UINT32_C(0x1)
25997         /*
25998          * When this bit is '1', the capability of stripping VLAN in
25999          * the RX path is supported on VNIC(s).
26000          * If set to '0', then VLAN stripping capability is
26001          * not supported on VNIC(s).
26002          */
26003         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
26004                 UINT32_C(0x2)
26005         /*
26006          * When this bit is '1', the capability to buffer receive
26007          * packets in the hardware until the host posts new receive buffers
26008          * is supported on VNIC(s).
26009          * If set to '0', then bd_stall capability is not supported
26010          * on VNIC(s).
26011          */
26012         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
26013                 UINT32_C(0x4)
26014         /*
26015          * When this bit is '1', the capability to
26016          * receive both RoCE and non-RoCE traffic on VNIC(s) is
26017          * supported.
26018          * If set to '0', then the capability to receive
26019          * both RoCE and non-RoCE traffic on VNIC(s) is
26020          * not supported.
26021          */
26022         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
26023                 UINT32_C(0x8)
26024         /*
26025          * When this bit is set to '1', the capability to configure
26026          * a VNIC to receive only RoCE traffic is supported.
26027          * When this flag is set to '0', the VNIC capability to
26028          * configure to receive only RoCE traffic is not supported.
26029          */
26030         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
26031                 UINT32_C(0x10)
26032         /*
26033          * When this bit is set to '1', then the capability to enable
26034          * a VNIC in a mode where RSS context without configuring
26035          * RSS indirection table is supported (for RSS hash computation).
26036          * When this bit is set to '0', then a VNIC can not be configured
26037          * with a mode to enable RSS context without configuring RSS
26038          * indirection table.
26039          */
26040         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
26041                 UINT32_C(0x20)
26042         /*
26043          * When this bit is '1', the capability to
26044          * mirror the the RoCE traffic is supported.
26045          * If set to '0', then the capability to mirror the
26046          * RoCE traffic is not supported.
26047          */
26048         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
26049                 UINT32_C(0x40)
26050         /*
26051          * When this bit is '1', the outermost RSS hashing capability
26052          * is supported. If set to '0', then the outermost RSS hashing
26053          * capability is not supported.
26054          */
26055         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
26056                 UINT32_C(0x80)
26057         /*
26058          * When this bit is '1', it indicates that firmware supports the
26059          * ability to steer incoming packets from one CoS queue to one
26060          * VNIC.  This optional feature can then be enabled
26061          * using HWRM_VNIC_CFG on any VNIC.  This feature is only
26062          * available when NVM option “enable_cos_classfication” is set
26063          * to 1.  If set to '0', firmware does not support this feature.
26064          */
26065         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP \
26066                 UINT32_C(0x100)
26067         /*
26068          * When this bit is '1', it indicates that HW and firmware supports
26069          * the use of RX V2 and RX TPA start V2 completion records for all
26070          * the RX rings of a VNIC. Once set, this feature is mandatory to
26071          * be used for the RX rings of the VNIC. Additionally, two new RX
26072          * checksum features supported by these ompletion records can be
26073          * configured using the HWRM_VNIC_CFG on a VNIC. If set to '0', the
26074          * HW and the firmware does not support this feature.
26075          */
26076         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V2_CAP \
26077                 UINT32_C(0x200)
26078         /*
26079          * This field advertises the maximum concurrent TPA aggregations
26080          * supported by the VNIC on new devices that support TPA v2.
26081          * '0' means that TPA v2 is not supported.
26082          */
26083         uint16_t        max_aggs_supported;
26084         uint8_t unused_1[5];
26085         /*
26086          * This field is used in Output records to indicate that the output
26087          * is completely written to RAM.  This field should be read as '1'
26088          * to indicate that the output has been completely written.
26089          * When writing a command completion or response to an internal processor,
26090          * the order of writes has to be such that this field is written last.
26091          */
26092         uint8_t valid;
26093 } __rte_packed;
26094
26095 /*********************
26096  * hwrm_vnic_tpa_cfg *
26097  *********************/
26098
26099
26100 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
26101 struct hwrm_vnic_tpa_cfg_input {
26102         /* The HWRM command request type. */
26103         uint16_t        req_type;
26104         /*
26105          * The completion ring to send the completion event on. This should
26106          * be the NQ ID returned from the `nq_alloc` HWRM command.
26107          */
26108         uint16_t        cmpl_ring;
26109         /*
26110          * The sequence ID is used by the driver for tracking multiple
26111          * commands. This ID is treated as opaque data by the firmware and
26112          * the value is returned in the `hwrm_resp_hdr` upon completion.
26113          */
26114         uint16_t        seq_id;
26115         /*
26116          * The target ID of the command:
26117          * * 0x0-0xFFF8 - The function ID
26118          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26119          * * 0xFFFD - Reserved for user-space HWRM interface
26120          * * 0xFFFF - HWRM
26121          */
26122         uint16_t        target_id;
26123         /*
26124          * A physical address pointer pointing to a host buffer that the
26125          * command's response data will be written. This can be either a host
26126          * physical address (HPA) or a guest physical address (GPA) and must
26127          * point to a physically contiguous block of memory.
26128          */
26129         uint64_t        resp_addr;
26130         uint32_t        flags;
26131         /*
26132          * When this bit is '1', the VNIC shall be configured to
26133          * perform transparent packet aggregation (TPA) of
26134          * non-tunneled TCP packets.
26135          */
26136         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
26137                 UINT32_C(0x1)
26138         /*
26139          * When this bit is '1', the VNIC shall be configured to
26140          * perform transparent packet aggregation (TPA) of
26141          * tunneled TCP packets.
26142          */
26143         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
26144                 UINT32_C(0x2)
26145         /*
26146          * When this bit is '1', the VNIC shall be configured to
26147          * perform transparent packet aggregation (TPA) according
26148          * to Windows Receive Segment Coalescing (RSC) rules.
26149          */
26150         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
26151                 UINT32_C(0x4)
26152         /*
26153          * When this bit is '1', the VNIC shall be configured to
26154          * perform transparent packet aggregation (TPA) according
26155          * to Linux Generic Receive Offload (GRO) rules.
26156          */
26157         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
26158                 UINT32_C(0x8)
26159         /*
26160          * When this bit is '1', the VNIC shall be configured to
26161          * perform transparent packet aggregation (TPA) for TCP
26162          * packets with IP ECN set to non-zero.
26163          */
26164         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
26165                 UINT32_C(0x10)
26166         /*
26167          * When this bit is '1', the VNIC shall be configured to
26168          * perform transparent packet aggregation (TPA) for
26169          * GRE tunneled TCP packets only if all packets have the
26170          * same GRE sequence.
26171          */
26172         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
26173                 UINT32_C(0x20)
26174         /*
26175          * When this bit is '1' and the GRO mode is enabled,
26176          * the VNIC shall be configured to
26177          * perform transparent packet aggregation (TPA) for
26178          * TCP/IPv4 packets with consecutively increasing IPIDs.
26179          * In other words, the last packet that is being
26180          * aggregated to an already existing aggregation context
26181          * shall have IPID 1 more than the IPID of the last packet
26182          * that was aggregated in that aggregation context.
26183          */
26184         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
26185                 UINT32_C(0x40)
26186         /*
26187          * When this bit is '1' and the GRO mode is enabled,
26188          * the VNIC shall be configured to
26189          * perform transparent packet aggregation (TPA) for
26190          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
26191          * value.
26192          */
26193         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
26194                 UINT32_C(0x80)
26195         /*
26196          * When this bit is '1' and the GRO mode is enabled,
26197          * the VNIC shall DMA payload data using GRO rules.
26198          * When this bit is '0', the VNIC shall DMA payload data
26199          * using the more efficient LRO rules of filling all
26200          * aggregation buffers.
26201          */
26202         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO \
26203                 UINT32_C(0x100)
26204         uint32_t        enables;
26205         /*
26206          * This bit must be '1' for the max_agg_segs field to be
26207          * configured.
26208          */
26209         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
26210         /*
26211          * This bit must be '1' for the max_aggs field to be
26212          * configured.
26213          */
26214         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
26215         /*
26216          * This bit must be '1' for the max_agg_timer field to be
26217          * configured.
26218          */
26219         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
26220         /* deprecated bit.  Do not use!!! */
26221         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
26222         /* Logical vnic ID */
26223         uint16_t        vnic_id;
26224         /*
26225          * This is the maximum number of TCP segments that can
26226          * be aggregated (unit is Log2). Max value is 31. On new
26227          * devices supporting TPA v2, the unit is multiples of 4 and
26228          * valid values are > 0 and <= 63.
26229          */
26230         uint16_t        max_agg_segs;
26231         /* 1 segment */
26232         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
26233         /* 2 segments */
26234         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
26235         /* 4 segments */
26236         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
26237         /* 8 segments */
26238         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
26239         /* Any segment size larger than this is not valid */
26240         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
26241         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
26242                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
26243         /*
26244          * This is the maximum number of aggregations this VNIC is
26245          * allowed (unit is Log2). Max value is 7. On new devices
26246          * supporting TPA v2, this is in unit of 1 and must be > 0
26247          * and <= max_aggs_supported in the hwrm_vnic_qcaps response
26248          * to enable TPA v2.
26249          */
26250         uint16_t        max_aggs;
26251         /* 1 aggregation */
26252         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
26253         /* 2 aggregations */
26254         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
26255         /* 4 aggregations */
26256         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
26257         /* 8 aggregations */
26258         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
26259         /* 16 aggregations */
26260         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
26261         /* Any aggregation size larger than this is not valid */
26262         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
26263         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
26264                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
26265         uint8_t unused_0[2];
26266         /*
26267          * This is the maximum amount of time allowed for
26268          * an aggregation context to complete after it was initiated.
26269          */
26270         uint32_t        max_agg_timer;
26271         /*
26272          * This is the minimum amount of payload length required to
26273          * start an aggregation context. This field is deprecated and
26274          * should be set to 0.  The minimum length is set by firmware
26275          * and can be queried using hwrm_vnic_tpa_qcfg.
26276          */
26277         uint32_t        min_agg_len;
26278 } __rte_packed;
26279
26280 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
26281 struct hwrm_vnic_tpa_cfg_output {
26282         /* The specific error status for the command. */
26283         uint16_t        error_code;
26284         /* The HWRM command request type. */
26285         uint16_t        req_type;
26286         /* The sequence ID from the original command. */
26287         uint16_t        seq_id;
26288         /* The length of the response data in number of bytes. */
26289         uint16_t        resp_len;
26290         uint8_t unused_0[7];
26291         /*
26292          * This field is used in Output records to indicate that the output
26293          * is completely written to RAM.  This field should be read as '1'
26294          * to indicate that the output has been completely written.
26295          * When writing a command completion or response to an internal processor,
26296          * the order of writes has to be such that this field is written last.
26297          */
26298         uint8_t valid;
26299 } __rte_packed;
26300
26301 /*********************
26302  * hwrm_vnic_rss_cfg *
26303  *********************/
26304
26305
26306 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
26307 struct hwrm_vnic_rss_cfg_input {
26308         /* The HWRM command request type. */
26309         uint16_t        req_type;
26310         /*
26311          * The completion ring to send the completion event on. This should
26312          * be the NQ ID returned from the `nq_alloc` HWRM command.
26313          */
26314         uint16_t        cmpl_ring;
26315         /*
26316          * The sequence ID is used by the driver for tracking multiple
26317          * commands. This ID is treated as opaque data by the firmware and
26318          * the value is returned in the `hwrm_resp_hdr` upon completion.
26319          */
26320         uint16_t        seq_id;
26321         /*
26322          * The target ID of the command:
26323          * * 0x0-0xFFF8 - The function ID
26324          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26325          * * 0xFFFD - Reserved for user-space HWRM interface
26326          * * 0xFFFF - HWRM
26327          */
26328         uint16_t        target_id;
26329         /*
26330          * A physical address pointer pointing to a host buffer that the
26331          * command's response data will be written. This can be either a host
26332          * physical address (HPA) or a guest physical address (GPA) and must
26333          * point to a physically contiguous block of memory.
26334          */
26335         uint64_t        resp_addr;
26336         uint32_t        hash_type;
26337         /*
26338          * When this bit is '1', the RSS hash shall be computed
26339          * over source and destination IPv4 addresses of IPv4
26340          * packets.
26341          */
26342         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
26343         /*
26344          * When this bit is '1', the RSS hash shall be computed
26345          * over source/destination IPv4 addresses and
26346          * source/destination ports of TCP/IPv4 packets.
26347          */
26348         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
26349         /*
26350          * When this bit is '1', the RSS hash shall be computed
26351          * over source/destination IPv4 addresses and
26352          * source/destination ports of UDP/IPv4 packets.
26353          */
26354         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
26355         /*
26356          * When this bit is '1', the RSS hash shall be computed
26357          * over source and destination IPv4 addresses of IPv6
26358          * packets.
26359          */
26360         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
26361         /*
26362          * When this bit is '1', the RSS hash shall be computed
26363          * over source/destination IPv6 addresses and
26364          * source/destination ports of TCP/IPv6 packets.
26365          */
26366         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
26367         /*
26368          * When this bit is '1', the RSS hash shall be computed
26369          * over source/destination IPv6 addresses and
26370          * source/destination ports of UDP/IPv6 packets.
26371          */
26372         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
26373         /* VNIC ID of VNIC associated with RSS table being configured. */
26374         uint16_t        vnic_id;
26375         /*
26376          * Specifies which VNIC ring table pair to configure.
26377          * Valid values range from 0 to 7.
26378          */
26379         uint8_t ring_table_pair_index;
26380         /* Flags to specify different RSS hash modes. */
26381         uint8_t hash_mode_flags;
26382         /*
26383          * When this bit is '1', it indicates using current RSS
26384          * hash mode setting configured in the device.
26385          */
26386         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
26387                 UINT32_C(0x1)
26388         /*
26389          * When this bit is '1', it indicates requesting support of
26390          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
26391          * l4.src, l4.dest} for tunnel packets. For none-tunnel
26392          * packets, the RSS hash is computed over the normal
26393          * src/dest l3 and src/dest l4 headers.
26394          */
26395         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
26396                 UINT32_C(0x2)
26397         /*
26398          * When this bit is '1', it indicates requesting support of
26399          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
26400          * tunnel packets. For none-tunnel packets, the RSS hash is
26401          * computed over the normal src/dest l3 headers.
26402          */
26403         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
26404                 UINT32_C(0x4)
26405         /*
26406          * When this bit is '1', it indicates requesting support of
26407          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
26408          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
26409          * packets, the RSS hash is computed over the normal
26410          * src/dest l3 and src/dest l4 headers.
26411          */
26412         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
26413                 UINT32_C(0x8)
26414         /*
26415          * When this bit is '1', it indicates requesting support of
26416          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
26417          * tunnel packets. For none-tunnel packets, the RSS hash is
26418          * computed over the normal src/dest l3 headers.
26419          */
26420         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
26421                 UINT32_C(0x10)
26422         /* This is the address for rss ring group table */
26423         uint64_t        ring_grp_tbl_addr;
26424         /* This is the address for rss hash key table */
26425         uint64_t        hash_key_tbl_addr;
26426         /* Index to the rss indirection table. */
26427         uint16_t        rss_ctx_idx;
26428         uint8_t unused_1[6];
26429 } __rte_packed;
26430
26431 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
26432 struct hwrm_vnic_rss_cfg_output {
26433         /* The specific error status for the command. */
26434         uint16_t        error_code;
26435         /* The HWRM command request type. */
26436         uint16_t        req_type;
26437         /* The sequence ID from the original command. */
26438         uint16_t        seq_id;
26439         /* The length of the response data in number of bytes. */
26440         uint16_t        resp_len;
26441         uint8_t unused_0[7];
26442         /*
26443          * This field is used in Output records to indicate that the output
26444          * is completely written to RAM.  This field should be read as '1'
26445          * to indicate that the output has been completely written.
26446          * When writing a command completion or response to an internal processor,
26447          * the order of writes has to be such that this field is written last.
26448          */
26449         uint8_t valid;
26450 } __rte_packed;
26451
26452 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
26453 struct hwrm_vnic_rss_cfg_cmd_err {
26454         /*
26455          * command specific error codes that goes to
26456          * the cmd_err field in Common HWRM Error Response.
26457          */
26458         uint8_t code;
26459         /* Unknown error */
26460         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_UNKNOWN \
26461                 UINT32_C(0x0)
26462         /*
26463          * Unable to change global RSS mode to outer due to all active
26464          * interfaces are not ready to support outer RSS hashing.
26465          */
26466         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY \
26467                 UINT32_C(0x1)
26468         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST \
26469                 HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
26470         uint8_t unused_0[7];
26471 } __rte_packed;
26472
26473 /**********************
26474  * hwrm_vnic_rss_qcfg *
26475  **********************/
26476
26477
26478 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
26479 struct hwrm_vnic_rss_qcfg_input {
26480         /* The HWRM command request type. */
26481         uint16_t        req_type;
26482         /*
26483          * The completion ring to send the completion event on. This should
26484          * be the NQ ID returned from the `nq_alloc` HWRM command.
26485          */
26486         uint16_t        cmpl_ring;
26487         /*
26488          * The sequence ID is used by the driver for tracking multiple
26489          * commands. This ID is treated as opaque data by the firmware and
26490          * the value is returned in the `hwrm_resp_hdr` upon completion.
26491          */
26492         uint16_t        seq_id;
26493         /*
26494          * The target ID of the command:
26495          * * 0x0-0xFFF8 - The function ID
26496          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26497          * * 0xFFFD - Reserved for user-space HWRM interface
26498          * * 0xFFFF - HWRM
26499          */
26500         uint16_t        target_id;
26501         /*
26502          * A physical address pointer pointing to a host buffer that the
26503          * command's response data will be written. This can be either a host
26504          * physical address (HPA) or a guest physical address (GPA) and must
26505          * point to a physically contiguous block of memory.
26506          */
26507         uint64_t        resp_addr;
26508         /* Index to the rss indirection table. */
26509         uint16_t        rss_ctx_idx;
26510         uint8_t unused_0[6];
26511 } __rte_packed;
26512
26513 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
26514 struct hwrm_vnic_rss_qcfg_output {
26515         /* The specific error status for the command. */
26516         uint16_t        error_code;
26517         /* The HWRM command request type. */
26518         uint16_t        req_type;
26519         /* The sequence ID from the original command. */
26520         uint16_t        seq_id;
26521         /* The length of the response data in number of bytes. */
26522         uint16_t        resp_len;
26523         uint32_t        hash_type;
26524         /*
26525          * When this bit is '1', the RSS hash shall be computed
26526          * over source and destination IPv4 addresses of IPv4
26527          * packets.
26528          */
26529         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
26530         /*
26531          * When this bit is '1', the RSS hash shall be computed
26532          * over source/destination IPv4 addresses and
26533          * source/destination ports of TCP/IPv4 packets.
26534          */
26535         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
26536         /*
26537          * When this bit is '1', the RSS hash shall be computed
26538          * over source/destination IPv4 addresses and
26539          * source/destination ports of UDP/IPv4 packets.
26540          */
26541         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
26542         /*
26543          * When this bit is '1', the RSS hash shall be computed
26544          * over source and destination IPv4 addresses of IPv6
26545          * packets.
26546          */
26547         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
26548         /*
26549          * When this bit is '1', the RSS hash shall be computed
26550          * over source/destination IPv6 addresses and
26551          * source/destination ports of TCP/IPv6 packets.
26552          */
26553         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
26554         /*
26555          * When this bit is '1', the RSS hash shall be computed
26556          * over source/destination IPv6 addresses and
26557          * source/destination ports of UDP/IPv6 packets.
26558          */
26559         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
26560         uint8_t unused_0[4];
26561         /* This is the value of rss hash key */
26562         uint32_t        hash_key[10];
26563         /* Flags to specify different RSS hash modes. */
26564         uint8_t hash_mode_flags;
26565         /*
26566          * When this bit is '1', it indicates using current RSS
26567          * hash mode setting configured in the device.
26568          */
26569         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
26570                 UINT32_C(0x1)
26571         /*
26572          * When this bit is '1', it indicates requesting support of
26573          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
26574          * l4.src, l4.dest} for tunnel packets. For none-tunnel
26575          * packets, the RSS hash is computed over the normal
26576          * src/dest l3 and src/dest l4 headers.
26577          */
26578         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
26579                 UINT32_C(0x2)
26580         /*
26581          * When this bit is '1', it indicates requesting support of
26582          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
26583          * tunnel packets. For none-tunnel packets, the RSS hash is
26584          * computed over the normal src/dest l3 headers.
26585          */
26586         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
26587                 UINT32_C(0x4)
26588         /*
26589          * When this bit is '1', it indicates requesting support of
26590          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
26591          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
26592          * packets, the RSS hash is computed over the normal
26593          * src/dest l3 and src/dest l4 headers.
26594          */
26595         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
26596                 UINT32_C(0x8)
26597         /*
26598          * When this bit is '1', it indicates requesting support of
26599          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
26600          * tunnel packets. For none-tunnel packets, the RSS hash is
26601          * computed over the normal src/dest l3 headers.
26602          */
26603         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
26604                 UINT32_C(0x10)
26605         uint8_t unused_1[6];
26606         /*
26607          * This field is used in Output records to indicate that the output
26608          * is completely written to RAM.  This field should be read as '1'
26609          * to indicate that the output has been completely written.
26610          * When writing a command completion or response to an internal processor,
26611          * the order of writes has to be such that this field is written last.
26612          */
26613         uint8_t valid;
26614 } __rte_packed;
26615
26616 /**************************
26617  * hwrm_vnic_plcmodes_cfg *
26618  **************************/
26619
26620
26621 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
26622 struct hwrm_vnic_plcmodes_cfg_input {
26623         /* The HWRM command request type. */
26624         uint16_t        req_type;
26625         /*
26626          * The completion ring to send the completion event on. This should
26627          * be the NQ ID returned from the `nq_alloc` HWRM command.
26628          */
26629         uint16_t        cmpl_ring;
26630         /*
26631          * The sequence ID is used by the driver for tracking multiple
26632          * commands. This ID is treated as opaque data by the firmware and
26633          * the value is returned in the `hwrm_resp_hdr` upon completion.
26634          */
26635         uint16_t        seq_id;
26636         /*
26637          * The target ID of the command:
26638          * * 0x0-0xFFF8 - The function ID
26639          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26640          * * 0xFFFD - Reserved for user-space HWRM interface
26641          * * 0xFFFF - HWRM
26642          */
26643         uint16_t        target_id;
26644         /*
26645          * A physical address pointer pointing to a host buffer that the
26646          * command's response data will be written. This can be either a host
26647          * physical address (HPA) or a guest physical address (GPA) and must
26648          * point to a physically contiguous block of memory.
26649          */
26650         uint64_t        resp_addr;
26651         uint32_t        flags;
26652         /*
26653          * When this bit is '1', the VNIC shall be configured to
26654          * use regular placement algorithm.
26655          * By default, the regular placement algorithm shall be
26656          * enabled on the VNIC.
26657          */
26658         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
26659                 UINT32_C(0x1)
26660         /*
26661          * When this bit is '1', the VNIC shall be configured
26662          * use the jumbo placement algorithm.
26663          */
26664         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
26665                 UINT32_C(0x2)
26666         /*
26667          * When this bit is '1', the VNIC shall be configured
26668          * to enable Header-Data split for IPv4 packets according
26669          * to the following rules:
26670          * # If the packet is identified as TCP/IPv4, then the
26671          * packet is split at the beginning of the TCP payload.
26672          * # If the packet is identified as UDP/IPv4, then the
26673          * packet is split at the beginning of UDP payload.
26674          * # If the packet is identified as non-TCP and non-UDP
26675          * IPv4 packet, then the packet is split at the beginning
26676          * of the upper layer protocol header carried in the IPv4
26677          * packet.
26678          */
26679         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
26680                 UINT32_C(0x4)
26681         /*
26682          * When this bit is '1', the VNIC shall be configured
26683          * to enable Header-Data split for IPv6 packets according
26684          * to the following rules:
26685          * # If the packet is identified as TCP/IPv6, then the
26686          * packet is split at the beginning of the TCP payload.
26687          * # If the packet is identified as UDP/IPv6, then the
26688          * packet is split at the beginning of UDP payload.
26689          * # If the packet is identified as non-TCP and non-UDP
26690          * IPv6 packet, then the packet is split at the beginning
26691          * of the upper layer protocol header carried in the IPv6
26692          * packet.
26693          */
26694         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
26695                 UINT32_C(0x8)
26696         /*
26697          * When this bit is '1', the VNIC shall be configured
26698          * to enable Header-Data split for FCoE packets at the
26699          * beginning of FC payload.
26700          */
26701         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
26702                 UINT32_C(0x10)
26703         /*
26704          * When this bit is '1', the VNIC shall be configured
26705          * to enable Header-Data split for RoCE packets at the
26706          * beginning of RoCE payload (after BTH/GRH headers).
26707          */
26708         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
26709                 UINT32_C(0x20)
26710         /*
26711          * When this bit is '1', the VNIC shall be configured use the virtio
26712          * placement algorithm. This feature can only be configured when
26713          * proxy mode is supported on the function.
26714          */
26715         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_VIRTIO_PLACEMENT \
26716                 UINT32_C(0x40)
26717         uint32_t        enables;
26718         /*
26719          * This bit must be '1' for the jumbo_thresh_valid field to be
26720          * configured.
26721          */
26722         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
26723                 UINT32_C(0x1)
26724         /*
26725          * This bit must be '1' for the hds_offset_valid field to be
26726          * configured.
26727          */
26728         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
26729                 UINT32_C(0x2)
26730         /*
26731          * This bit must be '1' for the hds_threshold_valid field to be
26732          * configured.
26733          */
26734         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
26735                 UINT32_C(0x4)
26736         /*
26737          * This bit must be '1' for the max_bds_valid field to be
26738          * configured.
26739          */
26740         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_MAX_BDS_VALID \
26741                 UINT32_C(0x8)
26742         /* Logical vnic ID */
26743         uint32_t        vnic_id;
26744         /*
26745          * When jumbo placement algorithm is enabled, this value
26746          * is used to determine the threshold for jumbo placement.
26747          * Packets with length larger than this value will be
26748          * placed according to the jumbo placement algorithm.
26749          */
26750         uint16_t        jumbo_thresh;
26751         /*
26752          * This value is used to determine the offset into
26753          * packet buffer where the split data (payload) will be
26754          * placed according to one of HDS placement algorithm.
26755          *
26756          * The lengths of packet buffers provided for split data
26757          * shall be larger than this value.
26758          */
26759         uint16_t        hds_offset;
26760         /*
26761          * When one of the HDS placement algorithm is enabled, this
26762          * value is used to determine the threshold for HDS
26763          * placement.
26764          * Packets with length larger than this value will be
26765          * placed according to the HDS placement algorithm.
26766          * This value shall be in multiple of 4 bytes.
26767          */
26768         uint16_t        hds_threshold;
26769         /*
26770          * When virtio placement algorithm is enabled, this
26771          * value is used to determine the the maximum number of BDs
26772          * that can be used to place an Rx Packet.
26773          * If an incoming packet does not fit in the buffers described
26774          * by the max BDs, the packet will be dropped and an error
26775          * will be reported in the completion. Valid values for this
26776          * field are between 1 and 8. If the VNIC uses header-data-
26777          * separation and/or TPA with buffer spanning enabled, valid
26778          * values for this field are between 2 and 8.
26779          * This feature can only be configured when proxy mode is
26780          * supported on the function.
26781          */
26782         uint16_t        max_bds;
26783         uint8_t unused_0[4];
26784 } __rte_packed;
26785
26786 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
26787 struct hwrm_vnic_plcmodes_cfg_output {
26788         /* The specific error status for the command. */
26789         uint16_t        error_code;
26790         /* The HWRM command request type. */
26791         uint16_t        req_type;
26792         /* The sequence ID from the original command. */
26793         uint16_t        seq_id;
26794         /* The length of the response data in number of bytes. */
26795         uint16_t        resp_len;
26796         uint8_t unused_0[7];
26797         /*
26798          * This field is used in Output records to indicate that the output
26799          * is completely written to RAM.  This field should be read as '1'
26800          * to indicate that the output has been completely written.
26801          * When writing a command completion or response to an internal
26802          * processor, the order of writes has to be such that this field is
26803          * written last.
26804          */
26805         uint8_t valid;
26806 } __rte_packed;
26807
26808 /***************************
26809  * hwrm_vnic_plcmodes_qcfg *
26810  ***************************/
26811
26812
26813 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
26814 struct hwrm_vnic_plcmodes_qcfg_input {
26815         /* The HWRM command request type. */
26816         uint16_t        req_type;
26817         /*
26818          * The completion ring to send the completion event on. This should
26819          * be the NQ ID returned from the `nq_alloc` HWRM command.
26820          */
26821         uint16_t        cmpl_ring;
26822         /*
26823          * The sequence ID is used by the driver for tracking multiple
26824          * commands. This ID is treated as opaque data by the firmware and
26825          * the value is returned in the `hwrm_resp_hdr` upon completion.
26826          */
26827         uint16_t        seq_id;
26828         /*
26829          * The target ID of the command:
26830          * * 0x0-0xFFF8 - The function ID
26831          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26832          * * 0xFFFD - Reserved for user-space HWRM interface
26833          * * 0xFFFF - HWRM
26834          */
26835         uint16_t        target_id;
26836         /*
26837          * A physical address pointer pointing to a host buffer that the
26838          * command's response data will be written. This can be either a host
26839          * physical address (HPA) or a guest physical address (GPA) and must
26840          * point to a physically contiguous block of memory.
26841          */
26842         uint64_t        resp_addr;
26843         /* Logical vnic ID */
26844         uint32_t        vnic_id;
26845         uint8_t unused_0[4];
26846 } __rte_packed;
26847
26848 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
26849 struct hwrm_vnic_plcmodes_qcfg_output {
26850         /* The specific error status for the command. */
26851         uint16_t        error_code;
26852         /* The HWRM command request type. */
26853         uint16_t        req_type;
26854         /* The sequence ID from the original command. */
26855         uint16_t        seq_id;
26856         /* The length of the response data in number of bytes. */
26857         uint16_t        resp_len;
26858         uint32_t        flags;
26859         /*
26860          * When this bit is '1', the VNIC is configured to
26861          * use regular placement algorithm.
26862          */
26863         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
26864                 UINT32_C(0x1)
26865         /*
26866          * When this bit is '1', the VNIC is configured to
26867          * use the jumbo placement algorithm.
26868          */
26869         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
26870                 UINT32_C(0x2)
26871         /*
26872          * When this bit is '1', the VNIC is configured
26873          * to enable Header-Data split for IPv4 packets.
26874          */
26875         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
26876                 UINT32_C(0x4)
26877         /*
26878          * When this bit is '1', the VNIC is configured
26879          * to enable Header-Data split for IPv6 packets.
26880          */
26881         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
26882                 UINT32_C(0x8)
26883         /*
26884          * When this bit is '1', the VNIC is configured
26885          * to enable Header-Data split for FCoE packets.
26886          */
26887         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
26888                 UINT32_C(0x10)
26889         /*
26890          * When this bit is '1', the VNIC is configured
26891          * to enable Header-Data split for RoCE packets.
26892          */
26893         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
26894                 UINT32_C(0x20)
26895         /*
26896          * When this bit is '1', the VNIC is configured
26897          * to be the default VNIC of the requesting function.
26898          */
26899         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
26900                 UINT32_C(0x40)
26901         /*
26902          * When this bit is '1', the VNIC is configured to use the virtio
26903          * placement algorithm. This feature can only be configured when
26904          * proxy mode is supported on the function.
26905          */
26906         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_VIRTIO_PLACEMENT \
26907                 UINT32_C(0x80)
26908         /*
26909          * When jumbo placement algorithm is enabled, this value
26910          * is used to determine the threshold for jumbo placement.
26911          * Packets with length larger than this value will be
26912          * placed according to the jumbo placement algorithm.
26913          */
26914         uint16_t        jumbo_thresh;
26915         /*
26916          * This value is used to determine the offset into
26917          * packet buffer where the split data (payload) will be
26918          * placed according to one of HDS placement algorithm.
26919          *
26920          * The lengths of packet buffers provided for split data
26921          * shall be larger than this value.
26922          */
26923         uint16_t        hds_offset;
26924         /*
26925          * When one of the HDS placement algorithm is enabled, this
26926          * value is used to determine the threshold for HDS
26927          * placement.
26928          * Packets with length larger than this value will be
26929          * placed according to the HDS placement algorithm.
26930          * This value shall be in multiple of 4 bytes.
26931          */
26932         uint16_t        hds_threshold;
26933         /*
26934          * When virtio placement algorithm is enabled, this
26935          * value is used to determine the the maximum number of BDs
26936          * that can be used to place an Rx Packet.
26937          * If an incoming packet does not fit in the buffers described
26938          * by the max BDs, the packet will be dropped and an error
26939          * will be reported in the completion. Valid values for this
26940          * field are between 1 and 8. If the VNIC uses header-data-
26941          * separation and/or TPA with buffer spanning enabled, valid
26942          * values for this field are between 2 and 8.
26943          * This feature can only be configured when proxy mode is supported
26944          * on the function
26945          */
26946         uint16_t        max_bds;
26947         uint8_t unused_0[3];
26948         /*
26949          * This field is used in Output records to indicate that the output
26950          * is completely written to RAM.  This field should be read as '1'
26951          * to indicate that the output has been completely written.
26952          * When writing a command completion or response to an internal
26953          * processor, the order of writes has to be such that this field is
26954          * written last.
26955          */
26956         uint8_t valid;
26957 } __rte_packed;
26958
26959 /**********************************
26960  * hwrm_vnic_rss_cos_lb_ctx_alloc *
26961  **********************************/
26962
26963
26964 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
26965 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
26966         /* The HWRM command request type. */
26967         uint16_t        req_type;
26968         /*
26969          * The completion ring to send the completion event on. This should
26970          * be the NQ ID returned from the `nq_alloc` HWRM command.
26971          */
26972         uint16_t        cmpl_ring;
26973         /*
26974          * The sequence ID is used by the driver for tracking multiple
26975          * commands. This ID is treated as opaque data by the firmware and
26976          * the value is returned in the `hwrm_resp_hdr` upon completion.
26977          */
26978         uint16_t        seq_id;
26979         /*
26980          * The target ID of the command:
26981          * * 0x0-0xFFF8 - The function ID
26982          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26983          * * 0xFFFD - Reserved for user-space HWRM interface
26984          * * 0xFFFF - HWRM
26985          */
26986         uint16_t        target_id;
26987         /*
26988          * A physical address pointer pointing to a host buffer that the
26989          * command's response data will be written. This can be either a host
26990          * physical address (HPA) or a guest physical address (GPA) and must
26991          * point to a physically contiguous block of memory.
26992          */
26993         uint64_t        resp_addr;
26994 } __rte_packed;
26995
26996 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
26997 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
26998         /* The specific error status for the command. */
26999         uint16_t        error_code;
27000         /* The HWRM command request type. */
27001         uint16_t        req_type;
27002         /* The sequence ID from the original command. */
27003         uint16_t        seq_id;
27004         /* The length of the response data in number of bytes. */
27005         uint16_t        resp_len;
27006         /* rss_cos_lb_ctx_id is 16 b */
27007         uint16_t        rss_cos_lb_ctx_id;
27008         uint8_t unused_0[5];
27009         /*
27010          * This field is used in Output records to indicate that the output
27011          * is completely written to RAM.  This field should be read as '1'
27012          * to indicate that the output has been completely written.
27013          * When writing a command completion or response to an internal processor,
27014          * the order of writes has to be such that this field is written last.
27015          */
27016         uint8_t valid;
27017 } __rte_packed;
27018
27019 /*********************************
27020  * hwrm_vnic_rss_cos_lb_ctx_free *
27021  *********************************/
27022
27023
27024 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
27025 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
27026         /* The HWRM command request type. */
27027         uint16_t        req_type;
27028         /*
27029          * The completion ring to send the completion event on. This should
27030          * be the NQ ID returned from the `nq_alloc` HWRM command.
27031          */
27032         uint16_t        cmpl_ring;
27033         /*
27034          * The sequence ID is used by the driver for tracking multiple
27035          * commands. This ID is treated as opaque data by the firmware and
27036          * the value is returned in the `hwrm_resp_hdr` upon completion.
27037          */
27038         uint16_t        seq_id;
27039         /*
27040          * The target ID of the command:
27041          * * 0x0-0xFFF8 - The function ID
27042          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27043          * * 0xFFFD - Reserved for user-space HWRM interface
27044          * * 0xFFFF - HWRM
27045          */
27046         uint16_t        target_id;
27047         /*
27048          * A physical address pointer pointing to a host buffer that the
27049          * command's response data will be written. This can be either a host
27050          * physical address (HPA) or a guest physical address (GPA) and must
27051          * point to a physically contiguous block of memory.
27052          */
27053         uint64_t        resp_addr;
27054         /* rss_cos_lb_ctx_id is 16 b */
27055         uint16_t        rss_cos_lb_ctx_id;
27056         uint8_t unused_0[6];
27057 } __rte_packed;
27058
27059 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
27060 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
27061         /* The specific error status for the command. */
27062         uint16_t        error_code;
27063         /* The HWRM command request type. */
27064         uint16_t        req_type;
27065         /* The sequence ID from the original command. */
27066         uint16_t        seq_id;
27067         /* The length of the response data in number of bytes. */
27068         uint16_t        resp_len;
27069         uint8_t unused_0[7];
27070         /*
27071          * This field is used in Output records to indicate that the output
27072          * is completely written to RAM.  This field should be read as '1'
27073          * to indicate that the output has been completely written.
27074          * When writing a command completion or response to an internal processor,
27075          * the order of writes has to be such that this field is written last.
27076          */
27077         uint8_t valid;
27078 } __rte_packed;
27079
27080 /*******************
27081  * hwrm_ring_alloc *
27082  *******************/
27083
27084
27085 /* hwrm_ring_alloc_input (size:704b/88B) */
27086 struct hwrm_ring_alloc_input {
27087         /* The HWRM command request type. */
27088         uint16_t        req_type;
27089         /*
27090          * The completion ring to send the completion event on. This should
27091          * be the NQ ID returned from the `nq_alloc` HWRM command.
27092          */
27093         uint16_t        cmpl_ring;
27094         /*
27095          * The sequence ID is used by the driver for tracking multiple
27096          * commands. This ID is treated as opaque data by the firmware and
27097          * the value is returned in the `hwrm_resp_hdr` upon completion.
27098          */
27099         uint16_t        seq_id;
27100         /*
27101          * The target ID of the command:
27102          * * 0x0-0xFFF8 - The function ID
27103          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27104          * * 0xFFFD - Reserved for user-space HWRM interface
27105          * * 0xFFFF - HWRM
27106          */
27107         uint16_t        target_id;
27108         /*
27109          * A physical address pointer pointing to a host buffer that the
27110          * command's response data will be written. This can be either a host
27111          * physical address (HPA) or a guest physical address (GPA) and must
27112          * point to a physically contiguous block of memory.
27113          */
27114         uint64_t        resp_addr;
27115         uint32_t        enables;
27116         /*
27117          * This bit must be '1' for the ring_arb_cfg field to be
27118          * configured.
27119          */
27120         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
27121                 UINT32_C(0x2)
27122         /*
27123          * This bit must be '1' for the stat_ctx_id_valid field to be
27124          * configured.
27125          */
27126         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
27127                 UINT32_C(0x8)
27128         /*
27129          * This bit must be '1' for the max_bw_valid field to be
27130          * configured.
27131          */
27132         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
27133                 UINT32_C(0x20)
27134         /*
27135          * This bit must be '1' for the rx_ring_id field to be
27136          * configured.
27137          */
27138         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
27139                 UINT32_C(0x40)
27140         /*
27141          * This bit must be '1' for the nq_ring_id field to be
27142          * configured.
27143          */
27144         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
27145                 UINT32_C(0x80)
27146         /*
27147          * This bit must be '1' for the rx_buf_size field to be
27148          * configured.
27149          */
27150         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
27151                 UINT32_C(0x100)
27152         /*
27153          * This bit must be '1' for the schq_id field to be
27154          * configured.
27155          */
27156         #define HWRM_RING_ALLOC_INPUT_ENABLES_SCHQ_ID \
27157                 UINT32_C(0x200)
27158         /* Ring Type. */
27159         uint8_t ring_type;
27160         /* L2 Completion Ring (CR) */
27161         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
27162         /* TX Ring (TR) */
27163         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
27164         /* RX Ring (RR) */
27165         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
27166         /* RoCE Notification Completion Ring (ROCE_CR) */
27167         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
27168         /* RX Aggregation Ring */
27169         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
27170         /* Notification Queue */
27171         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
27172         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
27173                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
27174         uint8_t unused_0;
27175         /* Ring allocation flags. */
27176         uint16_t        flags;
27177         /*
27178          * For Rx rings, the incoming packet data can be placed at either
27179          * a 0B or 2B offset from the start of the Rx packet buffer. When
27180          * '1', the received packet will be padded with 2B of zeros at the
27181          * front of the packet. Note that this flag is only used for
27182          * Rx rings and is ignored for all other rings included Rx
27183          * Aggregation rings.
27184          */
27185         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD     UINT32_C(0x1)
27186         /*
27187          * This value is a pointer to the page table for the
27188          * Ring.
27189          */
27190         uint64_t        page_tbl_addr;
27191         /* First Byte Offset of the first entry in the first page. */
27192         uint32_t        fbo;
27193         /*
27194          * Actual page size in 2^page_size. The supported range is increments
27195          * in powers of 2 from 16 bytes to 1GB.
27196          * - 4 = 16 B
27197          *     Page size is 16 B.
27198          * - 12 = 4 KB
27199          *     Page size is 4 KB.
27200          * - 13 = 8 KB
27201          *     Page size is 8 KB.
27202          * - 16 = 64 KB
27203          *     Page size is 64 KB.
27204          * - 21 = 2 MB
27205          *     Page size is 2 MB.
27206          * - 22 = 4 MB
27207          *     Page size is 4 MB.
27208          * - 30 = 1 GB
27209          *     Page size is 1 GB.
27210          */
27211         uint8_t page_size;
27212         /*
27213          * This value indicates the depth of page table.
27214          * For this version of the specification, value other than 0 or
27215          * 1 shall be considered as an invalid value.
27216          * When the page_tbl_depth = 0, then it is treated as a
27217          * special case with the following.
27218          * 1. FBO and page size fields are not valid.
27219          * 2. page_tbl_addr is the physical address of the first
27220          *    element of the ring.
27221          */
27222         uint8_t page_tbl_depth;
27223         /* Used by a PF driver to associate a SCHQ with one of its TX rings. */
27224         uint16_t        schq_id;
27225         /*
27226          * Number of 16B units in the ring.  Minimum size for
27227          * a ring is 16 16B entries.
27228          */
27229         uint32_t        length;
27230         /*
27231          * Logical ring number for the ring to be allocated.
27232          * This value determines the position in the doorbell
27233          * area where the update to the ring will be made.
27234          *
27235          * For completion rings, this value is also the MSI-X
27236          * vector number for the function the completion ring is
27237          * associated with.
27238          */
27239         uint16_t        logical_id;
27240         /*
27241          * This field is used only when ring_type is a TX ring.
27242          * This value indicates what completion ring the TX ring
27243          * is associated with.
27244          */
27245         uint16_t        cmpl_ring_id;
27246         /*
27247          * This field is used only when ring_type is a TX ring.
27248          * This value indicates what CoS queue the TX ring
27249          * is associated with.
27250          */
27251         uint16_t        queue_id;
27252         /*
27253          * When allocating a Rx ring or Rx aggregation ring, this field
27254          * specifies the size of the buffer descriptors posted to the ring.
27255          */
27256         uint16_t        rx_buf_size;
27257         /*
27258          * When allocating an Rx aggregation ring, this field
27259          * specifies the associated Rx ring ID.
27260          */
27261         uint16_t        rx_ring_id;
27262         /*
27263          * When allocating a completion ring, this field
27264          * specifies the associated NQ ring ID.
27265          */
27266         uint16_t        nq_ring_id;
27267         /*
27268          * This field is used only when ring_type is a TX ring.
27269          * This field is used to configure arbitration related
27270          * parameters for a TX ring.
27271          */
27272         uint16_t        ring_arb_cfg;
27273         /* Arbitration policy used for the ring. */
27274         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
27275                 UINT32_C(0xf)
27276         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
27277         /*
27278          * Use strict priority for the TX ring.
27279          * Priority value is specified in arb_policy_param
27280          */
27281         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
27282                 UINT32_C(0x1)
27283         /*
27284          * Use weighted fair queue arbitration for the TX ring.
27285          * Weight is specified in arb_policy_param
27286          */
27287         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
27288                 UINT32_C(0x2)
27289         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
27290                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
27291         /* Reserved field. */
27292         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
27293                 UINT32_C(0xf0)
27294         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
27295         /*
27296          * Arbitration policy specific parameter.
27297          * # For strict priority arbitration policy, this field
27298          * represents a priority value. If set to 0, then the priority
27299          * is not specified and the HWRM is allowed to select
27300          * any priority for this TX ring.
27301          * # For weighted fair queue arbitration policy, this field
27302          * represents a weight value. If set to 0, then the weight
27303          * is not specified and the HWRM is allowed to select
27304          * any weight for this TX ring.
27305          */
27306         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
27307                 UINT32_C(0xff00)
27308         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
27309         uint16_t        unused_3;
27310         /*
27311          * This field is reserved for the future use.
27312          * It shall be set to 0.
27313          */
27314         uint32_t        reserved3;
27315         /*
27316          * This field is used only when ring_type is a TX ring.
27317          * This input indicates what statistics context this ring
27318          * should be associated with.
27319          */
27320         uint32_t        stat_ctx_id;
27321         /*
27322          * This field is reserved for the future use.
27323          * It shall be set to 0.
27324          */
27325         uint32_t        reserved4;
27326         /*
27327          * This field is used only when ring_type is a TX ring
27328          * to specify maximum BW allocated to the TX ring.
27329          * The HWRM will translate this value into byte counter and
27330          * time interval used for this ring inside the device.
27331          */
27332         uint32_t        max_bw;
27333         /* The bandwidth value. */
27334         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
27335                 UINT32_C(0xfffffff)
27336         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
27337         /* The granularity of the value (bits or bytes). */
27338         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
27339                 UINT32_C(0x10000000)
27340         /* Value is in bits. */
27341         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
27342                 (UINT32_C(0x0) << 28)
27343         /* Value is in bytes. */
27344         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
27345                 (UINT32_C(0x1) << 28)
27346         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
27347                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
27348         /* bw_value_unit is 3 b */
27349         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
27350                 UINT32_C(0xe0000000)
27351         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
27352         /* Value is in Mb or MB (base 10). */
27353         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
27354                 (UINT32_C(0x0) << 29)
27355         /* Value is in Kb or KB (base 10). */
27356         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
27357                 (UINT32_C(0x2) << 29)
27358         /* Value is in bits or bytes. */
27359         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
27360                 (UINT32_C(0x4) << 29)
27361         /* Value is in Gb or GB (base 10). */
27362         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
27363                 (UINT32_C(0x6) << 29)
27364         /* Value is in 1/100th of a percentage of total bandwidth. */
27365         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27366                 (UINT32_C(0x1) << 29)
27367         /* Invalid unit */
27368         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
27369                 (UINT32_C(0x7) << 29)
27370         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
27371                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
27372         /*
27373          * This field is used only when ring_type is a Completion ring.
27374          * This value indicates what interrupt mode should be used
27375          * on this completion ring.
27376          * Note: In the legacy interrupt mode, no more than 16
27377          * completion rings are allowed.
27378          */
27379         uint8_t int_mode;
27380         /* Legacy INTA */
27381         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
27382         /* Reserved */
27383         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
27384         /* MSI-X */
27385         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
27386         /* No Interrupt - Polled mode */
27387         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
27388         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
27389                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
27390         uint8_t unused_4[3];
27391         /*
27392          * The cq_handle is specified when allocating a completion ring. For
27393          * devices that support NQs, this cq_handle will be included in the
27394          * NQE to specify which CQ should be read to retrieve the completion
27395          * record.
27396          */
27397         uint64_t        cq_handle;
27398 } __rte_packed;
27399
27400 /* hwrm_ring_alloc_output (size:128b/16B) */
27401 struct hwrm_ring_alloc_output {
27402         /* The specific error status for the command. */
27403         uint16_t        error_code;
27404         /* The HWRM command request type. */
27405         uint16_t        req_type;
27406         /* The sequence ID from the original command. */
27407         uint16_t        seq_id;
27408         /* The length of the response data in number of bytes. */
27409         uint16_t        resp_len;
27410         /*
27411          * Physical number of ring allocated.
27412          * This value shall be unique for a ring type.
27413          */
27414         uint16_t        ring_id;
27415         /* Logical number of ring allocated. */
27416         uint16_t        logical_ring_id;
27417         uint8_t unused_0[3];
27418         /*
27419          * This field is used in Output records to indicate that the output
27420          * is completely written to RAM.  This field should be read as '1'
27421          * to indicate that the output has been completely written.
27422          * When writing a command completion or response to an internal processor,
27423          * the order of writes has to be such that this field is written last.
27424          */
27425         uint8_t valid;
27426 } __rte_packed;
27427
27428 /******************
27429  * hwrm_ring_free *
27430  ******************/
27431
27432
27433 /* hwrm_ring_free_input (size:192b/24B) */
27434 struct hwrm_ring_free_input {
27435         /* The HWRM command request type. */
27436         uint16_t        req_type;
27437         /*
27438          * The completion ring to send the completion event on. This should
27439          * be the NQ ID returned from the `nq_alloc` HWRM command.
27440          */
27441         uint16_t        cmpl_ring;
27442         /*
27443          * The sequence ID is used by the driver for tracking multiple
27444          * commands. This ID is treated as opaque data by the firmware and
27445          * the value is returned in the `hwrm_resp_hdr` upon completion.
27446          */
27447         uint16_t        seq_id;
27448         /*
27449          * The target ID of the command:
27450          * * 0x0-0xFFF8 - The function ID
27451          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27452          * * 0xFFFD - Reserved for user-space HWRM interface
27453          * * 0xFFFF - HWRM
27454          */
27455         uint16_t        target_id;
27456         /*
27457          * A physical address pointer pointing to a host buffer that the
27458          * command's response data will be written. This can be either a host
27459          * physical address (HPA) or a guest physical address (GPA) and must
27460          * point to a physically contiguous block of memory.
27461          */
27462         uint64_t        resp_addr;
27463         /* Ring Type. */
27464         uint8_t ring_type;
27465         /* L2 Completion Ring (CR) */
27466         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
27467         /* TX Ring (TR) */
27468         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
27469         /* RX Ring (RR) */
27470         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
27471         /* RoCE Notification Completion Ring (ROCE_CR) */
27472         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
27473         /* RX Aggregation Ring */
27474         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
27475         /* Notification Queue */
27476         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
27477         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
27478                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
27479         uint8_t unused_0;
27480         /* Physical number of ring allocated. */
27481         uint16_t        ring_id;
27482         uint8_t unused_1[4];
27483 } __rte_packed;
27484
27485 /* hwrm_ring_free_output (size:128b/16B) */
27486 struct hwrm_ring_free_output {
27487         /* The specific error status for the command. */
27488         uint16_t        error_code;
27489         /* The HWRM command request type. */
27490         uint16_t        req_type;
27491         /* The sequence ID from the original command. */
27492         uint16_t        seq_id;
27493         /* The length of the response data in number of bytes. */
27494         uint16_t        resp_len;
27495         uint8_t unused_0[7];
27496         /*
27497          * This field is used in Output records to indicate that the output
27498          * is completely written to RAM.  This field should be read as '1'
27499          * to indicate that the output has been completely written.
27500          * When writing a command completion or response to an internal processor,
27501          * the order of writes has to be such that this field is written last.
27502          */
27503         uint8_t valid;
27504 } __rte_packed;
27505
27506 /*******************
27507  * hwrm_ring_reset *
27508  *******************/
27509
27510
27511 /* hwrm_ring_reset_input (size:192b/24B) */
27512 struct hwrm_ring_reset_input {
27513         /* The HWRM command request type. */
27514         uint16_t        req_type;
27515         /*
27516          * The completion ring to send the completion event on. This should
27517          * be the NQ ID returned from the `nq_alloc` HWRM command.
27518          */
27519         uint16_t        cmpl_ring;
27520         /*
27521          * The sequence ID is used by the driver for tracking multiple
27522          * commands. This ID is treated as opaque data by the firmware and
27523          * the value is returned in the `hwrm_resp_hdr` upon completion.
27524          */
27525         uint16_t        seq_id;
27526         /*
27527          * The target ID of the command:
27528          * * 0x0-0xFFF8 - The function ID
27529          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27530          * * 0xFFFD - Reserved for user-space HWRM interface
27531          * * 0xFFFF - HWRM
27532          */
27533         uint16_t        target_id;
27534         /*
27535          * A physical address pointer pointing to a host buffer that the
27536          * command's response data will be written. This can be either a host
27537          * physical address (HPA) or a guest physical address (GPA) and must
27538          * point to a physically contiguous block of memory.
27539          */
27540         uint64_t        resp_addr;
27541         /* Ring Type. */
27542         uint8_t ring_type;
27543         /* L2 Completion Ring (CR) */
27544         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL     UINT32_C(0x0)
27545         /* TX Ring (TR) */
27546         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX          UINT32_C(0x1)
27547         /* RX Ring (RR) */
27548         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX          UINT32_C(0x2)
27549         /* RoCE Notification Completion Ring (ROCE_CR) */
27550         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL   UINT32_C(0x3)
27551         /*
27552          * Rx Ring Group.  This is to reset rx and aggregation in an atomic
27553          * operation. Completion ring associated with this ring group is
27554          * not reset.
27555          */
27556         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)
27557         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
27558                 HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP
27559         uint8_t unused_0;
27560         /*
27561          * Physical number of the ring. When ring type is rx_ring_grp, ring id
27562          * actually refers to ring group id.
27563          */
27564         uint16_t        ring_id;
27565         uint8_t unused_1[4];
27566 } __rte_packed;
27567
27568 /* hwrm_ring_reset_output (size:128b/16B) */
27569 struct hwrm_ring_reset_output {
27570         /* The specific error status for the command. */
27571         uint16_t        error_code;
27572         /* The HWRM command request type. */
27573         uint16_t        req_type;
27574         /* The sequence ID from the original command. */
27575         uint16_t        seq_id;
27576         /* The length of the response data in number of bytes. */
27577         uint16_t        resp_len;
27578         uint8_t unused_0[4];
27579         /* Position of consumer index after ring reset completes. */
27580         uint8_t consumer_idx[3];
27581         /*
27582          * This field is used in Output records to indicate that the output
27583          * is completely written to RAM.  This field should be read as '1'
27584          * to indicate that the output has been completely written.
27585          * When writing a command completion or response to an internal processor,
27586          * the order of writes has to be such that this field is written last.
27587          */
27588         uint8_t valid;
27589 } __rte_packed;
27590
27591 /*****************
27592  * hwrm_ring_cfg *
27593  *****************/
27594
27595
27596 /* hwrm_ring_cfg_input (size:256b/32B) */
27597 struct hwrm_ring_cfg_input {
27598         /* The HWRM command request type. */
27599         uint16_t        req_type;
27600         /*
27601          * The completion ring to send the completion event on. This should
27602          * be the NQ ID returned from the `nq_alloc` HWRM command.
27603          */
27604         uint16_t        cmpl_ring;
27605         /*
27606          * The sequence ID is used by the driver for tracking multiple
27607          * commands. This ID is treated as opaque data by the firmware and
27608          * the value is returned in the `hwrm_resp_hdr` upon completion.
27609          */
27610         uint16_t        seq_id;
27611         /*
27612          * The target ID of the command:
27613          * * 0x0-0xFFF8 - The function ID
27614          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27615          * * 0xFFFD - Reserved for user-space HWRM interface
27616          * * 0xFFFF - HWRM
27617          */
27618         uint16_t        target_id;
27619         /*
27620          * A physical address pointer pointing to a host buffer that the
27621          * command's response data will be written. This can be either a host
27622          * physical address (HPA) or a guest physical address (GPA) and must
27623          * point to a physically contiguous block of memory.
27624          */
27625         uint64_t        resp_addr;
27626         /* Ring Type. */
27627         uint8_t ring_type;
27628         /* TX Ring (TR) */
27629         #define HWRM_RING_CFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
27630         /* RX Ring (RR) */
27631         #define HWRM_RING_CFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
27632         #define HWRM_RING_CFG_INPUT_RING_TYPE_LAST \
27633                 HWRM_RING_CFG_INPUT_RING_TYPE_RX
27634         uint8_t unused_0;
27635         /* Physical number of the ring. */
27636         uint16_t        ring_id;
27637         /* Ring config enable bits. */
27638         uint16_t        enables;
27639         /*
27640          * For Rx rings, the incoming packet data can be placed at either
27641          * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
27642          * buffer.
27643          * When '1', the received packet will be padded with 2B, 10B or 12B
27644          * of zeros at the front of the packet. The exact offset is specified
27645          * by rx_sop_pad_bytes parameter.
27646          * When '0', the received packet will not be padded.
27647          * Note that this flag is only used for Rx rings and is ignored
27648          * for all other rings included Rx Aggregation rings.
27649          */
27650         #define HWRM_RING_CFG_INPUT_ENABLES_RX_SOP_PAD_ENABLE \
27651                 UINT32_C(0x1)
27652         /*
27653          * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
27654          * When rings are allocated, the PCI function on which driver issues
27655          * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
27656          * the buffer descriptors (BDs) from those rings is assumed to issue
27657          * packet payload DMA using same PCI function. When proxy mode is
27658          * enabled, hardware can perform payload DMA using another PCI
27659          * function on same or different host.
27660          * When set to '0', the PCI function on which driver issues
27661          * HWRM_RING_CFG command is used for host payload DMA operation.
27662          * When set to '1', the host PCI function specified by proxy_fid is
27663          * used for host payload DMA operation.
27664          */
27665         #define HWRM_RING_CFG_INPUT_ENABLES_PROXY_MODE_ENABLE \
27666                 UINT32_C(0x2)
27667         /*
27668          * Tx ring packet source interface override, for Tx rings only.
27669          * When TX rings are allocated, the PCI function on which driver
27670          * issues HWRM_RING_CFG is assumed to be source interface of
27671          * packets sent from TX ring.
27672          * When set to '1', the host PCI function specified by proxy_fid
27673          * is used as source interface of the transmitted packets.
27674          */
27675         #define HWRM_RING_CFG_INPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE \
27676                 UINT32_C(0x4)
27677         /* The schq_id field is valid */
27678         #define HWRM_RING_CFG_INPUT_ENABLES_SCHQ_ID \
27679                 UINT32_C(0x8)
27680         /* Update completion ring ID associated with Tx or Rx ring. */
27681         #define HWRM_RING_CFG_INPUT_ENABLES_CMPL_RING_ID_UPDATE \
27682                 UINT32_C(0x10)
27683         /*
27684          * Proxy function FID value.
27685          * This value is only used when either proxy_mode_enable flag or
27686          * tx_proxy_svif_override is set to '1'.
27687          * When proxy_mode_enable is set to '1', it identifies a host PCI
27688          * function used for host payload DMA operations.
27689          * When tx_proxy_src_intf is set to '1', it identifies a host PCI
27690          * function as source interface for all transmitted packets from
27691          * the TX ring.
27692          */
27693         uint16_t        proxy_fid;
27694         /*
27695          * Identifies the new scheduler queue (SCHQ) to associate with the
27696          * ring. Only valid for Tx rings.
27697          * A value of zero indicates that the Tx ring should be associated
27698          * with the default scheduler queue (SCHQ).
27699          */
27700         uint16_t        schq_id;
27701         /*
27702          * This field is valid for TX or Rx rings. This value identifies the
27703          * new completion ring ID to associate with the TX or Rx ring.
27704          */
27705         uint16_t        cmpl_ring_id;
27706         /*
27707          * Rx SOP padding amount in bytes.
27708          * This value is only used when rx_sop_pad_enable flag is set to '1'.
27709          */
27710         uint8_t rx_sop_pad_bytes;
27711         uint8_t unused_1[3];
27712 } __rte_packed;
27713
27714 /* hwrm_ring_cfg_output (size:128b/16B) */
27715 struct hwrm_ring_cfg_output {
27716         /* The specific error status for the command. */
27717         uint16_t        error_code;
27718         /* The HWRM command request type. */
27719         uint16_t        req_type;
27720         /* The sequence ID from the original command. */
27721         uint16_t        seq_id;
27722         /* The length of the response data in number of bytes. */
27723         uint16_t        resp_len;
27724         uint8_t unused_0[7];
27725         /*
27726          * This field is used in Output records to indicate that the output
27727          * is completely written to RAM.  This field should be read as '1'
27728          * to indicate that the output has been completely written.
27729          * When writing a command completion or response to an internal
27730          * processor, the order of writes has to be such that this field is
27731          * written last.
27732          */
27733         uint8_t valid;
27734 } __rte_packed;
27735
27736 /******************
27737  * hwrm_ring_qcfg *
27738  ******************/
27739
27740
27741 /* hwrm_ring_qcfg_input (size:192b/24B) */
27742 struct hwrm_ring_qcfg_input {
27743         /* The HWRM command request type. */
27744         uint16_t        req_type;
27745         /*
27746          * The completion ring to send the completion event on. This should
27747          * be the NQ ID returned from the `nq_alloc` HWRM command.
27748          */
27749         uint16_t        cmpl_ring;
27750         /*
27751          * The sequence ID is used by the driver for tracking multiple
27752          * commands. This ID is treated as opaque data by the firmware and
27753          * the value is returned in the `hwrm_resp_hdr` upon completion.
27754          */
27755         uint16_t        seq_id;
27756         /*
27757          * The target ID of the command:
27758          * * 0x0-0xFFF8 - The function ID
27759          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27760          * * 0xFFFD - Reserved for user-space HWRM interface
27761          * * 0xFFFF - HWRM
27762          */
27763         uint16_t        target_id;
27764         /*
27765          * A physical address pointer pointing to a host buffer that the
27766          * command's response data will be written. This can be either a host
27767          * physical address (HPA) or a guest physical address (GPA) and must
27768          * point to a physically contiguous block of memory.
27769          */
27770         uint64_t        resp_addr;
27771         /* Ring Type. */
27772         uint8_t ring_type;
27773         /* TX Ring (TR) */
27774         #define HWRM_RING_QCFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
27775         /* RX Ring (RR) */
27776         #define HWRM_RING_QCFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
27777         #define HWRM_RING_QCFG_INPUT_RING_TYPE_LAST \
27778                 HWRM_RING_QCFG_INPUT_RING_TYPE_RX
27779         uint8_t unused_0[5];
27780         /* Physical number of the ring. */
27781         uint16_t        ring_id;
27782 } __rte_packed;
27783
27784 /* hwrm_ring_qcfg_output (size:192b/24B) */
27785 struct hwrm_ring_qcfg_output {
27786         /* The specific error status for the command. */
27787         uint16_t        error_code;
27788         /* The HWRM command request type. */
27789         uint16_t        req_type;
27790         /* The sequence ID from the original command. */
27791         uint16_t        seq_id;
27792         /* The length of the response data in number of bytes. */
27793         uint16_t        resp_len;
27794         /* Ring config enable bits. */
27795         uint16_t        enables;
27796         /*
27797          * For Rx rings, the incoming packet data can be placed at either
27798          * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
27799          * buffer.
27800          * When '1', the received packet will be padded with 2B, 10B or 12B
27801          * of zeros at the front of the packet. The exact offset is specified
27802          * by rx_sop_pad_bytes parameter.
27803          * When '0', the received packet will not be padded.
27804          * Note that this flag is only used for Rx rings and is ignored
27805          * for all other rings included Rx Aggregation rings.
27806          */
27807         #define HWRM_RING_QCFG_OUTPUT_ENABLES_RX_SOP_PAD_ENABLE \
27808                 UINT32_C(0x1)
27809         /*
27810          * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
27811          * When rings are allocated, the PCI function on which driver issues
27812          * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
27813          * the buffer descriptors (BDs) from those rings is assumed to issue
27814          * packet payload DMA using same PCI function. When proxy mode is
27815          * enabled, hardware can perform payload DMA using another PCI
27816          * function on same or different host.
27817          * When set to '0', the PCI function on which driver issues
27818          * HWRM_RING_CFG command is used for host payload DMA operation.
27819          * When set to '1', the host PCI function specified by proxy_fid is
27820          * used for host payload DMA operation.
27821          */
27822         #define HWRM_RING_QCFG_OUTPUT_ENABLES_PROXY_MODE_ENABLE \
27823                 UINT32_C(0x2)
27824         /*
27825          * Tx ring packet source interface override, for Tx rings only.
27826          * When TX rings are allocated, the PCI function on which driver
27827          * issues HWRM_RING_CFG is assumed to be source interface of
27828          * packets sent from TX ring.
27829          * When set to '1', the host PCI function specified by proxy_fid is
27830          * used as source interface of the transmitted packets.
27831          */
27832         #define HWRM_RING_QCFG_OUTPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE \
27833                 UINT32_C(0x4)
27834         /*
27835          * Proxy function FID value.
27836          * This value is only used when either proxy_mode_enable flag or
27837          * tx_proxy_svif_override is set to '1'.
27838          * When proxy_mode_enable is set to '1', it identifies a host PCI
27839          * function used for host payload DMA operations.
27840          * When tx_proxy_src_intf is set to '1', it identifies a host PCI
27841          * function as source interface for all transmitted packets from the TX
27842          * ring.
27843          */
27844         uint16_t        proxy_fid;
27845         /*
27846          * Identifies the new scheduler queue (SCHQ) to associate with the
27847          * ring. Only valid for Tx rings.
27848          * A value of zero indicates that the Tx ring should be associated with
27849          * the default scheduler queue (SCHQ).
27850          */
27851         uint16_t        schq_id;
27852         /*
27853          * This field is used when ring_type is a TX or Rx ring.
27854          * This value indicates what completion ring the TX or Rx ring
27855          * is associated with.
27856          */
27857         uint16_t        cmpl_ring_id;
27858         /*
27859          * Rx SOP padding amount in bytes.
27860          * This value is only used when rx_sop_pad_enable flag is set to '1'.
27861          */
27862         uint8_t rx_sop_pad_bytes;
27863         uint8_t unused_0[6];
27864         /*
27865          * This field is used in Output records to indicate that the output
27866          * is completely written to RAM.  This field should be read as '1'
27867          * to indicate that the output has been completely written.
27868          * When writing a command completion or response to an internal
27869          * processor, the order of writes has to be such that this field is
27870          * written last.
27871          */
27872         uint8_t valid;
27873 } __rte_packed;
27874
27875 /**************************
27876  * hwrm_ring_aggint_qcaps *
27877  **************************/
27878
27879
27880 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
27881 struct hwrm_ring_aggint_qcaps_input {
27882         /* The HWRM command request type. */
27883         uint16_t        req_type;
27884         /*
27885          * The completion ring to send the completion event on. This should
27886          * be the NQ ID returned from the `nq_alloc` HWRM command.
27887          */
27888         uint16_t        cmpl_ring;
27889         /*
27890          * The sequence ID is used by the driver for tracking multiple
27891          * commands. This ID is treated as opaque data by the firmware and
27892          * the value is returned in the `hwrm_resp_hdr` upon completion.
27893          */
27894         uint16_t        seq_id;
27895         /*
27896          * The target ID of the command:
27897          * * 0x0-0xFFF8 - The function ID
27898          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27899          * * 0xFFFD - Reserved for user-space HWRM interface
27900          * * 0xFFFF - HWRM
27901          */
27902         uint16_t        target_id;
27903         /*
27904          * A physical address pointer pointing to a host buffer that the
27905          * command's response data will be written. This can be either a host
27906          * physical address (HPA) or a guest physical address (GPA) and must
27907          * point to a physically contiguous block of memory.
27908          */
27909         uint64_t        resp_addr;
27910 } __rte_packed;
27911
27912 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
27913 struct hwrm_ring_aggint_qcaps_output {
27914         /* The specific error status for the command. */
27915         uint16_t        error_code;
27916         /* The HWRM command request type. */
27917         uint16_t        req_type;
27918         /* The sequence ID from the original command. */
27919         uint16_t        seq_id;
27920         /* The length of the response data in number of bytes. */
27921         uint16_t        resp_len;
27922         uint32_t        cmpl_params;
27923         /*
27924          * When this bit is set to '1', int_lat_tmr_min can be configured
27925          * on completion rings.
27926          */
27927         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
27928                 UINT32_C(0x1)
27929         /*
27930          * When this bit is set to '1', int_lat_tmr_max can be configured
27931          * on completion rings.
27932          */
27933         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
27934                 UINT32_C(0x2)
27935         /*
27936          * When this bit is set to '1', timer_reset can be enabled
27937          * on completion rings.
27938          */
27939         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
27940                 UINT32_C(0x4)
27941         /*
27942          * When this bit is set to '1', ring_idle can be enabled
27943          * on completion rings.
27944          */
27945         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
27946                 UINT32_C(0x8)
27947         /*
27948          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
27949          * on completion rings.
27950          */
27951         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
27952                 UINT32_C(0x10)
27953         /*
27954          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
27955          * on completion rings.
27956          */
27957         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
27958                 UINT32_C(0x20)
27959         /*
27960          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
27961          * on completion rings.
27962          */
27963         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
27964                 UINT32_C(0x40)
27965         /*
27966          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
27967          * on completion rings.
27968          */
27969         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
27970                 UINT32_C(0x80)
27971         /*
27972          * When this bit is set to '1', num_cmpl_aggr_int can be configured
27973          * on completion rings.
27974          */
27975         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
27976                 UINT32_C(0x100)
27977         uint32_t        nq_params;
27978         /*
27979          * When this bit is set to '1', int_lat_tmr_min can be configured
27980          * on notification queues.
27981          */
27982         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
27983                 UINT32_C(0x1)
27984         /* Minimum value for num_cmpl_dma_aggr */
27985         uint16_t        num_cmpl_dma_aggr_min;
27986         /* Maximum value for num_cmpl_dma_aggr */
27987         uint16_t        num_cmpl_dma_aggr_max;
27988         /* Minimum value for num_cmpl_dma_aggr_during_int */
27989         uint16_t        num_cmpl_dma_aggr_during_int_min;
27990         /* Maximum value for num_cmpl_dma_aggr_during_int */
27991         uint16_t        num_cmpl_dma_aggr_during_int_max;
27992         /* Minimum value for cmpl_aggr_dma_tmr */
27993         uint16_t        cmpl_aggr_dma_tmr_min;
27994         /* Maximum value for cmpl_aggr_dma_tmr */
27995         uint16_t        cmpl_aggr_dma_tmr_max;
27996         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
27997         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
27998         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
27999         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
28000         /* Minimum value for int_lat_tmr_min */
28001         uint16_t        int_lat_tmr_min_min;
28002         /* Maximum value for int_lat_tmr_min */
28003         uint16_t        int_lat_tmr_min_max;
28004         /* Minimum value for int_lat_tmr_max */
28005         uint16_t        int_lat_tmr_max_min;
28006         /* Maximum value for int_lat_tmr_max */
28007         uint16_t        int_lat_tmr_max_max;
28008         /* Minimum value for num_cmpl_aggr_int */
28009         uint16_t        num_cmpl_aggr_int_min;
28010         /* Maximum value for num_cmpl_aggr_int */
28011         uint16_t        num_cmpl_aggr_int_max;
28012         /* The units for timer parameters, in nanoseconds. */
28013         uint16_t        timer_units;
28014         uint8_t unused_0[1];
28015         /*
28016          * This field is used in Output records to indicate that the output
28017          * is completely written to RAM.  This field should be read as '1'
28018          * to indicate that the output has been completely written.
28019          * When writing a command completion or response to an internal processor,
28020          * the order of writes has to be such that this field is written last.
28021          */
28022         uint8_t valid;
28023 } __rte_packed;
28024
28025 /**************************************
28026  * hwrm_ring_cmpl_ring_qaggint_params *
28027  **************************************/
28028
28029
28030 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
28031 struct hwrm_ring_cmpl_ring_qaggint_params_input {
28032         /* The HWRM command request type. */
28033         uint16_t        req_type;
28034         /*
28035          * The completion ring to send the completion event on. This should
28036          * be the NQ ID returned from the `nq_alloc` HWRM command.
28037          */
28038         uint16_t        cmpl_ring;
28039         /*
28040          * The sequence ID is used by the driver for tracking multiple
28041          * commands. This ID is treated as opaque data by the firmware and
28042          * the value is returned in the `hwrm_resp_hdr` upon completion.
28043          */
28044         uint16_t        seq_id;
28045         /*
28046          * The target ID of the command:
28047          * * 0x0-0xFFF8 - The function ID
28048          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28049          * * 0xFFFD - Reserved for user-space HWRM interface
28050          * * 0xFFFF - HWRM
28051          */
28052         uint16_t        target_id;
28053         /*
28054          * A physical address pointer pointing to a host buffer that the
28055          * command's response data will be written. This can be either a host
28056          * physical address (HPA) or a guest physical address (GPA) and must
28057          * point to a physically contiguous block of memory.
28058          */
28059         uint64_t        resp_addr;
28060         /* Physical number of completion ring. */
28061         uint16_t        ring_id;
28062         uint16_t        flags;
28063         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK \
28064                 UINT32_C(0x3)
28065         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0
28066         /*
28067          * Set this flag to 1 when querying parameters on a notification
28068          * queue. Set this flag to 0 when querying parameters on a
28069          * completion queue or completion ring.
28070          */
28071         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
28072                 UINT32_C(0x4)
28073         uint8_t unused_0[4];
28074 } __rte_packed;
28075
28076 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
28077 struct hwrm_ring_cmpl_ring_qaggint_params_output {
28078         /* The specific error status for the command. */
28079         uint16_t        error_code;
28080         /* The HWRM command request type. */
28081         uint16_t        req_type;
28082         /* The sequence ID from the original command. */
28083         uint16_t        seq_id;
28084         /* The length of the response data in number of bytes. */
28085         uint16_t        resp_len;
28086         uint16_t        flags;
28087         /*
28088          * When this bit is set to '1', interrupt max
28089          * timer is reset whenever a completion is received.
28090          */
28091         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
28092                 UINT32_C(0x1)
28093         /*
28094          * When this bit is set to '1', ring idle mode
28095          * aggregation will be enabled.
28096          */
28097         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
28098                 UINT32_C(0x2)
28099         /*
28100          * Number of completions to aggregate before DMA
28101          * during the normal mode.
28102          */
28103         uint16_t        num_cmpl_dma_aggr;
28104         /*
28105          * Number of completions to aggregate before DMA
28106          * during the interrupt mode.
28107          */
28108         uint16_t        num_cmpl_dma_aggr_during_int;
28109         /*
28110          * Timer used to aggregate completions before
28111          * DMA during the normal mode (not in interrupt mode).
28112          */
28113         uint16_t        cmpl_aggr_dma_tmr;
28114         /*
28115          * Timer used to aggregate completions before
28116          * DMA when in interrupt mode.
28117          */
28118         uint16_t        cmpl_aggr_dma_tmr_during_int;
28119         /* Minimum time between two interrupts. */
28120         uint16_t        int_lat_tmr_min;
28121         /*
28122          * Maximum wait time spent aggregating
28123          * completions before signaling the interrupt after the
28124          * interrupt is enabled.
28125          */
28126         uint16_t        int_lat_tmr_max;
28127         /*
28128          * Minimum number of completions aggregated before signaling
28129          * an interrupt.
28130          */
28131         uint16_t        num_cmpl_aggr_int;
28132         uint8_t unused_0[7];
28133         /*
28134          * This field is used in Output records to indicate that the output
28135          * is completely written to RAM.  This field should be read as '1'
28136          * to indicate that the output has been completely written.
28137          * When writing a command completion or response to an internal processor,
28138          * the order of writes has to be such that this field is written last.
28139          */
28140         uint8_t valid;
28141 } __rte_packed;
28142
28143 /*****************************************
28144  * hwrm_ring_cmpl_ring_cfg_aggint_params *
28145  *****************************************/
28146
28147
28148 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
28149 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
28150         /* The HWRM command request type. */
28151         uint16_t        req_type;
28152         /*
28153          * The completion ring to send the completion event on. This should
28154          * be the NQ ID returned from the `nq_alloc` HWRM command.
28155          */
28156         uint16_t        cmpl_ring;
28157         /*
28158          * The sequence ID is used by the driver for tracking multiple
28159          * commands. This ID is treated as opaque data by the firmware and
28160          * the value is returned in the `hwrm_resp_hdr` upon completion.
28161          */
28162         uint16_t        seq_id;
28163         /*
28164          * The target ID of the command:
28165          * * 0x0-0xFFF8 - The function ID
28166          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28167          * * 0xFFFD - Reserved for user-space HWRM interface
28168          * * 0xFFFF - HWRM
28169          */
28170         uint16_t        target_id;
28171         /*
28172          * A physical address pointer pointing to a host buffer that the
28173          * command's response data will be written. This can be either a host
28174          * physical address (HPA) or a guest physical address (GPA) and must
28175          * point to a physically contiguous block of memory.
28176          */
28177         uint64_t        resp_addr;
28178         /* Physical number of completion ring. */
28179         uint16_t        ring_id;
28180         uint16_t        flags;
28181         /*
28182          * When this bit is set to '1', interrupt latency max
28183          * timer is reset whenever a completion is received.
28184          */
28185         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
28186                 UINT32_C(0x1)
28187         /*
28188          * When this bit is set to '1', ring idle mode
28189          * aggregation will be enabled.
28190          */
28191         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
28192                 UINT32_C(0x2)
28193         /*
28194          * Set this flag to 1 when configuring parameters on a
28195          * notification queue. Set this flag to 0 when configuring
28196          * parameters on a completion queue or completion ring.
28197          */
28198         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
28199                 UINT32_C(0x4)
28200         /*
28201          * Number of completions to aggregate before DMA
28202          * during the normal mode.
28203          */
28204         uint16_t        num_cmpl_dma_aggr;
28205         /*
28206          * Number of completions to aggregate before DMA
28207          * during the interrupt mode.
28208          */
28209         uint16_t        num_cmpl_dma_aggr_during_int;
28210         /*
28211          * Timer used to aggregate completions before
28212          * DMA during the normal mode (not in interrupt mode).
28213          */
28214         uint16_t        cmpl_aggr_dma_tmr;
28215         /*
28216          * Timer used to aggregate completions before
28217          * DMA while in interrupt mode.
28218          */
28219         uint16_t        cmpl_aggr_dma_tmr_during_int;
28220         /* Minimum time between two interrupts. */
28221         uint16_t        int_lat_tmr_min;
28222         /*
28223          * Maximum wait time spent aggregating
28224          * completions before signaling the interrupt after the
28225          * interrupt is enabled.
28226          */
28227         uint16_t        int_lat_tmr_max;
28228         /*
28229          * Minimum number of completions aggregated before signaling
28230          * an interrupt.
28231          */
28232         uint16_t        num_cmpl_aggr_int;
28233         /*
28234          * Bitfield that indicates which parameters are to be applied. Only
28235          * required when configuring devices with notification queues, and
28236          * used in that case to set certain parameters on completion queues
28237          * and others on notification queues.
28238          */
28239         uint16_t        enables;
28240         /*
28241          * This bit must be '1' for the num_cmpl_dma_aggr field to be
28242          * configured.
28243          */
28244         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
28245                 UINT32_C(0x1)
28246         /*
28247          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
28248          * configured.
28249          */
28250         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
28251                 UINT32_C(0x2)
28252         /*
28253          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
28254          * configured.
28255          */
28256         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
28257                 UINT32_C(0x4)
28258         /*
28259          * This bit must be '1' for the int_lat_tmr_min field to be
28260          * configured.
28261          */
28262         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
28263                 UINT32_C(0x8)
28264         /*
28265          * This bit must be '1' for the int_lat_tmr_max field to be
28266          * configured.
28267          */
28268         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
28269                 UINT32_C(0x10)
28270         /*
28271          * This bit must be '1' for the num_cmpl_aggr_int field to be
28272          * configured.
28273          */
28274         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
28275                 UINT32_C(0x20)
28276         uint8_t unused_0[4];
28277 } __rte_packed;
28278
28279 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
28280 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
28281         /* The specific error status for the command. */
28282         uint16_t        error_code;
28283         /* The HWRM command request type. */
28284         uint16_t        req_type;
28285         /* The sequence ID from the original command. */
28286         uint16_t        seq_id;
28287         /* The length of the response data in number of bytes. */
28288         uint16_t        resp_len;
28289         uint8_t unused_0[7];
28290         /*
28291          * This field is used in Output records to indicate that the output
28292          * is completely written to RAM.  This field should be read as '1'
28293          * to indicate that the output has been completely written.
28294          * When writing a command completion or response to an internal processor,
28295          * the order of writes has to be such that this field is written last.
28296          */
28297         uint8_t valid;
28298 } __rte_packed;
28299
28300 /***********************
28301  * hwrm_ring_grp_alloc *
28302  ***********************/
28303
28304
28305 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
28306 struct hwrm_ring_grp_alloc_input {
28307         /* The HWRM command request type. */
28308         uint16_t        req_type;
28309         /*
28310          * The completion ring to send the completion event on. This should
28311          * be the NQ ID returned from the `nq_alloc` HWRM command.
28312          */
28313         uint16_t        cmpl_ring;
28314         /*
28315          * The sequence ID is used by the driver for tracking multiple
28316          * commands. This ID is treated as opaque data by the firmware and
28317          * the value is returned in the `hwrm_resp_hdr` upon completion.
28318          */
28319         uint16_t        seq_id;
28320         /*
28321          * The target ID of the command:
28322          * * 0x0-0xFFF8 - The function ID
28323          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28324          * * 0xFFFD - Reserved for user-space HWRM interface
28325          * * 0xFFFF - HWRM
28326          */
28327         uint16_t        target_id;
28328         /*
28329          * A physical address pointer pointing to a host buffer that the
28330          * command's response data will be written. This can be either a host
28331          * physical address (HPA) or a guest physical address (GPA) and must
28332          * point to a physically contiguous block of memory.
28333          */
28334         uint64_t        resp_addr;
28335         /*
28336          * This value identifies the CR associated with the ring
28337          * group.
28338          */
28339         uint16_t        cr;
28340         /*
28341          * This value identifies the main RR associated with the ring
28342          * group.
28343          */
28344         uint16_t        rr;
28345         /*
28346          * This value identifies the aggregation RR associated with
28347          * the ring group.  If this value is 0xFF... (All Fs), then no
28348          * Aggregation ring will be set.
28349          */
28350         uint16_t        ar;
28351         /*
28352          * This value identifies the statistics context associated
28353          * with the ring group.
28354          */
28355         uint16_t        sc;
28356 } __rte_packed;
28357
28358 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
28359 struct hwrm_ring_grp_alloc_output {
28360         /* The specific error status for the command. */
28361         uint16_t        error_code;
28362         /* The HWRM command request type. */
28363         uint16_t        req_type;
28364         /* The sequence ID from the original command. */
28365         uint16_t        seq_id;
28366         /* The length of the response data in number of bytes. */
28367         uint16_t        resp_len;
28368         /*
28369          * This is the ring group ID value.  Use this value to program
28370          * the default ring group for the VNIC or as table entries
28371          * in an RSS/COS context.
28372          */
28373         uint32_t        ring_group_id;
28374         uint8_t unused_0[3];
28375         /*
28376          * This field is used in Output records to indicate that the output
28377          * is completely written to RAM.  This field should be read as '1'
28378          * to indicate that the output has been completely written.
28379          * When writing a command completion or response to an internal processor,
28380          * the order of writes has to be such that this field is written last.
28381          */
28382         uint8_t valid;
28383 } __rte_packed;
28384
28385 /**********************
28386  * hwrm_ring_grp_free *
28387  **********************/
28388
28389
28390 /* hwrm_ring_grp_free_input (size:192b/24B) */
28391 struct hwrm_ring_grp_free_input {
28392         /* The HWRM command request type. */
28393         uint16_t        req_type;
28394         /*
28395          * The completion ring to send the completion event on. This should
28396          * be the NQ ID returned from the `nq_alloc` HWRM command.
28397          */
28398         uint16_t        cmpl_ring;
28399         /*
28400          * The sequence ID is used by the driver for tracking multiple
28401          * commands. This ID is treated as opaque data by the firmware and
28402          * the value is returned in the `hwrm_resp_hdr` upon completion.
28403          */
28404         uint16_t        seq_id;
28405         /*
28406          * The target ID of the command:
28407          * * 0x0-0xFFF8 - The function ID
28408          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28409          * * 0xFFFD - Reserved for user-space HWRM interface
28410          * * 0xFFFF - HWRM
28411          */
28412         uint16_t        target_id;
28413         /*
28414          * A physical address pointer pointing to a host buffer that the
28415          * command's response data will be written. This can be either a host
28416          * physical address (HPA) or a guest physical address (GPA) and must
28417          * point to a physically contiguous block of memory.
28418          */
28419         uint64_t        resp_addr;
28420         /* This is the ring group ID value. */
28421         uint32_t        ring_group_id;
28422         uint8_t unused_0[4];
28423 } __rte_packed;
28424
28425 /* hwrm_ring_grp_free_output (size:128b/16B) */
28426 struct hwrm_ring_grp_free_output {
28427         /* The specific error status for the command. */
28428         uint16_t        error_code;
28429         /* The HWRM command request type. */
28430         uint16_t        req_type;
28431         /* The sequence ID from the original command. */
28432         uint16_t        seq_id;
28433         /* The length of the response data in number of bytes. */
28434         uint16_t        resp_len;
28435         uint8_t unused_0[7];
28436         /*
28437          * This field is used in Output records to indicate that the output
28438          * is completely written to RAM.  This field should be read as '1'
28439          * to indicate that the output has been completely written.
28440          * When writing a command completion or response to an internal processor,
28441          * the order of writes has to be such that this field is written last.
28442          */
28443         uint8_t valid;
28444 } __rte_packed;
28445
28446 /************************
28447  * hwrm_ring_schq_alloc *
28448  ************************/
28449
28450
28451 /* hwrm_ring_schq_alloc_input (size:1088b/136B) */
28452 struct hwrm_ring_schq_alloc_input {
28453         /* The HWRM command request type. */
28454         uint16_t        req_type;
28455         /*
28456          * The completion ring to send the completion event on. This should
28457          * be the NQ ID returned from the `nq_alloc` HWRM command.
28458          */
28459         uint16_t        cmpl_ring;
28460         /*
28461          * The sequence ID is used by the driver for tracking multiple
28462          * commands. This ID is treated as opaque data by the firmware and
28463          * the value is returned in the `hwrm_resp_hdr` upon completion.
28464          */
28465         uint16_t        seq_id;
28466         /*
28467          * The target ID of the command:
28468          * * 0x0-0xFFF8 - The function ID
28469          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28470          * * 0xFFFD - Reserved for user-space HWRM interface
28471          * * 0xFFFF - HWRM
28472          */
28473         uint16_t        target_id;
28474         /*
28475          * A physical address pointer pointing to a host buffer that the
28476          * command's response data will be written. This can be either a host
28477          * physical address (HPA) or a guest physical address (GPA) and must
28478          * point to a physically contiguous block of memory.
28479          */
28480         uint64_t        resp_addr;
28481         uint32_t        enables;
28482         /*
28483          * This bit must be '1' for the tqm_ring0 fields to be
28484          * configured.
28485          */
28486         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING0     UINT32_C(0x1)
28487         /*
28488          * This bit must be '1' for the tqm_ring1 fields to be
28489          * configured.
28490          */
28491         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING1     UINT32_C(0x2)
28492         /*
28493          * This bit must be '1' for the tqm_ring2 fields to be
28494          * configured.
28495          */
28496         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING2     UINT32_C(0x4)
28497         /*
28498          * This bit must be '1' for the tqm_ring3 fields to be
28499          * configured.
28500          */
28501         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING3     UINT32_C(0x8)
28502         /*
28503          * This bit must be '1' for the tqm_ring4 fields to be
28504          * configured.
28505          */
28506         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING4     UINT32_C(0x10)
28507         /*
28508          * This bit must be '1' for the tqm_ring5 fields to be
28509          * configured.
28510          */
28511         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING5     UINT32_C(0x20)
28512         /*
28513          * This bit must be '1' for the tqm_ring6 fields to be
28514          * configured.
28515          */
28516         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING6     UINT32_C(0x40)
28517         /*
28518          * This bit must be '1' for the tqm_ring7 fields to be
28519          * configured.
28520          */
28521         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING7     UINT32_C(0x80)
28522         /* Reserved for future use. */
28523         uint32_t        reserved;
28524         /* TQM ring 0 page size and level. */
28525         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
28526         /* TQM ring 0 PBL indirect levels. */
28527         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_MASK \
28528                 UINT32_C(0xf)
28529         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_SFT       0
28530         /* PBL pointer is physical start address. */
28531         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_0 \
28532                 UINT32_C(0x0)
28533         /* PBL pointer points to PTE table. */
28534         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_1 \
28535                 UINT32_C(0x1)
28536         /*
28537          * PBL pointer points to PDE table with each entry pointing to PTE
28538          * tables.
28539          */
28540         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2 \
28541                 UINT32_C(0x2)
28542         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LAST \
28543                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2
28544         /* TQM ring 0 page size. */
28545         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_MASK \
28546                 UINT32_C(0xf0)
28547         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_SFT   4
28548         /* 4KB. */
28549         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_4K \
28550                 (UINT32_C(0x0) << 4)
28551         /* 8KB. */
28552         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8K \
28553                 (UINT32_C(0x1) << 4)
28554         /* 64KB. */
28555         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_64K \
28556                 (UINT32_C(0x2) << 4)
28557         /* 2MB. */
28558         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_2M \
28559                 (UINT32_C(0x3) << 4)
28560         /* 8MB. */
28561         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8M \
28562                 (UINT32_C(0x4) << 4)
28563         /* 1GB. */
28564         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G \
28565                 (UINT32_C(0x5) << 4)
28566         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_LAST \
28567                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G
28568         /* TQM ring 1 page size and level. */
28569         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
28570         /* TQM ring 1 PBL indirect levels. */
28571         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_MASK \
28572                 UINT32_C(0xf)
28573         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_SFT       0
28574         /* PBL pointer is physical start address. */
28575         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_0 \
28576                 UINT32_C(0x0)
28577         /* PBL pointer points to PTE table. */
28578         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_1 \
28579                 UINT32_C(0x1)
28580         /*
28581          * PBL pointer points to PDE table with each entry pointing to PTE
28582          * tables.
28583          */
28584         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2 \
28585                 UINT32_C(0x2)
28586         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LAST \
28587                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2
28588         /* TQM ring 1 page size. */
28589         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_MASK \
28590                 UINT32_C(0xf0)
28591         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_SFT   4
28592         /* 4KB. */
28593         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_4K \
28594                 (UINT32_C(0x0) << 4)
28595         /* 8KB. */
28596         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8K \
28597                 (UINT32_C(0x1) << 4)
28598         /* 64KB. */
28599         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_64K \
28600                 (UINT32_C(0x2) << 4)
28601         /* 2MB. */
28602         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_2M \
28603                 (UINT32_C(0x3) << 4)
28604         /* 8MB. */
28605         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8M \
28606                 (UINT32_C(0x4) << 4)
28607         /* 1GB. */
28608         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G \
28609                 (UINT32_C(0x5) << 4)
28610         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_LAST \
28611                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G
28612         /* TQM ring 2 page size and level. */
28613         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
28614         /* TQM ring 2 PBL indirect levels. */
28615         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_MASK \
28616                 UINT32_C(0xf)
28617         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_SFT       0
28618         /* PBL pointer is physical start address. */
28619         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_0 \
28620                 UINT32_C(0x0)
28621         /* PBL pointer points to PTE table. */
28622         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_1 \
28623                 UINT32_C(0x1)
28624         /*
28625          * PBL pointer points to PDE table with each entry pointing to PTE
28626          * tables.
28627          */
28628         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2 \
28629                 UINT32_C(0x2)
28630         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LAST \
28631                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2
28632         /* TQM ring 2 page size. */
28633         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_MASK \
28634                 UINT32_C(0xf0)
28635         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_SFT   4
28636         /* 4KB. */
28637         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_4K \
28638                 (UINT32_C(0x0) << 4)
28639         /* 8KB. */
28640         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8K \
28641                 (UINT32_C(0x1) << 4)
28642         /* 64KB. */
28643         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_64K \
28644                 (UINT32_C(0x2) << 4)
28645         /* 2MB. */
28646         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_2M \
28647                 (UINT32_C(0x3) << 4)
28648         /* 8MB. */
28649         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8M \
28650                 (UINT32_C(0x4) << 4)
28651         /* 1GB. */
28652         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G \
28653                 (UINT32_C(0x5) << 4)
28654         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_LAST \
28655                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G
28656         /* TQM ring 3 page size and level. */
28657         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
28658         /* TQM ring 3 PBL indirect levels. */
28659         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_MASK \
28660                 UINT32_C(0xf)
28661         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_SFT       0
28662         /* PBL pointer is physical start address. */
28663         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_0 \
28664                 UINT32_C(0x0)
28665         /* PBL pointer points to PTE table. */
28666         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_1 \
28667                 UINT32_C(0x1)
28668         /*
28669          * PBL pointer points to PDE table with each entry pointing to PTE
28670          * tables.
28671          */
28672         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2 \
28673                 UINT32_C(0x2)
28674         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LAST \
28675                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2
28676         /* TQM ring 3 page size. */
28677         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_MASK \
28678                 UINT32_C(0xf0)
28679         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_SFT   4
28680         /* 4KB. */
28681         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_4K \
28682                 (UINT32_C(0x0) << 4)
28683         /* 8KB. */
28684         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8K \
28685                 (UINT32_C(0x1) << 4)
28686         /* 64KB. */
28687         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_64K \
28688                 (UINT32_C(0x2) << 4)
28689         /* 2MB. */
28690         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_2M \
28691                 (UINT32_C(0x3) << 4)
28692         /* 8MB. */
28693         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8M \
28694                 (UINT32_C(0x4) << 4)
28695         /* 1GB. */
28696         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G \
28697                 (UINT32_C(0x5) << 4)
28698         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_LAST \
28699                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G
28700         /* TQM ring 4 page size and level. */
28701         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
28702         /* TQM ring 4 PBL indirect levels. */
28703         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_MASK \
28704                 UINT32_C(0xf)
28705         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_SFT       0
28706         /* PBL pointer is physical start address. */
28707         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_0 \
28708                 UINT32_C(0x0)
28709         /* PBL pointer points to PTE table. */
28710         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_1 \
28711                 UINT32_C(0x1)
28712         /*
28713          * PBL pointer points to PDE table with each entry pointing to PTE
28714          * tables.
28715          */
28716         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2 \
28717                 UINT32_C(0x2)
28718         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LAST \
28719                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2
28720         /* TQM ring 4 page size. */
28721         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_MASK \
28722                 UINT32_C(0xf0)
28723         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_SFT   4
28724         /* 4KB. */
28725         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_4K \
28726                 (UINT32_C(0x0) << 4)
28727         /* 8KB. */
28728         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8K \
28729                 (UINT32_C(0x1) << 4)
28730         /* 64KB. */
28731         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_64K \
28732                 (UINT32_C(0x2) << 4)
28733         /* 2MB. */
28734         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_2M \
28735                 (UINT32_C(0x3) << 4)
28736         /* 8MB. */
28737         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8M \
28738                 (UINT32_C(0x4) << 4)
28739         /* 1GB. */
28740         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G \
28741                 (UINT32_C(0x5) << 4)
28742         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_LAST \
28743                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G
28744         /* TQM ring 5 page size and level. */
28745         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
28746         /* TQM ring 5 PBL indirect levels. */
28747         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_MASK \
28748                 UINT32_C(0xf)
28749         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_SFT       0
28750         /* PBL pointer is physical start address. */
28751         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_0 \
28752                 UINT32_C(0x0)
28753         /* PBL pointer points to PTE table. */
28754         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_1 \
28755                 UINT32_C(0x1)
28756         /*
28757          * PBL pointer points to PDE table with each entry pointing to PTE
28758          * tables.
28759          */
28760         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2 \
28761                 UINT32_C(0x2)
28762         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LAST \
28763                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2
28764         /* TQM ring 5 page size. */
28765         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_MASK \
28766                 UINT32_C(0xf0)
28767         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_SFT   4
28768         /* 4KB. */
28769         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_4K \
28770                 (UINT32_C(0x0) << 4)
28771         /* 8KB. */
28772         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8K \
28773                 (UINT32_C(0x1) << 4)
28774         /* 64KB. */
28775         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_64K \
28776                 (UINT32_C(0x2) << 4)
28777         /* 2MB. */
28778         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_2M \
28779                 (UINT32_C(0x3) << 4)
28780         /* 8MB. */
28781         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8M \
28782                 (UINT32_C(0x4) << 4)
28783         /* 1GB. */
28784         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G \
28785                 (UINT32_C(0x5) << 4)
28786         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_LAST \
28787                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G
28788         /* TQM ring 6 page size and level. */
28789         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
28790         /* TQM ring 6 PBL indirect levels. */
28791         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_MASK \
28792                 UINT32_C(0xf)
28793         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_SFT       0
28794         /* PBL pointer is physical start address. */
28795         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_0 \
28796                 UINT32_C(0x0)
28797         /* PBL pointer points to PTE table. */
28798         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_1 \
28799                 UINT32_C(0x1)
28800         /*
28801          * PBL pointer points to PDE table with each entry pointing to PTE
28802          * tables.
28803          */
28804         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2 \
28805                 UINT32_C(0x2)
28806         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LAST \
28807                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2
28808         /* TQM ring 6 page size. */
28809         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_MASK \
28810                 UINT32_C(0xf0)
28811         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_SFT   4
28812         /* 4KB. */
28813         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_4K \
28814                 (UINT32_C(0x0) << 4)
28815         /* 8KB. */
28816         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8K \
28817                 (UINT32_C(0x1) << 4)
28818         /* 64KB. */
28819         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_64K \
28820                 (UINT32_C(0x2) << 4)
28821         /* 2MB. */
28822         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_2M \
28823                 (UINT32_C(0x3) << 4)
28824         /* 8MB. */
28825         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8M \
28826                 (UINT32_C(0x4) << 4)
28827         /* 1GB. */
28828         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G \
28829                 (UINT32_C(0x5) << 4)
28830         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_LAST \
28831                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G
28832         /* TQM ring 7 page size and level. */
28833         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
28834         /* TQM ring 7 PBL indirect levels. */
28835         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_MASK \
28836                 UINT32_C(0xf)
28837         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_SFT       0
28838         /* PBL pointer is physical start address. */
28839         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_0 \
28840                 UINT32_C(0x0)
28841         /* PBL pointer points to PTE table. */
28842         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_1 \
28843                 UINT32_C(0x1)
28844         /*
28845          * PBL pointer points to PDE table with each entry pointing to PTE
28846          * tables.
28847          */
28848         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2 \
28849                 UINT32_C(0x2)
28850         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LAST \
28851                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2
28852         /* TQM ring 7 page size. */
28853         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_MASK \
28854                 UINT32_C(0xf0)
28855         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_SFT   4
28856         /* 4KB. */
28857         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_4K \
28858                 (UINT32_C(0x0) << 4)
28859         /* 8KB. */
28860         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8K \
28861                 (UINT32_C(0x1) << 4)
28862         /* 64KB. */
28863         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_64K \
28864                 (UINT32_C(0x2) << 4)
28865         /* 2MB. */
28866         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_2M \
28867                 (UINT32_C(0x3) << 4)
28868         /* 8MB. */
28869         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8M \
28870                 (UINT32_C(0x4) << 4)
28871         /* 1GB. */
28872         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G \
28873                 (UINT32_C(0x5) << 4)
28874         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_LAST \
28875                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G
28876         /* TQM ring 0 page directory. */
28877         uint64_t        tqm_ring0_page_dir;
28878         /* TQM ring 1 page directory. */
28879         uint64_t        tqm_ring1_page_dir;
28880         /* TQM ring 2 page directory. */
28881         uint64_t        tqm_ring2_page_dir;
28882         /* TQM ring 3 page directory. */
28883         uint64_t        tqm_ring3_page_dir;
28884         /* TQM ring 4 page directory. */
28885         uint64_t        tqm_ring4_page_dir;
28886         /* TQM ring 5 page directory. */
28887         uint64_t        tqm_ring5_page_dir;
28888         /* TQM ring 6 page directory. */
28889         uint64_t        tqm_ring6_page_dir;
28890         /* TQM ring 7 page directory. */
28891         uint64_t        tqm_ring7_page_dir;
28892         /*
28893          * Number of TQM ring 0 entries.
28894          *
28895          * TQM fastpath rings should be sized large enough to accommodate the
28896          * maximum number of QPs (either L2 or RoCE, or both if shared)
28897          * that can be enqueued to the TQM ring.
28898          *
28899          * Note that TQM ring sizes cannot be extended while the system is
28900          * operational. If a PF driver needs to extend a TQM ring, it needs
28901          * to delete the SCHQ and then reallocate it.
28902          */
28903         uint32_t        tqm_ring0_num_entries;
28904         /*
28905          * Number of TQM ring 1 entries.
28906          *
28907          * TQM fastpath rings should be sized large enough to accommodate the
28908          * maximum number of QPs (either L2 or RoCE, or both if shared)
28909          * that can be enqueued to the TQM ring.
28910          *
28911          * Note that TQM ring sizes cannot be extended while the system is
28912          * operational. If a PF driver needs to extend a TQM ring, it needs
28913          * to delete the SCHQ and then reallocate it.
28914          */
28915         uint32_t        tqm_ring1_num_entries;
28916         /*
28917          * Number of TQM ring 2 entries.
28918          *
28919          * TQM fastpath rings should be sized large enough to accommodate the
28920          * maximum number of QPs (either L2 or RoCE, or both if shared)
28921          * that can be enqueued to the TQM ring.
28922          *
28923          * Note that TQM ring sizes cannot be extended while the system is
28924          * operational. If a PF driver needs to extend a TQM ring, it needs
28925          * to delete the SCHQ and then reallocate it.
28926          */
28927         uint32_t        tqm_ring2_num_entries;
28928         /*
28929          * Number of TQM ring 3 entries.
28930          *
28931          * TQM fastpath rings should be sized large enough to accommodate the
28932          * maximum number of QPs (either L2 or RoCE, or both if shared)
28933          * that can be enqueued to the TQM ring.
28934          *
28935          * Note that TQM ring sizes cannot be extended while the system is
28936          * operational. If a PF driver needs to extend a TQM ring, it needs
28937          * to delete the SCHQ and then reallocate it.
28938          */
28939         uint32_t        tqm_ring3_num_entries;
28940         /*
28941          * Number of TQM ring 4 entries.
28942          *
28943          * TQM fastpath rings should be sized large enough to accommodate the
28944          * maximum number of QPs (either L2 or RoCE, or both if shared)
28945          * that can be enqueued to the TQM ring.
28946          *
28947          * Note that TQM ring sizes cannot be extended while the system is
28948          * operational. If a PF driver needs to extend a TQM ring, it needs
28949          * to delete the SCHQ and then reallocate it.
28950          */
28951         uint32_t        tqm_ring4_num_entries;
28952         /*
28953          * Number of TQM ring 5 entries.
28954          *
28955          * TQM fastpath rings should be sized large enough to accommodate the
28956          * maximum number of QPs (either L2 or RoCE, or both if shared)
28957          * that can be enqueued to the TQM ring.
28958          *
28959          * Note that TQM ring sizes cannot be extended while the system is
28960          * operational. If a PF driver needs to extend a TQM ring, it needs
28961          * to delete the SCHQ and then reallocate it.
28962          */
28963         uint32_t        tqm_ring5_num_entries;
28964         /*
28965          * Number of TQM ring 6 entries.
28966          *
28967          * TQM fastpath rings should be sized large enough to accommodate the
28968          * maximum number of QPs (either L2 or RoCE, or both if shared)
28969          * that can be enqueued to the TQM ring.
28970          *
28971          * Note that TQM ring sizes cannot be extended while the system is
28972          * operational. If a PF driver needs to extend a TQM ring, it needs
28973          * to delete the SCHQ and then reallocate it.
28974          */
28975         uint32_t        tqm_ring6_num_entries;
28976         /*
28977          * Number of TQM ring 7 entries.
28978          *
28979          * TQM fastpath rings should be sized large enough to accommodate the
28980          * maximum number of QPs (either L2 or RoCE, or both if shared)
28981          * that can be enqueued to the TQM ring.
28982          *
28983          * Note that TQM ring sizes cannot be extended while the system is
28984          * operational. If a PF driver needs to extend a TQM ring, it needs
28985          * to delete the SCHQ and then reallocate it.
28986          */
28987         uint32_t        tqm_ring7_num_entries;
28988         /* Number of bytes that have been allocated for each context entry. */
28989         uint16_t        tqm_entry_size;
28990         uint8_t unused_0[6];
28991 } __rte_packed;
28992
28993 /* hwrm_ring_schq_alloc_output (size:128b/16B) */
28994 struct hwrm_ring_schq_alloc_output {
28995         /* The specific error status for the command. */
28996         uint16_t        error_code;
28997         /* The HWRM command request type. */
28998         uint16_t        req_type;
28999         /* The sequence ID from the original command. */
29000         uint16_t        seq_id;
29001         /* The length of the response data in number of bytes. */
29002         uint16_t        resp_len;
29003         /*
29004          * This is an identifier for the SCHQ to be used in other HWRM commands
29005          * that need to reference this SCHQ. This value is greater than zero
29006          * (i.e. a schq_id of zero references the default SCHQ).
29007          */
29008         uint16_t        schq_id;
29009         uint8_t unused_0[5];
29010         /*
29011          * This field is used in Output records to indicate that the output
29012          * is completely written to RAM.  This field should be read as '1'
29013          * to indicate that the output has been completely written.
29014          * When writing a command completion or response to an internal processor,
29015          * the order of writes has to be such that this field is written last.
29016          */
29017         uint8_t valid;
29018 } __rte_packed;
29019
29020 /**********************
29021  * hwrm_ring_schq_cfg *
29022  **********************/
29023
29024
29025 /* hwrm_ring_schq_cfg_input (size:768b/96B) */
29026 struct hwrm_ring_schq_cfg_input {
29027         /* The HWRM command request type. */
29028         uint16_t        req_type;
29029         /*
29030          * The completion ring to send the completion event on. This should
29031          * be the NQ ID returned from the `nq_alloc` HWRM command.
29032          */
29033         uint16_t        cmpl_ring;
29034         /*
29035          * The sequence ID is used by the driver for tracking multiple
29036          * commands. This ID is treated as opaque data by the firmware and
29037          * the value is returned in the `hwrm_resp_hdr` upon completion.
29038          */
29039         uint16_t        seq_id;
29040         /*
29041          * The target ID of the command:
29042          * * 0x0-0xFFF8 - The function ID
29043          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29044          * * 0xFFFD - Reserved for user-space HWRM interface
29045          * * 0xFFFF - HWRM
29046          */
29047         uint16_t        target_id;
29048         /*
29049          * A physical address pointer pointing to a host buffer that the
29050          * command's response data will be written. This can be either a host
29051          * physical address (HPA) or a guest physical address (GPA) and must
29052          * point to a physically contiguous block of memory.
29053          */
29054         uint64_t        resp_addr;
29055         /*
29056          * Identifies the SCHQ being configured. A schq_id of zero refers to
29057          * the default SCHQ.
29058          */
29059         uint16_t        schq_id;
29060         /*
29061          * This field is an 8 bit bitmap that indicates which TCs are enabled
29062          * in this SCHQ. Bit 0 represents traffic class 0 and bit 7 represents
29063          * traffic class 7.
29064          */
29065         uint8_t tc_enabled;
29066         uint8_t unused_0;
29067         uint32_t        flags;
29068         /* The tc_max_bw array and the max_bw parameters are valid */
29069         #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MAX_BW_ENABLED \
29070                 UINT32_C(0x1)
29071         /* The tc_min_bw array is valid */
29072         #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MIN_BW_ENABLED \
29073                 UINT32_C(0x2)
29074         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29075         uint32_t        max_bw_tc0;
29076         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29077         uint32_t        max_bw_tc1;
29078         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29079         uint32_t        max_bw_tc2;
29080         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29081         uint32_t        max_bw_tc3;
29082         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29083         uint32_t        max_bw_tc4;
29084         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29085         uint32_t        max_bw_tc5;
29086         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29087         uint32_t        max_bw_tc6;
29088         /* Maximum bandwidth of the traffic class, specified in Mbps. */
29089         uint32_t        max_bw_tc7;
29090         /*
29091          * Bandwidth reservation for the traffic class, specified in Mbps.
29092          * A value of zero signifies that traffic belonging to this class
29093          * shares the bandwidth reservation for the same traffic class of
29094          * the default SCHQ.
29095          */
29096         uint32_t        min_bw_tc0;
29097         /*
29098          * Bandwidth reservation for the traffic class, specified in Mbps.
29099          * A value of zero signifies that traffic belonging to this class
29100          * shares the bandwidth reservation for the same traffic class of
29101          * the default SCHQ.
29102          */
29103         uint32_t        min_bw_tc1;
29104         /*
29105          * Bandwidth reservation for the traffic class, specified in Mbps.
29106          * A value of zero signifies that traffic belonging to this class
29107          * shares the bandwidth reservation for the same traffic class of
29108          * the default SCHQ.
29109          */
29110         uint32_t        min_bw_tc2;
29111         /*
29112          * Bandwidth reservation for the traffic class, specified in Mbps.
29113          * A value of zero signifies that traffic belonging to this class
29114          * shares the bandwidth reservation for the same traffic class of
29115          * the default SCHQ.
29116          */
29117         uint32_t        min_bw_tc3;
29118         /*
29119          * Bandwidth reservation for the traffic class, specified in Mbps.
29120          * A value of zero signifies that traffic belonging to this class
29121          * shares the bandwidth reservation for the same traffic class of
29122          * the default SCHQ.
29123          */
29124         uint32_t        min_bw_tc4;
29125         /*
29126          * Bandwidth reservation for the traffic class, specified in Mbps.
29127          * A value of zero signifies that traffic belonging to this class
29128          * shares the bandwidth reservation for the same traffic class of
29129          * the default SCHQ.
29130          */
29131         uint32_t        min_bw_tc5;
29132         /*
29133          * Bandwidth reservation for the traffic class, specified in Mbps.
29134          * A value of zero signifies that traffic belonging to this class
29135          * shares the bandwidth reservation for the same traffic class of
29136          * the default SCHQ.
29137          */
29138         uint32_t        min_bw_tc6;
29139         /*
29140          * Bandwidth reservation for the traffic class, specified in Mbps.
29141          * A value of zero signifies that traffic belonging to this class
29142          * shares the bandwidth reservation for the same traffic class of
29143          * the default SCHQ.
29144          */
29145         uint32_t        min_bw_tc7;
29146         /*
29147          * Indicates the max bandwidth for all enabled traffic classes in
29148          * this SCHQ, specified in Mbps.
29149          */
29150         uint32_t        max_bw;
29151         uint8_t unused_1[4];
29152 } __rte_packed;
29153
29154 /* hwrm_ring_schq_cfg_output (size:128b/16B) */
29155 struct hwrm_ring_schq_cfg_output {
29156         /* The specific error status for the command. */
29157         uint16_t        error_code;
29158         /* The HWRM command request type. */
29159         uint16_t        req_type;
29160         /* The sequence ID from the original command. */
29161         uint16_t        seq_id;
29162         /* The length of the response data in number of bytes. */
29163         uint16_t        resp_len;
29164         uint8_t unused_0[7];
29165         /*
29166          * This field is used in Output records to indicate that the output
29167          * is completely written to RAM.  This field should be read as '1'
29168          * to indicate that the output has been completely written.
29169          * When writing a command completion or response to an internal processor,
29170          * the order of writes has to be such that this field is written last.
29171          */
29172         uint8_t valid;
29173 } __rte_packed;
29174
29175 /***********************
29176  * hwrm_ring_schq_free *
29177  ***********************/
29178
29179
29180 /* hwrm_ring_schq_free_input (size:192b/24B) */
29181 struct hwrm_ring_schq_free_input {
29182         /* The HWRM command request type. */
29183         uint16_t        req_type;
29184         /*
29185          * The completion ring to send the completion event on. This should
29186          * be the NQ ID returned from the `nq_alloc` HWRM command.
29187          */
29188         uint16_t        cmpl_ring;
29189         /*
29190          * The sequence ID is used by the driver for tracking multiple
29191          * commands. This ID is treated as opaque data by the firmware and
29192          * the value is returned in the `hwrm_resp_hdr` upon completion.
29193          */
29194         uint16_t        seq_id;
29195         /*
29196          * The target ID of the command:
29197          * * 0x0-0xFFF8 - The function ID
29198          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29199          * * 0xFFFD - Reserved for user-space HWRM interface
29200          * * 0xFFFF - HWRM
29201          */
29202         uint16_t        target_id;
29203         /*
29204          * A physical address pointer pointing to a host buffer that the
29205          * command's response data will be written. This can be either a host
29206          * physical address (HPA) or a guest physical address (GPA) and must
29207          * point to a physically contiguous block of memory.
29208          */
29209         uint64_t        resp_addr;
29210         /* Identifies the SCHQ being freed. */
29211         uint16_t        schq_id;
29212         uint8_t unused_0[6];
29213 } __rte_packed;
29214
29215 /* hwrm_ring_schq_free_output (size:128b/16B) */
29216 struct hwrm_ring_schq_free_output {
29217         /* The specific error status for the command. */
29218         uint16_t        error_code;
29219         /* The HWRM command request type. */
29220         uint16_t        req_type;
29221         /* The sequence ID from the original command. */
29222         uint16_t        seq_id;
29223         /* The length of the response data in number of bytes. */
29224         uint16_t        resp_len;
29225         uint8_t unused_0[7];
29226         /*
29227          * This field is used in Output records to indicate that the output
29228          * is completely written to RAM.  This field should be read as '1'
29229          * to indicate that the output has been completely written.
29230          * When writing a command completion or response to an internal processor,
29231          * the order of writes has to be such that this field is written last.
29232          */
29233         uint8_t valid;
29234 } __rte_packed;
29235 /*
29236  * special reserved flow ID to identify per function default
29237  * flows for vSwitch offload
29238  */
29239 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
29240 /*
29241  * special reserved flow ID to identify per function RoCEv1
29242  * flows
29243  */
29244 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
29245 /*
29246  * special reserved flow ID to identify per function RoCEv2
29247  * flows
29248  */
29249 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
29250 /*
29251  * special reserved flow ID to identify per function RoCEv2
29252  * CNP flows
29253  */
29254 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
29255
29256 /****************************
29257  * hwrm_cfa_l2_filter_alloc *
29258  ****************************/
29259
29260
29261 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
29262 struct hwrm_cfa_l2_filter_alloc_input {
29263         /* The HWRM command request type. */
29264         uint16_t        req_type;
29265         /*
29266          * The completion ring to send the completion event on. This should
29267          * be the NQ ID returned from the `nq_alloc` HWRM command.
29268          */
29269         uint16_t        cmpl_ring;
29270         /*
29271          * The sequence ID is used by the driver for tracking multiple
29272          * commands. This ID is treated as opaque data by the firmware and
29273          * the value is returned in the `hwrm_resp_hdr` upon completion.
29274          */
29275         uint16_t        seq_id;
29276         /*
29277          * The target ID of the command:
29278          * * 0x0-0xFFF8 - The function ID
29279          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29280          * * 0xFFFD - Reserved for user-space HWRM interface
29281          * * 0xFFFF - HWRM
29282          */
29283         uint16_t        target_id;
29284         /*
29285          * A physical address pointer pointing to a host buffer that the
29286          * command's response data will be written. This can be either a host
29287          * physical address (HPA) or a guest physical address (GPA) and must
29288          * point to a physically contiguous block of memory.
29289          */
29290         uint64_t        resp_addr;
29291         uint32_t        flags;
29292         /*
29293          * Enumeration denoting the RX, TX type of the resource.
29294          * This enumeration is used for resources that are similar for both
29295          * TX and RX paths of the chip.
29296          */
29297         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
29298                 UINT32_C(0x1)
29299         /* tx path */
29300         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
29301                 UINT32_C(0x0)
29302         /* rx path */
29303         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
29304                 UINT32_C(0x1)
29305         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
29306                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
29307         /* Setting of this flag indicates the applicability to the loopback path. */
29308         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
29309                 UINT32_C(0x2)
29310         /*
29311          * Setting of this flag indicates drop action. If this flag is not set,
29312          * then it should be considered accept action.
29313          */
29314         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
29315                 UINT32_C(0x4)
29316         /*
29317          * If this flag is set, all t_l2_* fields are invalid
29318          * and they should not be specified.
29319          * If this flag is set, then l2_* fields refer to
29320          * fields of outermost L2 header.
29321          */
29322         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
29323                 UINT32_C(0x8)
29324         /*
29325          * Enumeration denoting NO_ROCE_L2 to support old drivers.
29326          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
29327          */
29328         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
29329                 UINT32_C(0x30)
29330         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
29331         /* To support old drivers */
29332         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
29333                 (UINT32_C(0x0) << 4)
29334         /* Only L2 traffic */
29335         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
29336                 (UINT32_C(0x1) << 4)
29337         /* Roce & L2 traffic */
29338         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
29339                 (UINT32_C(0x2) << 4)
29340         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
29341                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
29342         /*
29343          * Setting of this flag indicates that no XDP filter is created with
29344          * L2 filter.
29345          * 0 - legacy behavior, XDP filter is created with L2 filter
29346          * 1 - XDP filter won't be created with L2 filter
29347          */
29348         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE \
29349                 UINT32_C(0x40)
29350         /*
29351          * Setting this flag to 1 indicate the L2 fields in this command
29352          * pertain to source fields. Setting this flag to 0 indicate the
29353          * L2 fields in this command pertain to the destination fields
29354          * and this is the default/legacy behavior.
29355          */
29356         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID \
29357                 UINT32_C(0x80)
29358         uint32_t        enables;
29359         /*
29360          * This bit must be '1' for the l2_addr field to be
29361          * configured.
29362          */
29363         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
29364                 UINT32_C(0x1)
29365         /*
29366          * This bit must be '1' for the l2_addr_mask field to be
29367          * configured.
29368          */
29369         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
29370                 UINT32_C(0x2)
29371         /*
29372          * This bit must be '1' for the l2_ovlan field to be
29373          * configured.
29374          */
29375         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
29376                 UINT32_C(0x4)
29377         /*
29378          * This bit must be '1' for the l2_ovlan_mask field to be
29379          * configured.
29380          */
29381         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
29382                 UINT32_C(0x8)
29383         /*
29384          * This bit must be '1' for the l2_ivlan field to be
29385          * configured.
29386          */
29387         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
29388                 UINT32_C(0x10)
29389         /*
29390          * This bit must be '1' for the l2_ivlan_mask field to be
29391          * configured.
29392          */
29393         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
29394                 UINT32_C(0x20)
29395         /*
29396          * This bit must be '1' for the t_l2_addr field to be
29397          * configured.
29398          */
29399         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
29400                 UINT32_C(0x40)
29401         /*
29402          * This bit must be '1' for the t_l2_addr_mask field to be
29403          * configured.
29404          */
29405         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
29406                 UINT32_C(0x80)
29407         /*
29408          * This bit must be '1' for the t_l2_ovlan field to be
29409          * configured.
29410          */
29411         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
29412                 UINT32_C(0x100)
29413         /*
29414          * This bit must be '1' for the t_l2_ovlan_mask field to be
29415          * configured.
29416          */
29417         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
29418                 UINT32_C(0x200)
29419         /*
29420          * This bit must be '1' for the t_l2_ivlan field to be
29421          * configured.
29422          */
29423         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
29424                 UINT32_C(0x400)
29425         /*
29426          * This bit must be '1' for the t_l2_ivlan_mask field to be
29427          * configured.
29428          */
29429         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
29430                 UINT32_C(0x800)
29431         /*
29432          * This bit must be '1' for the src_type field to be
29433          * configured.
29434          */
29435         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
29436                 UINT32_C(0x1000)
29437         /*
29438          * This bit must be '1' for the src_id field to be
29439          * configured.
29440          */
29441         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
29442                 UINT32_C(0x2000)
29443         /*
29444          * This bit must be '1' for the tunnel_type field to be
29445          * configured.
29446          */
29447         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
29448                 UINT32_C(0x4000)
29449         /*
29450          * This bit must be '1' for the dst_id field to be
29451          * configured.
29452          */
29453         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
29454                 UINT32_C(0x8000)
29455         /*
29456          * This bit must be '1' for the mirror_vnic_id field to be
29457          * configured.
29458          */
29459         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
29460                 UINT32_C(0x10000)
29461         /*
29462          * This bit must be '1' for the num_vlans field to be
29463          * configured.
29464          */
29465         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS \
29466                 UINT32_C(0x20000)
29467         /*
29468          * This bit must be '1' for the t_num_vlans field to be
29469          * configured.
29470          */
29471         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS \
29472                 UINT32_C(0x40000)
29473         /*
29474          * This value sets the match value for the L2 MAC address.
29475          * Destination MAC address for RX path.
29476          * Source MAC address for TX path.
29477          */
29478         uint8_t l2_addr[6];
29479         /* This value sets the match value for the number of VLANs. */
29480         uint8_t num_vlans;
29481         /*
29482          * This value sets the match value for the number of VLANs
29483          * in the tunnel headers.
29484          */
29485         uint8_t t_num_vlans;
29486         /*
29487          * This value sets the mask value for the L2 address.
29488          * A value of 0 will mask the corresponding bit from
29489          * compare.
29490          */
29491         uint8_t l2_addr_mask[6];
29492         /* This value sets VLAN ID value for outer VLAN. */
29493         uint16_t        l2_ovlan;
29494         /*
29495          * This value sets the mask value for the ovlan id.
29496          * A value of 0 will mask the corresponding bit from
29497          * compare.
29498          */
29499         uint16_t        l2_ovlan_mask;
29500         /* This value sets VLAN ID value for inner VLAN. */
29501         uint16_t        l2_ivlan;
29502         /*
29503          * This value sets the mask value for the ivlan id.
29504          * A value of 0 will mask the corresponding bit from
29505          * compare.
29506          */
29507         uint16_t        l2_ivlan_mask;
29508         uint8_t unused_1[2];
29509         /*
29510          * This value sets the match value for the tunnel
29511          * L2 MAC address.
29512          * Destination MAC address for RX path.
29513          * Source MAC address for TX path.
29514          */
29515         uint8_t t_l2_addr[6];
29516         uint8_t unused_2[2];
29517         /*
29518          * This value sets the mask value for the tunnel L2
29519          * address.
29520          * A value of 0 will mask the corresponding bit from
29521          * compare.
29522          */
29523         uint8_t t_l2_addr_mask[6];
29524         /* This value sets VLAN ID value for tunnel outer VLAN. */
29525         uint16_t        t_l2_ovlan;
29526         /*
29527          * This value sets the mask value for the tunnel ovlan id.
29528          * A value of 0 will mask the corresponding bit from
29529          * compare.
29530          */
29531         uint16_t        t_l2_ovlan_mask;
29532         /* This value sets VLAN ID value for tunnel inner VLAN. */
29533         uint16_t        t_l2_ivlan;
29534         /*
29535          * This value sets the mask value for the tunnel ivlan id.
29536          * A value of 0 will mask the corresponding bit from
29537          * compare.
29538          */
29539         uint16_t        t_l2_ivlan_mask;
29540         /* This value identifies the type of source of the packet. */
29541         uint8_t src_type;
29542         /* Network port */
29543         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
29544         /* Physical function */
29545         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
29546         /* Virtual function */
29547         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
29548         /* Virtual NIC of a function */
29549         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
29550         /* Embedded processor for CFA management */
29551         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
29552         /* Embedded processor for OOB management */
29553         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
29554         /* Embedded processor for RoCE */
29555         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
29556         /* Embedded processor for network proxy functions */
29557         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
29558         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
29559                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
29560         uint8_t unused_3;
29561         /*
29562          * This value is the id of the source.
29563          * For a network port, it represents port_id.
29564          * For a physical function, it represents fid.
29565          * For a virtual function, it represents vf_id.
29566          * For a vnic, it represents vnic_id.
29567          * For embedded processors, this id is not valid.
29568          *
29569          * Notes:
29570          * 1. The function ID is implied if it src_id is
29571          *    not provided for a src_type that is either
29572          */
29573         uint32_t        src_id;
29574         /* Tunnel Type. */
29575         uint8_t tunnel_type;
29576         /* Non-tunnel */
29577         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
29578                 UINT32_C(0x0)
29579         /* Virtual eXtensible Local Area Network (VXLAN) */
29580         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
29581                 UINT32_C(0x1)
29582         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
29583         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
29584                 UINT32_C(0x2)
29585         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
29586         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
29587                 UINT32_C(0x3)
29588         /* IP in IP */
29589         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
29590                 UINT32_C(0x4)
29591         /* Generic Network Virtualization Encapsulation (Geneve) */
29592         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
29593                 UINT32_C(0x5)
29594         /* Multi-Protocol Label Switching (MPLS) */
29595         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
29596                 UINT32_C(0x6)
29597         /* Stateless Transport Tunnel (STT) */
29598         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
29599                 UINT32_C(0x7)
29600         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
29601         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
29602                 UINT32_C(0x8)
29603         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
29604         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
29605                 UINT32_C(0x9)
29606         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
29607         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
29608                 UINT32_C(0xa)
29609         /* Use fixed layer 2 ether type of 0xFFFF */
29610         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
29611                 UINT32_C(0xb)
29612         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
29613         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
29614                 UINT32_C(0xc)
29615         /* Any tunneled traffic */
29616         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
29617                 UINT32_C(0xff)
29618         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
29619                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
29620         uint8_t unused_4;
29621         /*
29622          * If set, this value shall represent the
29623          * Logical VNIC ID of the destination VNIC for the RX
29624          * path and network port id of the destination port for
29625          * the TX path.
29626          */
29627         uint16_t        dst_id;
29628         /*
29629          * Logical VNIC ID of the VNIC where traffic is
29630          * mirrored.
29631          */
29632         uint16_t        mirror_vnic_id;
29633         /*
29634          * This hint is provided to help in placing
29635          * the filter in the filter table.
29636          */
29637         uint8_t pri_hint;
29638         /* No preference */
29639         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
29640                 UINT32_C(0x0)
29641         /* Above the given filter */
29642         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
29643                 UINT32_C(0x1)
29644         /* Below the given filter */
29645         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
29646                 UINT32_C(0x2)
29647         /* As high as possible */
29648         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
29649                 UINT32_C(0x3)
29650         /* As low as possible */
29651         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
29652                 UINT32_C(0x4)
29653         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
29654                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
29655         uint8_t unused_5;
29656         uint32_t        unused_6;
29657         /*
29658          * This is the ID of the filter that goes along with
29659          * the pri_hint.
29660          *
29661          * This field is valid only for the following values.
29662          * 1 - Above the given filter
29663          * 2 - Below the given filter
29664          */
29665         uint64_t        l2_filter_id_hint;
29666 } __rte_packed;
29667
29668 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
29669 struct hwrm_cfa_l2_filter_alloc_output {
29670         /* The specific error status for the command. */
29671         uint16_t        error_code;
29672         /* The HWRM command request type. */
29673         uint16_t        req_type;
29674         /* The sequence ID from the original command. */
29675         uint16_t        seq_id;
29676         /* The length of the response data in number of bytes. */
29677         uint16_t        resp_len;
29678         /*
29679          * This value identifies a set of CFA data structures used for an L2
29680          * context.
29681          */
29682         uint64_t        l2_filter_id;
29683         /*
29684          * The flow id value in bit 0-29 is the actual ID of the flow
29685          * associated with this filter and it shall be used to match
29686          * and associate the flow identifier returned in completion
29687          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
29688          * shall indicate no valid flow id.
29689          */
29690         uint32_t        flow_id;
29691         /* Indicate the flow id value. */
29692         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
29693                 UINT32_C(0x3fffffff)
29694         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
29695         /* Indicate type of the flow. */
29696         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
29697                 UINT32_C(0x40000000)
29698         /*
29699          * If this bit set to 0, then it indicates that the flow is
29700          * internal flow.
29701          */
29702         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
29703                 (UINT32_C(0x0) << 30)
29704         /*
29705          * If this bit is set to 1, then it indicates that the flow is
29706          * external flow.
29707          */
29708         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
29709                 (UINT32_C(0x1) << 30)
29710         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
29711                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
29712         /* Indicate the flow direction. */
29713         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
29714                 UINT32_C(0x80000000)
29715         /* If this bit set to 0, then it indicates rx flow. */
29716         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
29717                 (UINT32_C(0x0) << 31)
29718         /* If this bit is set to 1, then it indicates that tx flow. */
29719         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
29720                 (UINT32_C(0x1) << 31)
29721         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
29722                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
29723         uint8_t unused_0[3];
29724         /*
29725          * This field is used in Output records to indicate that the output
29726          * is completely written to RAM. This field should be read as '1'
29727          * to indicate that the output has been completely written.
29728          * When writing a command completion or response to an internal processor,
29729          * the order of writes has to be such that this field is written last.
29730          */
29731         uint8_t valid;
29732 } __rte_packed;
29733
29734 /***************************
29735  * hwrm_cfa_l2_filter_free *
29736  ***************************/
29737
29738
29739 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
29740 struct hwrm_cfa_l2_filter_free_input {
29741         /* The HWRM command request type. */
29742         uint16_t        req_type;
29743         /*
29744          * The completion ring to send the completion event on. This should
29745          * be the NQ ID returned from the `nq_alloc` HWRM command.
29746          */
29747         uint16_t        cmpl_ring;
29748         /*
29749          * The sequence ID is used by the driver for tracking multiple
29750          * commands. This ID is treated as opaque data by the firmware and
29751          * the value is returned in the `hwrm_resp_hdr` upon completion.
29752          */
29753         uint16_t        seq_id;
29754         /*
29755          * The target ID of the command:
29756          * * 0x0-0xFFF8 - The function ID
29757          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29758          * * 0xFFFD - Reserved for user-space HWRM interface
29759          * * 0xFFFF - HWRM
29760          */
29761         uint16_t        target_id;
29762         /*
29763          * A physical address pointer pointing to a host buffer that the
29764          * command's response data will be written. This can be either a host
29765          * physical address (HPA) or a guest physical address (GPA) and must
29766          * point to a physically contiguous block of memory.
29767          */
29768         uint64_t        resp_addr;
29769         /*
29770          * This value identifies a set of CFA data structures used for an L2
29771          * context.
29772          */
29773         uint64_t        l2_filter_id;
29774 } __rte_packed;
29775
29776 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
29777 struct hwrm_cfa_l2_filter_free_output {
29778         /* The specific error status for the command. */
29779         uint16_t        error_code;
29780         /* The HWRM command request type. */
29781         uint16_t        req_type;
29782         /* The sequence ID from the original command. */
29783         uint16_t        seq_id;
29784         /* The length of the response data in number of bytes. */
29785         uint16_t        resp_len;
29786         uint8_t unused_0[7];
29787         /*
29788          * This field is used in Output records to indicate that the output
29789          * is completely written to RAM. This field should be read as '1'
29790          * to indicate that the output has been completely written.
29791          * When writing a command completion or response to an internal processor,
29792          * the order of writes has to be such that this field is written last.
29793          */
29794         uint8_t valid;
29795 } __rte_packed;
29796
29797 /**************************
29798  * hwrm_cfa_l2_filter_cfg *
29799  **************************/
29800
29801
29802 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
29803 struct hwrm_cfa_l2_filter_cfg_input {
29804         /* The HWRM command request type. */
29805         uint16_t        req_type;
29806         /*
29807          * The completion ring to send the completion event on. This should
29808          * be the NQ ID returned from the `nq_alloc` HWRM command.
29809          */
29810         uint16_t        cmpl_ring;
29811         /*
29812          * The sequence ID is used by the driver for tracking multiple
29813          * commands. This ID is treated as opaque data by the firmware and
29814          * the value is returned in the `hwrm_resp_hdr` upon completion.
29815          */
29816         uint16_t        seq_id;
29817         /*
29818          * The target ID of the command:
29819          * * 0x0-0xFFF8 - The function ID
29820          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29821          * * 0xFFFD - Reserved for user-space HWRM interface
29822          * * 0xFFFF - HWRM
29823          */
29824         uint16_t        target_id;
29825         /*
29826          * A physical address pointer pointing to a host buffer that the
29827          * command's response data will be written. This can be either a host
29828          * physical address (HPA) or a guest physical address (GPA) and must
29829          * point to a physically contiguous block of memory.
29830          */
29831         uint64_t        resp_addr;
29832         uint32_t        flags;
29833         /*
29834          * Enumeration denoting the RX, TX type of the resource.
29835          * This enumeration is used for resources that are similar for both
29836          * TX and RX paths of the chip.
29837          */
29838         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
29839                 UINT32_C(0x1)
29840         /* tx path */
29841         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
29842                 UINT32_C(0x0)
29843         /* rx path */
29844         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
29845                 UINT32_C(0x1)
29846         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
29847                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
29848         /*
29849          * Setting of this flag indicates drop action. If this flag is not set,
29850          * then it should be considered accept action.
29851          */
29852         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
29853                 UINT32_C(0x2)
29854         /*
29855          * Enumeration denoting NO_ROCE_L2 to support old drivers.
29856          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
29857          */
29858         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
29859                 UINT32_C(0xc)
29860         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
29861         /* To support old drivers */
29862         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
29863                 (UINT32_C(0x0) << 2)
29864         /* Only L2 traffic */
29865         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
29866                 (UINT32_C(0x1) << 2)
29867         /* Roce & L2 traffic */
29868         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
29869                 (UINT32_C(0x2) << 2)
29870         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
29871                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
29872         uint32_t        enables;
29873         /*
29874          * This bit must be '1' for the dst_id field to be
29875          * configured.
29876          */
29877         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
29878                 UINT32_C(0x1)
29879         /*
29880          * This bit must be '1' for the new_mirror_vnic_id field to be
29881          * configured.
29882          */
29883         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
29884                 UINT32_C(0x2)
29885         /*
29886          * This value identifies a set of CFA data structures used for an L2
29887          * context.
29888          */
29889         uint64_t        l2_filter_id;
29890         /*
29891          * If set, this value shall represent the
29892          * Logical VNIC ID of the destination VNIC for the RX
29893          * path and network port id of the destination port for
29894          * the TX path.
29895          */
29896         uint32_t        dst_id;
29897         /*
29898          * New Logical VNIC ID of the VNIC where traffic is
29899          * mirrored.
29900          */
29901         uint32_t        new_mirror_vnic_id;
29902 } __rte_packed;
29903
29904 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
29905 struct hwrm_cfa_l2_filter_cfg_output {
29906         /* The specific error status for the command. */
29907         uint16_t        error_code;
29908         /* The HWRM command request type. */
29909         uint16_t        req_type;
29910         /* The sequence ID from the original command. */
29911         uint16_t        seq_id;
29912         /* The length of the response data in number of bytes. */
29913         uint16_t        resp_len;
29914         uint8_t unused_0[7];
29915         /*
29916          * This field is used in Output records to indicate that the output
29917          * is completely written to RAM. This field should be read as '1'
29918          * to indicate that the output has been completely written.
29919          * When writing a command completion or response to an internal processor,
29920          * the order of writes has to be such that this field is written last.
29921          */
29922         uint8_t valid;
29923 } __rte_packed;
29924
29925 /***************************
29926  * hwrm_cfa_l2_set_rx_mask *
29927  ***************************/
29928
29929
29930 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
29931 struct hwrm_cfa_l2_set_rx_mask_input {
29932         /* The HWRM command request type. */
29933         uint16_t        req_type;
29934         /*
29935          * The completion ring to send the completion event on. This should
29936          * be the NQ ID returned from the `nq_alloc` HWRM command.
29937          */
29938         uint16_t        cmpl_ring;
29939         /*
29940          * The sequence ID is used by the driver for tracking multiple
29941          * commands. This ID is treated as opaque data by the firmware and
29942          * the value is returned in the `hwrm_resp_hdr` upon completion.
29943          */
29944         uint16_t        seq_id;
29945         /*
29946          * The target ID of the command:
29947          * * 0x0-0xFFF8 - The function ID
29948          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29949          * * 0xFFFD - Reserved for user-space HWRM interface
29950          * * 0xFFFF - HWRM
29951          */
29952         uint16_t        target_id;
29953         /*
29954          * A physical address pointer pointing to a host buffer that the
29955          * command's response data will be written. This can be either a host
29956          * physical address (HPA) or a guest physical address (GPA) and must
29957          * point to a physically contiguous block of memory.
29958          */
29959         uint64_t        resp_addr;
29960         /* VNIC ID */
29961         uint32_t        vnic_id;
29962         uint32_t        mask;
29963         /*
29964          * When this bit is '1', the function is requested to accept
29965          * multi-cast packets specified by the multicast addr table.
29966          */
29967         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
29968                 UINT32_C(0x2)
29969         /*
29970          * When this bit is '1', the function is requested to accept
29971          * all multi-cast packets.
29972          */
29973         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
29974                 UINT32_C(0x4)
29975         /*
29976          * When this bit is '1', the function is requested to accept
29977          * broadcast packets.
29978          */
29979         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
29980                 UINT32_C(0x8)
29981         /*
29982          * When this bit is '1', the function is requested to be
29983          * put in the promiscuous mode.
29984          *
29985          * The HWRM should accept any function to set up
29986          * promiscuous mode.
29987          *
29988          * The HWRM shall follow the semantics below for the
29989          * promiscuous mode support.
29990          * # When partitioning is not enabled on a port
29991          * (i.e. single PF on the port), then the PF shall
29992          * be allowed to be in the promiscuous mode. When the
29993          * PF is in the promiscuous mode, then it shall
29994          * receive all host bound traffic on that port.
29995          * # When partitioning is enabled on a port
29996          * (i.e. multiple PFs per port) and a PF on that
29997          * port is in the promiscuous mode, then the PF
29998          * receives all traffic within that partition as
29999          * identified by a unique identifier for the
30000          * PF (e.g. S-Tag). If a unique outer VLAN
30001          * for the PF is specified, then the setting of
30002          * promiscuous mode on that PF shall result in the
30003          * PF receiving all host bound traffic with matching
30004          * outer VLAN.
30005          * # A VF shall can be set in the promiscuous mode.
30006          * In the promiscuous mode, the VF does not receive any
30007          * traffic unless a unique outer VLAN for the
30008          * VF is specified. If a unique outer VLAN
30009          * for the VF is specified, then the setting of
30010          * promiscuous mode on that VF shall result in the
30011          * VF receiving all host bound traffic with the
30012          * matching outer VLAN.
30013          * # The HWRM shall allow the setting of promiscuous
30014          * mode on a function independently from the
30015          * promiscuous mode settings on other functions.
30016          */
30017         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
30018                 UINT32_C(0x10)
30019         /*
30020          * If this flag is set, the corresponding RX
30021          * filters shall be set up to cover multicast/broadcast
30022          * filters for the outermost Layer 2 destination MAC
30023          * address field.
30024          */
30025         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
30026                 UINT32_C(0x20)
30027         /*
30028          * If this flag is set, the corresponding RX
30029          * filters shall be set up to cover multicast/broadcast
30030          * filters for the VLAN-tagged packets that match the
30031          * TPID and VID fields of VLAN tags in the VLAN tag
30032          * table specified in this command.
30033          */
30034         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
30035                 UINT32_C(0x40)
30036         /*
30037          * If this flag is set, the corresponding RX
30038          * filters shall be set up to cover multicast/broadcast
30039          * filters for non-VLAN tagged packets and VLAN-tagged
30040          * packets that match the TPID and VID fields of VLAN
30041          * tags in the VLAN tag table specified in this command.
30042          */
30043         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
30044                 UINT32_C(0x80)
30045         /*
30046          * If this flag is set, the corresponding RX
30047          * filters shall be set up to cover multicast/broadcast
30048          * filters for non-VLAN tagged packets and VLAN-tagged
30049          * packets matching any VLAN tag.
30050          *
30051          * If this flag is set, then the HWRM shall ignore
30052          * VLAN tags specified in vlan_tag_tbl.
30053          *
30054          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
30055          * flags is set, then the HWRM shall ignore
30056          * VLAN tags specified in vlan_tag_tbl.
30057          *
30058          * The HWRM client shall set at most one flag out of
30059          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
30060          */
30061         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
30062                 UINT32_C(0x100)
30063         /* This is the address for mcast address tbl. */
30064         uint64_t        mc_tbl_addr;
30065         /*
30066          * This value indicates how many entries in mc_tbl are valid.
30067          * Each entry is 6 bytes.
30068          */
30069         uint32_t        num_mc_entries;
30070         uint8_t unused_0[4];
30071         /*
30072          * This is the address for VLAN tag table.
30073          * Each VLAN entry in the table is 4 bytes of a VLAN tag
30074          * including TPID, PCP, DEI, and VID fields in network byte
30075          * order.
30076          */
30077         uint64_t        vlan_tag_tbl_addr;
30078         /*
30079          * This value indicates how many entries in vlan_tag_tbl are
30080          * valid. Each entry is 4 bytes.
30081          */
30082         uint32_t        num_vlan_tags;
30083         uint8_t unused_1[4];
30084 } __rte_packed;
30085
30086 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
30087 struct hwrm_cfa_l2_set_rx_mask_output {
30088         /* The specific error status for the command. */
30089         uint16_t        error_code;
30090         /* The HWRM command request type. */
30091         uint16_t        req_type;
30092         /* The sequence ID from the original command. */
30093         uint16_t        seq_id;
30094         /* The length of the response data in number of bytes. */
30095         uint16_t        resp_len;
30096         uint8_t unused_0[7];
30097         /*
30098          * This field is used in Output records to indicate that the output
30099          * is completely written to RAM. This field should be read as '1'
30100          * to indicate that the output has been completely written.
30101          * When writing a command completion or response to an internal processor,
30102          * the order of writes has to be such that this field is written last.
30103          */
30104         uint8_t valid;
30105 } __rte_packed;
30106
30107 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
30108 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
30109         /*
30110          * command specific error codes that goes to
30111          * the cmd_err field in Common HWRM Error Response.
30112          */
30113         uint8_t code;
30114         /* Unknown error */
30115         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
30116                 UINT32_C(0x0)
30117         /* Unable to complete operation due to conflict with Ntuple Filter */
30118         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
30119                 UINT32_C(0x1)
30120         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
30121                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
30122         uint8_t unused_0[7];
30123 } __rte_packed;
30124
30125 /*******************************
30126  * hwrm_cfa_vlan_antispoof_cfg *
30127  *******************************/
30128
30129
30130 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
30131 struct hwrm_cfa_vlan_antispoof_cfg_input {
30132         /* The HWRM command request type. */
30133         uint16_t        req_type;
30134         /*
30135          * The completion ring to send the completion event on. This should
30136          * be the NQ ID returned from the `nq_alloc` HWRM command.
30137          */
30138         uint16_t        cmpl_ring;
30139         /*
30140          * The sequence ID is used by the driver for tracking multiple
30141          * commands. This ID is treated as opaque data by the firmware and
30142          * the value is returned in the `hwrm_resp_hdr` upon completion.
30143          */
30144         uint16_t        seq_id;
30145         /*
30146          * The target ID of the command:
30147          * * 0x0-0xFFF8 - The function ID
30148          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30149          * * 0xFFFD - Reserved for user-space HWRM interface
30150          * * 0xFFFF - HWRM
30151          */
30152         uint16_t        target_id;
30153         /*
30154          * A physical address pointer pointing to a host buffer that the
30155          * command's response data will be written. This can be either a host
30156          * physical address (HPA) or a guest physical address (GPA) and must
30157          * point to a physically contiguous block of memory.
30158          */
30159         uint64_t        resp_addr;
30160         /*
30161          * Function ID of the function that is being configured.
30162          * Only valid for a VF FID configured by the PF.
30163          */
30164         uint16_t        fid;
30165         uint8_t unused_0[2];
30166         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
30167         uint32_t        num_vlan_entries;
30168         /*
30169          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
30170          * antispoof table. Each table entry contains the 16-bit TPID
30171          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
30172          * all in network order to match hwrm_cfa_l2_set_rx_mask.
30173          * For an individual VLAN entry, the mask value should be 0xfff
30174          * for the 12-bit VLAN ID.
30175          */
30176         uint64_t        vlan_tag_mask_tbl_addr;
30177 } __rte_packed;
30178
30179 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
30180 struct hwrm_cfa_vlan_antispoof_cfg_output {
30181         /* The specific error status for the command. */
30182         uint16_t        error_code;
30183         /* The HWRM command request type. */
30184         uint16_t        req_type;
30185         /* The sequence ID from the original command. */
30186         uint16_t        seq_id;
30187         /* The length of the response data in number of bytes. */
30188         uint16_t        resp_len;
30189         uint8_t unused_0[7];
30190         /*
30191          * This field is used in Output records to indicate that the output
30192          * is completely written to RAM. This field should be read as '1'
30193          * to indicate that the output has been completely written.
30194          * When writing a command completion or response to an internal processor,
30195          * the order of writes has to be such that this field is written last.
30196          */
30197         uint8_t valid;
30198 } __rte_packed;
30199
30200 /********************************
30201  * hwrm_cfa_vlan_antispoof_qcfg *
30202  ********************************/
30203
30204
30205 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
30206 struct hwrm_cfa_vlan_antispoof_qcfg_input {
30207         /* The HWRM command request type. */
30208         uint16_t        req_type;
30209         /*
30210          * The completion ring to send the completion event on. This should
30211          * be the NQ ID returned from the `nq_alloc` HWRM command.
30212          */
30213         uint16_t        cmpl_ring;
30214         /*
30215          * The sequence ID is used by the driver for tracking multiple
30216          * commands. This ID is treated as opaque data by the firmware and
30217          * the value is returned in the `hwrm_resp_hdr` upon completion.
30218          */
30219         uint16_t        seq_id;
30220         /*
30221          * The target ID of the command:
30222          * * 0x0-0xFFF8 - The function ID
30223          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30224          * * 0xFFFD - Reserved for user-space HWRM interface
30225          * * 0xFFFF - HWRM
30226          */
30227         uint16_t        target_id;
30228         /*
30229          * A physical address pointer pointing to a host buffer that the
30230          * command's response data will be written. This can be either a host
30231          * physical address (HPA) or a guest physical address (GPA) and must
30232          * point to a physically contiguous block of memory.
30233          */
30234         uint64_t        resp_addr;
30235         /*
30236          * Function ID of the function that is being queried.
30237          * Only valid for a VF FID queried by the PF.
30238          */
30239         uint16_t        fid;
30240         uint8_t unused_0[2];
30241         /*
30242          * Maximum number of VLAN entries the firmware is allowed to DMA
30243          * to vlan_tag_mask_tbl.
30244          */
30245         uint32_t        max_vlan_entries;
30246         /*
30247          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
30248          * antispoof table to which firmware will DMA to. Each table
30249          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
30250          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
30251          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
30252          * the mask value should be 0xfff for the 12-bit VLAN ID.
30253          */
30254         uint64_t        vlan_tag_mask_tbl_addr;
30255 } __rte_packed;
30256
30257 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
30258 struct hwrm_cfa_vlan_antispoof_qcfg_output {
30259         /* The specific error status for the command. */
30260         uint16_t        error_code;
30261         /* The HWRM command request type. */
30262         uint16_t        req_type;
30263         /* The sequence ID from the original command. */
30264         uint16_t        seq_id;
30265         /* The length of the response data in number of bytes. */
30266         uint16_t        resp_len;
30267         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
30268         uint32_t        num_vlan_entries;
30269         uint8_t unused_0[3];
30270         /*
30271          * This field is used in Output records to indicate that the output
30272          * is completely written to RAM. This field should be read as '1'
30273          * to indicate that the output has been completely written.
30274          * When writing a command completion or response to an internal processor,
30275          * the order of writes has to be such that this field is written last.
30276          */
30277         uint8_t valid;
30278 } __rte_packed;
30279
30280 /********************************
30281  * hwrm_cfa_tunnel_filter_alloc *
30282  ********************************/
30283
30284
30285 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
30286 struct hwrm_cfa_tunnel_filter_alloc_input {
30287         /* The HWRM command request type. */
30288         uint16_t        req_type;
30289         /*
30290          * The completion ring to send the completion event on. This should
30291          * be the NQ ID returned from the `nq_alloc` HWRM command.
30292          */
30293         uint16_t        cmpl_ring;
30294         /*
30295          * The sequence ID is used by the driver for tracking multiple
30296          * commands. This ID is treated as opaque data by the firmware and
30297          * the value is returned in the `hwrm_resp_hdr` upon completion.
30298          */
30299         uint16_t        seq_id;
30300         /*
30301          * The target ID of the command:
30302          * * 0x0-0xFFF8 - The function ID
30303          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30304          * * 0xFFFD - Reserved for user-space HWRM interface
30305          * * 0xFFFF - HWRM
30306          */
30307         uint16_t        target_id;
30308         /*
30309          * A physical address pointer pointing to a host buffer that the
30310          * command's response data will be written. This can be either a host
30311          * physical address (HPA) or a guest physical address (GPA) and must
30312          * point to a physically contiguous block of memory.
30313          */
30314         uint64_t        resp_addr;
30315         uint32_t        flags;
30316         /* Setting of this flag indicates the applicability to the loopback path. */
30317         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
30318                 UINT32_C(0x1)
30319         uint32_t        enables;
30320         /*
30321          * This bit must be '1' for the l2_filter_id field to be
30322          * configured.
30323          */
30324         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
30325                 UINT32_C(0x1)
30326         /*
30327          * This bit must be '1' for the l2_addr field to be
30328          * configured.
30329          */
30330         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
30331                 UINT32_C(0x2)
30332         /*
30333          * This bit must be '1' for the l2_ivlan field to be
30334          * configured.
30335          */
30336         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
30337                 UINT32_C(0x4)
30338         /*
30339          * This bit must be '1' for the l3_addr field to be
30340          * configured.
30341          */
30342         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
30343                 UINT32_C(0x8)
30344         /*
30345          * This bit must be '1' for the l3_addr_type field to be
30346          * configured.
30347          */
30348         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
30349                 UINT32_C(0x10)
30350         /*
30351          * This bit must be '1' for the t_l3_addr_type field to be
30352          * configured.
30353          */
30354         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
30355                 UINT32_C(0x20)
30356         /*
30357          * This bit must be '1' for the t_l3_addr field to be
30358          * configured.
30359          */
30360         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
30361                 UINT32_C(0x40)
30362         /*
30363          * This bit must be '1' for the tunnel_type field to be
30364          * configured.
30365          */
30366         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
30367                 UINT32_C(0x80)
30368         /*
30369          * This bit must be '1' for the vni field to be
30370          * configured.
30371          */
30372         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
30373                 UINT32_C(0x100)
30374         /*
30375          * This bit must be '1' for the dst_vnic_id field to be
30376          * configured.
30377          */
30378         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
30379                 UINT32_C(0x200)
30380         /*
30381          * This bit must be '1' for the mirror_vnic_id field to be
30382          * configured.
30383          */
30384         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
30385                 UINT32_C(0x400)
30386         /*
30387          * This value identifies a set of CFA data structures used for an L2
30388          * context.
30389          */
30390         uint64_t        l2_filter_id;
30391         /*
30392          * This value sets the match value for the inner L2
30393          * MAC address.
30394          * Destination MAC address for RX path.
30395          * Source MAC address for TX path.
30396          */
30397         uint8_t l2_addr[6];
30398         /*
30399          * This value sets VLAN ID value for inner VLAN.
30400          * Only 12-bits of VLAN ID are used in setting the filter.
30401          */
30402         uint16_t        l2_ivlan;
30403         /*
30404          * The value of inner destination IP address to be used in filtering.
30405          * For IPv4, first four bytes represent the IP address.
30406          */
30407         uint32_t        l3_addr[4];
30408         /*
30409          * The value of tunnel destination IP address to be used in filtering.
30410          * For IPv4, first four bytes represent the IP address.
30411          */
30412         uint32_t        t_l3_addr[4];
30413         /*
30414          * This value indicates the type of inner IP address.
30415          * 4 - IPv4
30416          * 6 - IPv6
30417          * All others are invalid.
30418          */
30419         uint8_t l3_addr_type;
30420         /*
30421          * This value indicates the type of tunnel IP address.
30422          * 4 - IPv4
30423          * 6 - IPv6
30424          * All others are invalid.
30425          */
30426         uint8_t t_l3_addr_type;
30427         /* Tunnel Type. */
30428         uint8_t tunnel_type;
30429         /* Non-tunnel */
30430         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
30431                 UINT32_C(0x0)
30432         /* Virtual eXtensible Local Area Network (VXLAN) */
30433         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
30434                 UINT32_C(0x1)
30435         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
30436         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
30437                 UINT32_C(0x2)
30438         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
30439         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
30440                 UINT32_C(0x3)
30441         /* IP in IP */
30442         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
30443                 UINT32_C(0x4)
30444         /* Generic Network Virtualization Encapsulation (Geneve) */
30445         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
30446                 UINT32_C(0x5)
30447         /* Multi-Protocol Label Switching (MPLS) */
30448         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
30449                 UINT32_C(0x6)
30450         /* Stateless Transport Tunnel (STT) */
30451         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
30452                 UINT32_C(0x7)
30453         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
30454         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
30455                 UINT32_C(0x8)
30456         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30457         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30458                 UINT32_C(0x9)
30459         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30460         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30461                 UINT32_C(0xa)
30462         /* Use fixed layer 2 ether type of 0xFFFF */
30463         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
30464                 UINT32_C(0xb)
30465         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30466         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30467                 UINT32_C(0xc)
30468         /* Any tunneled traffic */
30469         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
30470                 UINT32_C(0xff)
30471         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
30472                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
30473         /*
30474          * tunnel_flags allows the user to indicate the tunnel tag detection
30475          * for the tunnel type specified in tunnel_type.
30476          */
30477         uint8_t tunnel_flags;
30478         /*
30479          * If the tunnel_type is geneve, then this bit indicates if we
30480          * need to match the geneve OAM packet.
30481          * If the tunnel_type is nvgre or gre, then this bit indicates if
30482          * we need to detect checksum present bit in geneve header.
30483          * If the tunnel_type is mpls, then this bit indicates if we need
30484          * to match mpls packet with explicit IPV4/IPV6 null header.
30485          */
30486         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
30487                 UINT32_C(0x1)
30488         /*
30489          * If the tunnel_type is geneve, then this bit indicates if we
30490          * need to detect the critical option bit set in the oam packet.
30491          * If the tunnel_type is nvgre or gre, then this bit indicates
30492          * if we need to match nvgre packets with key present bit set in
30493          * gre header.
30494          * If the tunnel_type is mpls, then this bit indicates if we
30495          * need to match mpls packet with S bit from inner/second label.
30496          */
30497         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
30498                 UINT32_C(0x2)
30499         /*
30500          * If the tunnel_type is geneve, then this bit indicates if we
30501          * need to match geneve packet with extended header bit set in
30502          * geneve header.
30503          * If the tunnel_type is nvgre or gre, then this bit indicates
30504          * if we need to match nvgre packets with sequence number
30505          * present bit set in gre header.
30506          * If the tunnel_type is mpls, then this bit indicates if we
30507          * need to match mpls packet with S bit from out/first label.
30508          */
30509         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
30510                 UINT32_C(0x4)
30511         /*
30512          * Virtual Network Identifier (VNI). Only valid with
30513          * tunnel_types VXLAN, NVGRE, and Geneve.
30514          * Only lower 24-bits of VNI field are used
30515          * in setting up the filter.
30516          */
30517         uint32_t        vni;
30518         /* Logical VNIC ID of the destination VNIC. */
30519         uint32_t        dst_vnic_id;
30520         /*
30521          * Logical VNIC ID of the VNIC where traffic is
30522          * mirrored.
30523          */
30524         uint32_t        mirror_vnic_id;
30525 } __rte_packed;
30526
30527 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
30528 struct hwrm_cfa_tunnel_filter_alloc_output {
30529         /* The specific error status for the command. */
30530         uint16_t        error_code;
30531         /* The HWRM command request type. */
30532         uint16_t        req_type;
30533         /* The sequence ID from the original command. */
30534         uint16_t        seq_id;
30535         /* The length of the response data in number of bytes. */
30536         uint16_t        resp_len;
30537         /* This value is an opaque id into CFA data structures. */
30538         uint64_t        tunnel_filter_id;
30539         /*
30540          * The flow id value in bit 0-29 is the actual ID of the flow
30541          * associated with this filter and it shall be used to match
30542          * and associate the flow identifier returned in completion
30543          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
30544          * shall indicate no valid flow id.
30545          */
30546         uint32_t        flow_id;
30547         /* Indicate the flow id value. */
30548         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
30549                 UINT32_C(0x3fffffff)
30550         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
30551         /* Indicate type of the flow. */
30552         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
30553                 UINT32_C(0x40000000)
30554         /*
30555          * If this bit set to 0, then it indicates that the flow is
30556          * internal flow.
30557          */
30558         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
30559                 (UINT32_C(0x0) << 30)
30560         /*
30561          * If this bit is set to 1, then it indicates that the flow is
30562          * external flow.
30563          */
30564         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
30565                 (UINT32_C(0x1) << 30)
30566         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
30567                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
30568         /* Indicate the flow direction. */
30569         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
30570                 UINT32_C(0x80000000)
30571         /* If this bit set to 0, then it indicates rx flow. */
30572         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
30573                 (UINT32_C(0x0) << 31)
30574         /* If this bit is set to 1, then it indicates that tx flow. */
30575         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
30576                 (UINT32_C(0x1) << 31)
30577         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
30578                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
30579         uint8_t unused_0[3];
30580         /*
30581          * This field is used in Output records to indicate that the output
30582          * is completely written to RAM. This field should be read as '1'
30583          * to indicate that the output has been completely written.
30584          * When writing a command completion or response to an internal processor,
30585          * the order of writes has to be such that this field is written last.
30586          */
30587         uint8_t valid;
30588 } __rte_packed;
30589
30590 /*******************************
30591  * hwrm_cfa_tunnel_filter_free *
30592  *******************************/
30593
30594
30595 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
30596 struct hwrm_cfa_tunnel_filter_free_input {
30597         /* The HWRM command request type. */
30598         uint16_t        req_type;
30599         /*
30600          * The completion ring to send the completion event on. This should
30601          * be the NQ ID returned from the `nq_alloc` HWRM command.
30602          */
30603         uint16_t        cmpl_ring;
30604         /*
30605          * The sequence ID is used by the driver for tracking multiple
30606          * commands. This ID is treated as opaque data by the firmware and
30607          * the value is returned in the `hwrm_resp_hdr` upon completion.
30608          */
30609         uint16_t        seq_id;
30610         /*
30611          * The target ID of the command:
30612          * * 0x0-0xFFF8 - The function ID
30613          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30614          * * 0xFFFD - Reserved for user-space HWRM interface
30615          * * 0xFFFF - HWRM
30616          */
30617         uint16_t        target_id;
30618         /*
30619          * A physical address pointer pointing to a host buffer that the
30620          * command's response data will be written. This can be either a host
30621          * physical address (HPA) or a guest physical address (GPA) and must
30622          * point to a physically contiguous block of memory.
30623          */
30624         uint64_t        resp_addr;
30625         /* This value is an opaque id into CFA data structures. */
30626         uint64_t        tunnel_filter_id;
30627 } __rte_packed;
30628
30629 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
30630 struct hwrm_cfa_tunnel_filter_free_output {
30631         /* The specific error status for the command. */
30632         uint16_t        error_code;
30633         /* The HWRM command request type. */
30634         uint16_t        req_type;
30635         /* The sequence ID from the original command. */
30636         uint16_t        seq_id;
30637         /* The length of the response data in number of bytes. */
30638         uint16_t        resp_len;
30639         uint8_t unused_0[7];
30640         /*
30641          * This field is used in Output records to indicate that the output
30642          * is completely written to RAM. This field should be read as '1'
30643          * to indicate that the output has been completely written.
30644          * When writing a command completion or response to an internal processor,
30645          * the order of writes has to be such that this field is written last.
30646          */
30647         uint8_t valid;
30648 } __rte_packed;
30649
30650 /***************************************
30651  * hwrm_cfa_redirect_tunnel_type_alloc *
30652  ***************************************/
30653
30654
30655 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
30656 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
30657         /* The HWRM command request type. */
30658         uint16_t        req_type;
30659         /*
30660          * The completion ring to send the completion event on. This should
30661          * be the NQ ID returned from the `nq_alloc` HWRM command.
30662          */
30663         uint16_t        cmpl_ring;
30664         /*
30665          * The sequence ID is used by the driver for tracking multiple
30666          * commands. This ID is treated as opaque data by the firmware and
30667          * the value is returned in the `hwrm_resp_hdr` upon completion.
30668          */
30669         uint16_t        seq_id;
30670         /*
30671          * The target ID of the command:
30672          * * 0x0-0xFFF8 - The function ID
30673          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30674          * * 0xFFFD - Reserved for user-space HWRM interface
30675          * * 0xFFFF - HWRM
30676          */
30677         uint16_t        target_id;
30678         /*
30679          * A physical address pointer pointing to a host buffer that the
30680          * command's response data will be written. This can be either a host
30681          * physical address (HPA) or a guest physical address (GPA) and must
30682          * point to a physically contiguous block of memory.
30683          */
30684         uint64_t        resp_addr;
30685         /* The destination function id, to whom the traffic is redirected. */
30686         uint16_t        dest_fid;
30687         /* Tunnel Type. */
30688         uint8_t tunnel_type;
30689         /* Non-tunnel */
30690         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
30691                 UINT32_C(0x0)
30692         /* Virtual eXtensible Local Area Network (VXLAN) */
30693         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
30694                 UINT32_C(0x1)
30695         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
30696         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
30697                 UINT32_C(0x2)
30698         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
30699         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
30700                 UINT32_C(0x3)
30701         /* IP in IP */
30702         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
30703                 UINT32_C(0x4)
30704         /* Generic Network Virtualization Encapsulation (Geneve) */
30705         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
30706                 UINT32_C(0x5)
30707         /* Multi-Protocol Label Switching (MPLS) */
30708         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
30709                 UINT32_C(0x6)
30710         /* Stateless Transport Tunnel (STT) */
30711         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
30712                 UINT32_C(0x7)
30713         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
30714         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
30715                 UINT32_C(0x8)
30716         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30717         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30718                 UINT32_C(0x9)
30719         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30720         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30721                 UINT32_C(0xa)
30722         /* Use fixed layer 2 ether type of 0xFFFF */
30723         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
30724                 UINT32_C(0xb)
30725         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30726         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30727                 UINT32_C(0xc)
30728         /* Any tunneled traffic */
30729         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
30730                 UINT32_C(0xff)
30731         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
30732                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
30733         /* Tunnel alloc flags. */
30734         uint8_t flags;
30735         /* Setting of this flag indicates modify existing redirect tunnel to new destination function ID. */
30736         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
30737                 UINT32_C(0x1)
30738         uint8_t unused_0[4];
30739 } __rte_packed;
30740
30741 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
30742 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
30743         /* The specific error status for the command. */
30744         uint16_t        error_code;
30745         /* The HWRM command request type. */
30746         uint16_t        req_type;
30747         /* The sequence ID from the original command. */
30748         uint16_t        seq_id;
30749         /* The length of the response data in number of bytes. */
30750         uint16_t        resp_len;
30751         uint8_t unused_0[7];
30752         /*
30753          * This field is used in Output records to indicate that the output
30754          * is completely written to RAM. This field should be read as '1'
30755          * to indicate that the output has been completely written.
30756          * When writing a command completion or response to an internal processor,
30757          * the order of writes has to be such that this field is written last.
30758          */
30759         uint8_t valid;
30760 } __rte_packed;
30761
30762 /**************************************
30763  * hwrm_cfa_redirect_tunnel_type_free *
30764  **************************************/
30765
30766
30767 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
30768 struct hwrm_cfa_redirect_tunnel_type_free_input {
30769         /* The HWRM command request type. */
30770         uint16_t        req_type;
30771         /*
30772          * The completion ring to send the completion event on. This should
30773          * be the NQ ID returned from the `nq_alloc` HWRM command.
30774          */
30775         uint16_t        cmpl_ring;
30776         /*
30777          * The sequence ID is used by the driver for tracking multiple
30778          * commands. This ID is treated as opaque data by the firmware and
30779          * the value is returned in the `hwrm_resp_hdr` upon completion.
30780          */
30781         uint16_t        seq_id;
30782         /*
30783          * The target ID of the command:
30784          * * 0x0-0xFFF8 - The function ID
30785          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30786          * * 0xFFFD - Reserved for user-space HWRM interface
30787          * * 0xFFFF - HWRM
30788          */
30789         uint16_t        target_id;
30790         /*
30791          * A physical address pointer pointing to a host buffer that the
30792          * command's response data will be written. This can be either a host
30793          * physical address (HPA) or a guest physical address (GPA) and must
30794          * point to a physically contiguous block of memory.
30795          */
30796         uint64_t        resp_addr;
30797         /* The destination function id, to whom the traffic is redirected. */
30798         uint16_t        dest_fid;
30799         /* Tunnel Type. */
30800         uint8_t tunnel_type;
30801         /* Non-tunnel */
30802         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
30803                 UINT32_C(0x0)
30804         /* Virtual eXtensible Local Area Network (VXLAN) */
30805         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
30806                 UINT32_C(0x1)
30807         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
30808         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
30809                 UINT32_C(0x2)
30810         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
30811         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
30812                 UINT32_C(0x3)
30813         /* IP in IP */
30814         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
30815                 UINT32_C(0x4)
30816         /* Generic Network Virtualization Encapsulation (Geneve) */
30817         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
30818                 UINT32_C(0x5)
30819         /* Multi-Protocol Label Switching (MPLS) */
30820         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
30821                 UINT32_C(0x6)
30822         /* Stateless Transport Tunnel (STT) */
30823         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
30824                 UINT32_C(0x7)
30825         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
30826         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
30827                 UINT32_C(0x8)
30828         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30829         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30830                 UINT32_C(0x9)
30831         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30832         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30833                 UINT32_C(0xa)
30834         /* Use fixed layer 2 ether type of 0xFFFF */
30835         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
30836                 UINT32_C(0xb)
30837         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30838         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30839                 UINT32_C(0xc)
30840         /* Any tunneled traffic */
30841         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
30842                 UINT32_C(0xff)
30843         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
30844                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
30845         uint8_t unused_0[5];
30846 } __rte_packed;
30847
30848 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
30849 struct hwrm_cfa_redirect_tunnel_type_free_output {
30850         /* The specific error status for the command. */
30851         uint16_t        error_code;
30852         /* The HWRM command request type. */
30853         uint16_t        req_type;
30854         /* The sequence ID from the original command. */
30855         uint16_t        seq_id;
30856         /* The length of the response data in number of bytes. */
30857         uint16_t        resp_len;
30858         uint8_t unused_0[7];
30859         /*
30860          * This field is used in Output records to indicate that the output
30861          * is completely written to RAM. This field should be read as '1'
30862          * to indicate that the output has been completely written.
30863          * When writing a command completion or response to an internal processor,
30864          * the order of writes has to be such that this field is written last.
30865          */
30866         uint8_t valid;
30867 } __rte_packed;
30868
30869 /**************************************
30870  * hwrm_cfa_redirect_tunnel_type_info *
30871  **************************************/
30872
30873
30874 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
30875 struct hwrm_cfa_redirect_tunnel_type_info_input {
30876         /* The HWRM command request type. */
30877         uint16_t        req_type;
30878         /*
30879          * The completion ring to send the completion event on. This should
30880          * be the NQ ID returned from the `nq_alloc` HWRM command.
30881          */
30882         uint16_t        cmpl_ring;
30883         /*
30884          * The sequence ID is used by the driver for tracking multiple
30885          * commands. This ID is treated as opaque data by the firmware and
30886          * the value is returned in the `hwrm_resp_hdr` upon completion.
30887          */
30888         uint16_t        seq_id;
30889         /*
30890          * The target ID of the command:
30891          * * 0x0-0xFFF8 - The function ID
30892          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30893          * * 0xFFFD - Reserved for user-space HWRM interface
30894          * * 0xFFFF - HWRM
30895          */
30896         uint16_t        target_id;
30897         /*
30898          * A physical address pointer pointing to a host buffer that the
30899          * command's response data will be written. This can be either a host
30900          * physical address (HPA) or a guest physical address (GPA) and must
30901          * point to a physically contiguous block of memory.
30902          */
30903         uint64_t        resp_addr;
30904         /* The source function id. */
30905         uint16_t        src_fid;
30906         /* Tunnel Type. */
30907         uint8_t tunnel_type;
30908         /* Non-tunnel */
30909         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
30910                 UINT32_C(0x0)
30911         /* Virtual eXtensible Local Area Network (VXLAN) */
30912         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
30913                 UINT32_C(0x1)
30914         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
30915         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
30916                 UINT32_C(0x2)
30917         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
30918         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
30919                 UINT32_C(0x3)
30920         /* IP in IP */
30921         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
30922                 UINT32_C(0x4)
30923         /* Generic Network Virtualization Encapsulation (Geneve) */
30924         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
30925                 UINT32_C(0x5)
30926         /* Multi-Protocol Label Switching (MPLS) */
30927         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
30928                 UINT32_C(0x6)
30929         /* Stateless Transport Tunnel (STT) */
30930         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
30931                 UINT32_C(0x7)
30932         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
30933         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
30934                 UINT32_C(0x8)
30935         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30936         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30937                 UINT32_C(0x9)
30938         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30939         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30940                 UINT32_C(0xa)
30941         /* Use fixed layer 2 ether type of 0xFFFF */
30942         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
30943                 UINT32_C(0xb)
30944         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30945         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30946                 UINT32_C(0xc)
30947         /* Any tunneled traffic */
30948         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
30949                 UINT32_C(0xff)
30950         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
30951                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
30952         uint8_t unused_0[5];
30953 } __rte_packed;
30954
30955 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
30956 struct hwrm_cfa_redirect_tunnel_type_info_output {
30957         /* The specific error status for the command. */
30958         uint16_t        error_code;
30959         /* The HWRM command request type. */
30960         uint16_t        req_type;
30961         /* The sequence ID from the original command. */
30962         uint16_t        seq_id;
30963         /* The length of the response data in number of bytes. */
30964         uint16_t        resp_len;
30965         /* The destination function id, to whom the traffic is redirected. */
30966         uint16_t        dest_fid;
30967         uint8_t unused_0[5];
30968         /*
30969          * This field is used in Output records to indicate that the output
30970          * is completely written to RAM. This field should be read as '1'
30971          * to indicate that the output has been completely written.
30972          * When writing a command completion or response to an internal processor,
30973          * the order of writes has to be such that this field is written last.
30974          */
30975         uint8_t valid;
30976 } __rte_packed;
30977
30978 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
30979 struct hwrm_vxlan_ipv4_hdr {
30980         /* IPv4 version and header length. */
30981         uint8_t ver_hlen;
30982         /* IPv4 header length */
30983         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
30984         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
30985         /* Version */
30986         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
30987         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
30988         /* IPv4 type of service. */
30989         uint8_t tos;
30990         /* IPv4 identification. */
30991         uint16_t        ip_id;
30992         /* IPv4 flags and offset. */
30993         uint16_t        flags_frag_offset;
30994         /* IPv4 TTL. */
30995         uint8_t ttl;
30996         /* IPv4 protocol. */
30997         uint8_t protocol;
30998         /* IPv4 source address. */
30999         uint32_t        src_ip_addr;
31000         /* IPv4 destination address. */
31001         uint32_t        dest_ip_addr;
31002 } __rte_packed;
31003
31004 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
31005 struct hwrm_vxlan_ipv6_hdr {
31006         /* IPv6 version, traffic class and flow label. */
31007         uint32_t        ver_tc_flow_label;
31008         /* IPv6 version shift */
31009         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
31010                 UINT32_C(0x1c)
31011         /* IPv6 version mask */
31012         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
31013                 UINT32_C(0xf0000000)
31014         /* IPv6 TC shift */
31015         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
31016                 UINT32_C(0x14)
31017         /* IPv6 TC mask */
31018         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
31019                 UINT32_C(0xff00000)
31020         /* IPv6 flow label shift */
31021         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
31022                 UINT32_C(0x0)
31023         /* IPv6 flow label mask */
31024         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
31025                 UINT32_C(0xfffff)
31026         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
31027                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
31028         /* IPv6 payload length. */
31029         uint16_t        payload_len;
31030         /* IPv6 next header. */
31031         uint8_t next_hdr;
31032         /* IPv6 TTL. */
31033         uint8_t ttl;
31034         /* IPv6 source address. */
31035         uint32_t        src_ip_addr[4];
31036         /* IPv6 destination address. */
31037         uint32_t        dest_ip_addr[4];
31038 } __rte_packed;
31039
31040 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
31041 struct hwrm_cfa_encap_data_vxlan {
31042         /* Source MAC address. */
31043         uint8_t src_mac_addr[6];
31044         /* reserved. */
31045         uint16_t        unused_0;
31046         /* Destination MAC address. */
31047         uint8_t dst_mac_addr[6];
31048         /* Number of VLAN tags. */
31049         uint8_t num_vlan_tags;
31050         /* reserved. */
31051         uint8_t unused_1;
31052         /* Outer VLAN TPID. */
31053         uint16_t        ovlan_tpid;
31054         /* Outer VLAN TCI. */
31055         uint16_t        ovlan_tci;
31056         /* Inner VLAN TPID. */
31057         uint16_t        ivlan_tpid;
31058         /* Inner VLAN TCI. */
31059         uint16_t        ivlan_tci;
31060         /* L3 header fields. */
31061         uint32_t        l3[10];
31062         /* IP version mask. */
31063         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
31064         /* IP version 4. */
31065         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
31066         /* IP version 6. */
31067         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
31068         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
31069                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
31070         /* UDP source port. */
31071         uint16_t        src_port;
31072         /* UDP destination port. */
31073         uint16_t        dst_port;
31074         /* VXLAN Network Identifier. */
31075         uint32_t        vni;
31076         /* 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN header. */
31077         uint8_t hdr_rsvd0[3];
31078         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
31079         uint8_t hdr_rsvd1;
31080         /* VXLAN header flags field. */
31081         uint8_t hdr_flags;
31082         uint8_t unused[3];
31083 } __rte_packed;
31084
31085 /*******************************
31086  * hwrm_cfa_encap_record_alloc *
31087  *******************************/
31088
31089
31090 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
31091 struct hwrm_cfa_encap_record_alloc_input {
31092         /* The HWRM command request type. */
31093         uint16_t        req_type;
31094         /*
31095          * The completion ring to send the completion event on. This should
31096          * be the NQ ID returned from the `nq_alloc` HWRM command.
31097          */
31098         uint16_t        cmpl_ring;
31099         /*
31100          * The sequence ID is used by the driver for tracking multiple
31101          * commands. This ID is treated as opaque data by the firmware and
31102          * the value is returned in the `hwrm_resp_hdr` upon completion.
31103          */
31104         uint16_t        seq_id;
31105         /*
31106          * The target ID of the command:
31107          * * 0x0-0xFFF8 - The function ID
31108          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31109          * * 0xFFFD - Reserved for user-space HWRM interface
31110          * * 0xFFFF - HWRM
31111          */
31112         uint16_t        target_id;
31113         /*
31114          * A physical address pointer pointing to a host buffer that the
31115          * command's response data will be written. This can be either a host
31116          * physical address (HPA) or a guest physical address (GPA) and must
31117          * point to a physically contiguous block of memory.
31118          */
31119         uint64_t        resp_addr;
31120         uint32_t        flags;
31121         /* Setting of this flag indicates the applicability to the loopback path. */
31122         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
31123                 UINT32_C(0x1)
31124         /*
31125          * Setting of this flag indicates this encap record is external encap record.
31126          * Resetting of this flag indicates this flag is internal encap record and
31127          * this is the default setting.
31128          */
31129         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL \
31130                 UINT32_C(0x2)
31131         /* Encapsulation Type. */
31132         uint8_t encap_type;
31133         /* Virtual eXtensible Local Area Network (VXLAN) */
31134         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
31135                 UINT32_C(0x1)
31136         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
31137         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
31138                 UINT32_C(0x2)
31139         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
31140         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
31141                 UINT32_C(0x3)
31142         /* IP in IP */
31143         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
31144                 UINT32_C(0x4)
31145         /* Generic Network Virtualization Encapsulation (Geneve) */
31146         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
31147                 UINT32_C(0x5)
31148         /* Multi-Protocol Label Switching (MPLS) */
31149         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
31150                 UINT32_C(0x6)
31151         /* VLAN */
31152         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
31153                 UINT32_C(0x7)
31154         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
31155         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
31156                 UINT32_C(0x8)
31157         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
31158         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
31159                 UINT32_C(0x9)
31160         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
31161         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
31162                 UINT32_C(0xa)
31163         /* Use fixed layer 2 ether type of 0xFFFF */
31164         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
31165                 UINT32_C(0xb)
31166         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
31167         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 \
31168                 UINT32_C(0xc)
31169         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
31170                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
31171         uint8_t unused_0[3];
31172         /* This value is encap data used for the given encap type. */
31173         uint32_t        encap_data[20];
31174 } __rte_packed;
31175
31176 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
31177 struct hwrm_cfa_encap_record_alloc_output {
31178         /* The specific error status for the command. */
31179         uint16_t        error_code;
31180         /* The HWRM command request type. */
31181         uint16_t        req_type;
31182         /* The sequence ID from the original command. */
31183         uint16_t        seq_id;
31184         /* The length of the response data in number of bytes. */
31185         uint16_t        resp_len;
31186         /* This value is an opaque id into CFA data structures. */
31187         uint32_t        encap_record_id;
31188         uint8_t unused_0[3];
31189         /*
31190          * This field is used in Output records to indicate that the output
31191          * is completely written to RAM. This field should be read as '1'
31192          * to indicate that the output has been completely written.
31193          * When writing a command completion or response to an internal processor,
31194          * the order of writes has to be such that this field is written last.
31195          */
31196         uint8_t valid;
31197 } __rte_packed;
31198
31199 /******************************
31200  * hwrm_cfa_encap_record_free *
31201  ******************************/
31202
31203
31204 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
31205 struct hwrm_cfa_encap_record_free_input {
31206         /* The HWRM command request type. */
31207         uint16_t        req_type;
31208         /*
31209          * The completion ring to send the completion event on. This should
31210          * be the NQ ID returned from the `nq_alloc` HWRM command.
31211          */
31212         uint16_t        cmpl_ring;
31213         /*
31214          * The sequence ID is used by the driver for tracking multiple
31215          * commands. This ID is treated as opaque data by the firmware and
31216          * the value is returned in the `hwrm_resp_hdr` upon completion.
31217          */
31218         uint16_t        seq_id;
31219         /*
31220          * The target ID of the command:
31221          * * 0x0-0xFFF8 - The function ID
31222          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31223          * * 0xFFFD - Reserved for user-space HWRM interface
31224          * * 0xFFFF - HWRM
31225          */
31226         uint16_t        target_id;
31227         /*
31228          * A physical address pointer pointing to a host buffer that the
31229          * command's response data will be written. This can be either a host
31230          * physical address (HPA) or a guest physical address (GPA) and must
31231          * point to a physically contiguous block of memory.
31232          */
31233         uint64_t        resp_addr;
31234         /* This value is an opaque id into CFA data structures. */
31235         uint32_t        encap_record_id;
31236         uint8_t unused_0[4];
31237 } __rte_packed;
31238
31239 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
31240 struct hwrm_cfa_encap_record_free_output {
31241         /* The specific error status for the command. */
31242         uint16_t        error_code;
31243         /* The HWRM command request type. */
31244         uint16_t        req_type;
31245         /* The sequence ID from the original command. */
31246         uint16_t        seq_id;
31247         /* The length of the response data in number of bytes. */
31248         uint16_t        resp_len;
31249         uint8_t unused_0[7];
31250         /*
31251          * This field is used in Output records to indicate that the output
31252          * is completely written to RAM. This field should be read as '1'
31253          * to indicate that the output has been completely written.
31254          * When writing a command completion or response to an internal processor,
31255          * the order of writes has to be such that this field is written last.
31256          */
31257         uint8_t valid;
31258 } __rte_packed;
31259
31260 /********************************
31261  * hwrm_cfa_ntuple_filter_alloc *
31262  ********************************/
31263
31264
31265 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
31266 struct hwrm_cfa_ntuple_filter_alloc_input {
31267         /* The HWRM command request type. */
31268         uint16_t        req_type;
31269         /*
31270          * The completion ring to send the completion event on. This should
31271          * be the NQ ID returned from the `nq_alloc` HWRM command.
31272          */
31273         uint16_t        cmpl_ring;
31274         /*
31275          * The sequence ID is used by the driver for tracking multiple
31276          * commands. This ID is treated as opaque data by the firmware and
31277          * the value is returned in the `hwrm_resp_hdr` upon completion.
31278          */
31279         uint16_t        seq_id;
31280         /*
31281          * The target ID of the command:
31282          * * 0x0-0xFFF8 - The function ID
31283          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31284          * * 0xFFFD - Reserved for user-space HWRM interface
31285          * * 0xFFFF - HWRM
31286          */
31287         uint16_t        target_id;
31288         /*
31289          * A physical address pointer pointing to a host buffer that the
31290          * command's response data will be written. This can be either a host
31291          * physical address (HPA) or a guest physical address (GPA) and must
31292          * point to a physically contiguous block of memory.
31293          */
31294         uint64_t        resp_addr;
31295         uint32_t        flags;
31296         /* Setting of this flag indicates the applicability to the loopback path. */
31297         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
31298                 UINT32_C(0x1)
31299         /*
31300          * Setting of this flag indicates drop action. If this flag is not set,
31301          * then it should be considered accept action.
31302          */
31303         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
31304                 UINT32_C(0x2)
31305         /*
31306          * Setting of this flag indicates that a meter is expected to be attached
31307          * to this flow. This hint can be used when choosing the action record
31308          * format required for the flow.
31309          */
31310         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
31311                 UINT32_C(0x4)
31312         /*
31313          * Setting of this flag indicates that the dst_id field contains function ID.
31314          * If this is not set it indicates dest_id is VNIC or VPORT.
31315          */
31316         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID \
31317                 UINT32_C(0x8)
31318         /*
31319          * Setting of this flag indicates match on arp reply when ethertype is 0x0806.
31320          * If this is not set it indicates no specific arp opcode matching.
31321          */
31322         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_ARP_REPLY \
31323                 UINT32_C(0x10)
31324         /*
31325          * Setting of this flag indicates that the dst_id field contains RFS ring
31326          * table index. If this is not set it indicates dst_id is VNIC or VPORT
31327          * or function ID.  Note dest_fid and dest_rfs_ring_idx can’t be set at
31328          * the same time.
31329          */
31330         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX \
31331                 UINT32_C(0x20)
31332         uint32_t        enables;
31333         /*
31334          * This bit must be '1' for the l2_filter_id field to be
31335          * configured.
31336          */
31337         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
31338                 UINT32_C(0x1)
31339         /*
31340          * This bit must be '1' for the ethertype field to be
31341          * configured.
31342          */
31343         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
31344                 UINT32_C(0x2)
31345         /*
31346          * This bit must be '1' for the tunnel_type field to be
31347          * configured.
31348          */
31349         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
31350                 UINT32_C(0x4)
31351         /*
31352          * This bit must be '1' for the src_macaddr field to be
31353          * configured.
31354          */
31355         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
31356                 UINT32_C(0x8)
31357         /*
31358          * This bit must be '1' for the ipaddr_type field to be
31359          * configured.
31360          */
31361         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
31362                 UINT32_C(0x10)
31363         /*
31364          * This bit must be '1' for the src_ipaddr field to be
31365          * configured.
31366          */
31367         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
31368                 UINT32_C(0x20)
31369         /*
31370          * This bit must be '1' for the src_ipaddr_mask field to be
31371          * configured.
31372          */
31373         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
31374                 UINT32_C(0x40)
31375         /*
31376          * This bit must be '1' for the dst_ipaddr field to be
31377          * configured.
31378          */
31379         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
31380                 UINT32_C(0x80)
31381         /*
31382          * This bit must be '1' for the dst_ipaddr_mask field to be
31383          * configured.
31384          */
31385         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
31386                 UINT32_C(0x100)
31387         /*
31388          * This bit must be '1' for the ip_protocol field to be
31389          * configured.
31390          */
31391         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
31392                 UINT32_C(0x200)
31393         /*
31394          * This bit must be '1' for the src_port field to be
31395          * configured.
31396          */
31397         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
31398                 UINT32_C(0x400)
31399         /*
31400          * This bit must be '1' for the src_port_mask field to be
31401          * configured.
31402          */
31403         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
31404                 UINT32_C(0x800)
31405         /*
31406          * This bit must be '1' for the dst_port field to be
31407          * configured.
31408          */
31409         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
31410                 UINT32_C(0x1000)
31411         /*
31412          * This bit must be '1' for the dst_port_mask field to be
31413          * configured.
31414          */
31415         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
31416                 UINT32_C(0x2000)
31417         /*
31418          * This bit must be '1' for the pri_hint field to be
31419          * configured.
31420          */
31421         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
31422                 UINT32_C(0x4000)
31423         /*
31424          * This bit must be '1' for the ntuple_filter_id field to be
31425          * configured.
31426          */
31427         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
31428                 UINT32_C(0x8000)
31429         /*
31430          * This bit must be '1' for the dst_id field to be
31431          * configured.
31432          */
31433         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
31434                 UINT32_C(0x10000)
31435         /*
31436          * This bit must be '1' for the mirror_vnic_id field to be
31437          * configured.
31438          */
31439         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
31440                 UINT32_C(0x20000)
31441         /*
31442          * This bit must be '1' for the dst_macaddr field to be
31443          * configured.
31444          */
31445         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
31446                 UINT32_C(0x40000)
31447         /* This flag is deprecated. */
31448         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX \
31449                 UINT32_C(0x80000)
31450         /*
31451          * This value identifies a set of CFA data structures used for an L2
31452          * context.
31453          */
31454         uint64_t        l2_filter_id;
31455         /*
31456          * This value indicates the source MAC address in
31457          * the Ethernet header.
31458          */
31459         uint8_t src_macaddr[6];
31460         /* This value indicates the ethertype in the Ethernet header. */
31461         uint16_t        ethertype;
31462         /*
31463          * This value indicates the type of IP address.
31464          * 4 - IPv4
31465          * 6 - IPv6
31466          * All others are invalid.
31467          */
31468         uint8_t ip_addr_type;
31469         /* invalid */
31470         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
31471                 UINT32_C(0x0)
31472         /* IPv4 */
31473         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
31474                 UINT32_C(0x4)
31475         /* IPv6 */
31476         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
31477                 UINT32_C(0x6)
31478         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
31479                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
31480         /*
31481          * The value of protocol filed in IP header.
31482          * Applies to UDP and TCP traffic.
31483          * 6 - TCP
31484          * 17 - UDP
31485          */
31486         uint8_t ip_protocol;
31487         /* invalid */
31488         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
31489                 UINT32_C(0x0)
31490         /* TCP */
31491         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
31492                 UINT32_C(0x6)
31493         /* UDP */
31494         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
31495                 UINT32_C(0x11)
31496         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
31497                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
31498         /*
31499          * If set, this value shall represent the
31500          * Logical VNIC ID of the destination VNIC for the RX
31501          * path and network port id of the destination port for
31502          * the TX path.
31503          */
31504         uint16_t        dst_id;
31505         /*
31506          * Logical VNIC ID of the VNIC where traffic is
31507          * mirrored.
31508          */
31509         uint16_t        mirror_vnic_id;
31510         /*
31511          * This value indicates the tunnel type for this filter.
31512          * If this field is not specified, then the filter shall
31513          * apply to both non-tunneled and tunneled packets.
31514          * If this field conflicts with the tunnel_type specified
31515          * in the l2_filter_id, then the HWRM shall return an
31516          * error for this command.
31517          */
31518         uint8_t tunnel_type;
31519         /* Non-tunnel */
31520         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
31521                 UINT32_C(0x0)
31522         /* Virtual eXtensible Local Area Network (VXLAN) */
31523         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
31524                 UINT32_C(0x1)
31525         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
31526         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
31527                 UINT32_C(0x2)
31528         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
31529         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
31530                 UINT32_C(0x3)
31531         /* IP in IP */
31532         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
31533                 UINT32_C(0x4)
31534         /* Generic Network Virtualization Encapsulation (Geneve) */
31535         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
31536                 UINT32_C(0x5)
31537         /* Multi-Protocol Label Switching (MPLS) */
31538         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
31539                 UINT32_C(0x6)
31540         /* Stateless Transport Tunnel (STT) */
31541         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
31542                 UINT32_C(0x7)
31543         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
31544         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
31545                 UINT32_C(0x8)
31546         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
31547         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
31548                 UINT32_C(0x9)
31549         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
31550         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
31551                 UINT32_C(0xa)
31552         /* Use fixed layer 2 ether type of 0xFFFF */
31553         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
31554                 UINT32_C(0xb)
31555         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
31556         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
31557                 UINT32_C(0xc)
31558         /* Any tunneled traffic */
31559         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
31560                 UINT32_C(0xff)
31561         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
31562                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
31563         /*
31564          * This hint is provided to help in placing
31565          * the filter in the filter table.
31566          */
31567         uint8_t pri_hint;
31568         /* No preference */
31569         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
31570                 UINT32_C(0x0)
31571         /* Above the given filter */
31572         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
31573                 UINT32_C(0x1)
31574         /* Below the given filter */
31575         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
31576                 UINT32_C(0x2)
31577         /* As high as possible */
31578         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
31579                 UINT32_C(0x3)
31580         /* As low as possible */
31581         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
31582                 UINT32_C(0x4)
31583         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
31584                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
31585         /*
31586          * The value of source IP address to be used in filtering.
31587          * For IPv4, first four bytes represent the IP address.
31588          */
31589         uint32_t        src_ipaddr[4];
31590         /*
31591          * The value of source IP address mask to be used in
31592          * filtering.
31593          * For IPv4, first four bytes represent the IP address mask.
31594          */
31595         uint32_t        src_ipaddr_mask[4];
31596         /*
31597          * The value of destination IP address to be used in filtering.
31598          * For IPv4, first four bytes represent the IP address.
31599          */
31600         uint32_t        dst_ipaddr[4];
31601         /*
31602          * The value of destination IP address mask to be used in
31603          * filtering.
31604          * For IPv4, first four bytes represent the IP address mask.
31605          */
31606         uint32_t        dst_ipaddr_mask[4];
31607         /*
31608          * The value of source port to be used in filtering.
31609          * Applies to UDP and TCP traffic.
31610          */
31611         uint16_t        src_port;
31612         /*
31613          * The value of source port mask to be used in filtering.
31614          * Applies to UDP and TCP traffic.
31615          */
31616         uint16_t        src_port_mask;
31617         /*
31618          * The value of destination port to be used in filtering.
31619          * Applies to UDP and TCP traffic.
31620          */
31621         uint16_t        dst_port;
31622         /*
31623          * The value of destination port mask to be used in
31624          * filtering.
31625          * Applies to UDP and TCP traffic.
31626          */
31627         uint16_t        dst_port_mask;
31628         /*
31629          * This is the ID of the filter that goes along with
31630          * the pri_hint.
31631          */
31632         uint64_t        ntuple_filter_id_hint;
31633 } __rte_packed;
31634
31635 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
31636 struct hwrm_cfa_ntuple_filter_alloc_output {
31637         /* The specific error status for the command. */
31638         uint16_t        error_code;
31639         /* The HWRM command request type. */
31640         uint16_t        req_type;
31641         /* The sequence ID from the original command. */
31642         uint16_t        seq_id;
31643         /* The length of the response data in number of bytes. */
31644         uint16_t        resp_len;
31645         /* This value is an opaque id into CFA data structures. */
31646         uint64_t        ntuple_filter_id;
31647         /*
31648          * The flow id value in bit 0-29 is the actual ID of the flow
31649          * associated with this filter and it shall be used to match
31650          * and associate the flow identifier returned in completion
31651          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
31652          * shall indicate no valid flow id.
31653          */
31654         uint32_t        flow_id;
31655         /* Indicate the flow id value. */
31656         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
31657                 UINT32_C(0x3fffffff)
31658         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
31659         /* Indicate type of the flow. */
31660         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
31661                 UINT32_C(0x40000000)
31662         /*
31663          * If this bit set to 0, then it indicates that the flow is
31664          * internal flow.
31665          */
31666         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
31667                 (UINT32_C(0x0) << 30)
31668         /*
31669          * If this bit is set to 1, then it indicates that the flow is
31670          * external flow.
31671          */
31672         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
31673                 (UINT32_C(0x1) << 30)
31674         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
31675                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
31676         /* Indicate the flow direction. */
31677         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
31678                 UINT32_C(0x80000000)
31679         /* If this bit set to 0, then it indicates rx flow. */
31680         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
31681                 (UINT32_C(0x0) << 31)
31682         /* If this bit is set to 1, then it indicates that tx flow. */
31683         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
31684                 (UINT32_C(0x1) << 31)
31685         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
31686                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
31687         uint8_t unused_0[3];
31688         /*
31689          * This field is used in Output records to indicate that the output
31690          * is completely written to RAM. This field should be read as '1'
31691          * to indicate that the output has been completely written.
31692          * When writing a command completion or response to an internal processor,
31693          * the order of writes has to be such that this field is written last.
31694          */
31695         uint8_t valid;
31696 } __rte_packed;
31697
31698 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
31699 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
31700         /*
31701          * command specific error codes that goes to
31702          * the cmd_err field in Common HWRM Error Response.
31703          */
31704         uint8_t code;
31705         /* Unknown error */
31706         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
31707                 UINT32_C(0x0)
31708         /* Unable to complete operation due to conflict with Rx Mask VLAN */
31709         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
31710                 UINT32_C(0x1)
31711         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
31712                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
31713         uint8_t unused_0[7];
31714 } __rte_packed;
31715
31716 /*******************************
31717  * hwrm_cfa_ntuple_filter_free *
31718  *******************************/
31719
31720
31721 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
31722 struct hwrm_cfa_ntuple_filter_free_input {
31723         /* The HWRM command request type. */
31724         uint16_t        req_type;
31725         /*
31726          * The completion ring to send the completion event on. This should
31727          * be the NQ ID returned from the `nq_alloc` HWRM command.
31728          */
31729         uint16_t        cmpl_ring;
31730         /*
31731          * The sequence ID is used by the driver for tracking multiple
31732          * commands. This ID is treated as opaque data by the firmware and
31733          * the value is returned in the `hwrm_resp_hdr` upon completion.
31734          */
31735         uint16_t        seq_id;
31736         /*
31737          * The target ID of the command:
31738          * * 0x0-0xFFF8 - The function ID
31739          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31740          * * 0xFFFD - Reserved for user-space HWRM interface
31741          * * 0xFFFF - HWRM
31742          */
31743         uint16_t        target_id;
31744         /*
31745          * A physical address pointer pointing to a host buffer that the
31746          * command's response data will be written. This can be either a host
31747          * physical address (HPA) or a guest physical address (GPA) and must
31748          * point to a physically contiguous block of memory.
31749          */
31750         uint64_t        resp_addr;
31751         /* This value is an opaque id into CFA data structures. */
31752         uint64_t        ntuple_filter_id;
31753 } __rte_packed;
31754
31755 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
31756 struct hwrm_cfa_ntuple_filter_free_output {
31757         /* The specific error status for the command. */
31758         uint16_t        error_code;
31759         /* The HWRM command request type. */
31760         uint16_t        req_type;
31761         /* The sequence ID from the original command. */
31762         uint16_t        seq_id;
31763         /* The length of the response data in number of bytes. */
31764         uint16_t        resp_len;
31765         uint8_t unused_0[7];
31766         /*
31767          * This field is used in Output records to indicate that the output
31768          * is completely written to RAM. This field should be read as '1'
31769          * to indicate that the output has been completely written.
31770          * When writing a command completion or response to an internal processor,
31771          * the order of writes has to be such that this field is written last.
31772          */
31773         uint8_t valid;
31774 } __rte_packed;
31775
31776 /******************************
31777  * hwrm_cfa_ntuple_filter_cfg *
31778  ******************************/
31779
31780
31781 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
31782 struct hwrm_cfa_ntuple_filter_cfg_input {
31783         /* The HWRM command request type. */
31784         uint16_t        req_type;
31785         /*
31786          * The completion ring to send the completion event on. This should
31787          * be the NQ ID returned from the `nq_alloc` HWRM command.
31788          */
31789         uint16_t        cmpl_ring;
31790         /*
31791          * The sequence ID is used by the driver for tracking multiple
31792          * commands. This ID is treated as opaque data by the firmware and
31793          * the value is returned in the `hwrm_resp_hdr` upon completion.
31794          */
31795         uint16_t        seq_id;
31796         /*
31797          * The target ID of the command:
31798          * * 0x0-0xFFF8 - The function ID
31799          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31800          * * 0xFFFD - Reserved for user-space HWRM interface
31801          * * 0xFFFF - HWRM
31802          */
31803         uint16_t        target_id;
31804         /*
31805          * A physical address pointer pointing to a host buffer that the
31806          * command's response data will be written. This can be either a host
31807          * physical address (HPA) or a guest physical address (GPA) and must
31808          * point to a physically contiguous block of memory.
31809          */
31810         uint64_t        resp_addr;
31811         uint32_t        enables;
31812         /*
31813          * This bit must be '1' for the new_dst_id field to be
31814          * configured.
31815          */
31816         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
31817                 UINT32_C(0x1)
31818         /*
31819          * This bit must be '1' for the new_mirror_vnic_id field to be
31820          * configured.
31821          */
31822         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
31823                 UINT32_C(0x2)
31824         /*
31825          * This bit must be '1' for the new_meter_instance_id field to be
31826          * configured.
31827          */
31828         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
31829                 UINT32_C(0x4)
31830         uint32_t        flags;
31831         /*
31832          * Setting this bit to 1 indicates that dest_id field contains FID.
31833          * Setting this to 0 indicates that dest_id field contains VNIC or VPORT.
31834          */
31835         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID \
31836                 UINT32_C(0x1)
31837         /*
31838          * Setting of this flag indicates that the new_dst_id field contains
31839          * RFS ring table index. If this is not set it indicates new_dst_id is
31840          * VNIC or VPORT or function ID.  Note dest_fid and dest_rfs_ring_idx
31841          * can’t be set at the same time.
31842          */
31843         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_RFS_RING_IDX \
31844                 UINT32_C(0x2)
31845         /* This value is an opaque id into CFA data structures. */
31846         uint64_t        ntuple_filter_id;
31847         /*
31848          * If set, this value shall represent the new
31849          * Logical VNIC ID of the destination VNIC for the RX
31850          * path and new network port id of the destination port for
31851          * the TX path.
31852          */
31853         uint32_t        new_dst_id;
31854         /*
31855          * New Logical VNIC ID of the VNIC where traffic is
31856          * mirrored.
31857          */
31858         uint32_t        new_mirror_vnic_id;
31859         /*
31860          * New meter to attach to the flow. Specifying the
31861          * invalid instance ID is used to remove any existing
31862          * meter from the flow.
31863          */
31864         uint16_t        new_meter_instance_id;
31865         /*
31866          * A value of 0xfff is considered invalid and implies the
31867          * instance is not configured.
31868          */
31869         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
31870                 UINT32_C(0xffff)
31871         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
31872                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
31873         uint8_t unused_1[6];
31874 } __rte_packed;
31875
31876 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
31877 struct hwrm_cfa_ntuple_filter_cfg_output {
31878         /* The specific error status for the command. */
31879         uint16_t        error_code;
31880         /* The HWRM command request type. */
31881         uint16_t        req_type;
31882         /* The sequence ID from the original command. */
31883         uint16_t        seq_id;
31884         /* The length of the response data in number of bytes. */
31885         uint16_t        resp_len;
31886         uint8_t unused_0[7];
31887         /*
31888          * This field is used in Output records to indicate that the output
31889          * is completely written to RAM. This field should be read as '1'
31890          * to indicate that the output has been completely written.
31891          * When writing a command completion or response to an internal processor,
31892          * the order of writes has to be such that this field is written last.
31893          */
31894         uint8_t valid;
31895 } __rte_packed;
31896
31897 /**************************
31898  * hwrm_cfa_em_flow_alloc *
31899  **************************/
31900
31901
31902 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
31903 struct hwrm_cfa_em_flow_alloc_input {
31904         /* The HWRM command request type. */
31905         uint16_t        req_type;
31906         /*
31907          * The completion ring to send the completion event on. This should
31908          * be the NQ ID returned from the `nq_alloc` HWRM command.
31909          */
31910         uint16_t        cmpl_ring;
31911         /*
31912          * The sequence ID is used by the driver for tracking multiple
31913          * commands. This ID is treated as opaque data by the firmware and
31914          * the value is returned in the `hwrm_resp_hdr` upon completion.
31915          */
31916         uint16_t        seq_id;
31917         /*
31918          * The target ID of the command:
31919          * * 0x0-0xFFF8 - The function ID
31920          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31921          * * 0xFFFD - Reserved for user-space HWRM interface
31922          * * 0xFFFF - HWRM
31923          */
31924         uint16_t        target_id;
31925         /*
31926          * A physical address pointer pointing to a host buffer that the
31927          * command's response data will be written. This can be either a host
31928          * physical address (HPA) or a guest physical address (GPA) and must
31929          * point to a physically contiguous block of memory.
31930          */
31931         uint64_t        resp_addr;
31932         uint32_t        flags;
31933         /*
31934          * Enumeration denoting the RX, TX type of the resource.
31935          * This enumeration is used for resources that are similar for both
31936          * TX and RX paths of the chip.
31937          */
31938         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
31939         /* tx path */
31940         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
31941         /* rx path */
31942         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
31943         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
31944                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
31945         /*
31946          * Setting of this flag indicates enabling of a byte counter for a given
31947          * flow.
31948          */
31949         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
31950         /*
31951          * Setting of this flag indicates enabling of a packet counter for a given
31952          * flow.
31953          */
31954         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
31955         /* Setting of this flag indicates de-capsulation action for the given flow. */
31956         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
31957         /* Setting of this flag indicates encapsulation action for the given flow. */
31958         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
31959         /*
31960          * Setting of this flag indicates drop action. If this flag is not set,
31961          * then it should be considered accept action.
31962          */
31963         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
31964         /*
31965          * Setting of this flag indicates that a meter is expected to be attached
31966          * to this flow. This hint can be used when choosing the action record
31967          * format required for the flow.
31968          */
31969         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
31970         uint32_t        enables;
31971         /*
31972          * This bit must be '1' for the l2_filter_id field to be
31973          * configured.
31974          */
31975         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
31976                 UINT32_C(0x1)
31977         /*
31978          * This bit must be '1' for the tunnel_type field to be
31979          * configured.
31980          */
31981         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
31982                 UINT32_C(0x2)
31983         /*
31984          * This bit must be '1' for the tunnel_id field to be
31985          * configured.
31986          */
31987         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
31988                 UINT32_C(0x4)
31989         /*
31990          * This bit must be '1' for the src_macaddr field to be
31991          * configured.
31992          */
31993         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
31994                 UINT32_C(0x8)
31995         /*
31996          * This bit must be '1' for the dst_macaddr field to be
31997          * configured.
31998          */
31999         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
32000                 UINT32_C(0x10)
32001         /*
32002          * This bit must be '1' for the ovlan_vid field to be
32003          * configured.
32004          */
32005         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
32006                 UINT32_C(0x20)
32007         /*
32008          * This bit must be '1' for the ivlan_vid field to be
32009          * configured.
32010          */
32011         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
32012                 UINT32_C(0x40)
32013         /*
32014          * This bit must be '1' for the ethertype field to be
32015          * configured.
32016          */
32017         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
32018                 UINT32_C(0x80)
32019         /*
32020          * This bit must be '1' for the src_ipaddr field to be
32021          * configured.
32022          */
32023         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
32024                 UINT32_C(0x100)
32025         /*
32026          * This bit must be '1' for the dst_ipaddr field to be
32027          * configured.
32028          */
32029         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
32030                 UINT32_C(0x200)
32031         /*
32032          * This bit must be '1' for the ipaddr_type field to be
32033          * configured.
32034          */
32035         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
32036                 UINT32_C(0x400)
32037         /*
32038          * This bit must be '1' for the ip_protocol field to be
32039          * configured.
32040          */
32041         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
32042                 UINT32_C(0x800)
32043         /*
32044          * This bit must be '1' for the src_port field to be
32045          * configured.
32046          */
32047         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
32048                 UINT32_C(0x1000)
32049         /*
32050          * This bit must be '1' for the dst_port field to be
32051          * configured.
32052          */
32053         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
32054                 UINT32_C(0x2000)
32055         /*
32056          * This bit must be '1' for the dst_id field to be
32057          * configured.
32058          */
32059         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
32060                 UINT32_C(0x4000)
32061         /*
32062          * This bit must be '1' for the mirror_vnic_id field to be
32063          * configured.
32064          */
32065         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
32066                 UINT32_C(0x8000)
32067         /*
32068          * This bit must be '1' for the encap_record_id field to be
32069          * configured.
32070          */
32071         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
32072                 UINT32_C(0x10000)
32073         /*
32074          * This bit must be '1' for the meter_instance_id field to be
32075          * configured.
32076          */
32077         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
32078                 UINT32_C(0x20000)
32079         /*
32080          * This value identifies a set of CFA data structures used for an L2
32081          * context.
32082          */
32083         uint64_t        l2_filter_id;
32084         /* Tunnel Type. */
32085         uint8_t tunnel_type;
32086         /* Non-tunnel */
32087         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
32088                 UINT32_C(0x0)
32089         /* Virtual eXtensible Local Area Network (VXLAN) */
32090         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
32091                 UINT32_C(0x1)
32092         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
32093         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
32094                 UINT32_C(0x2)
32095         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
32096         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
32097                 UINT32_C(0x3)
32098         /* IP in IP */
32099         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
32100                 UINT32_C(0x4)
32101         /* Generic Network Virtualization Encapsulation (Geneve) */
32102         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
32103                 UINT32_C(0x5)
32104         /* Multi-Protocol Label Switching (MPLS) */
32105         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
32106                 UINT32_C(0x6)
32107         /* Stateless Transport Tunnel (STT) */
32108         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
32109                 UINT32_C(0x7)
32110         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
32111         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
32112                 UINT32_C(0x8)
32113         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
32114         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
32115                 UINT32_C(0x9)
32116         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
32117         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
32118                 UINT32_C(0xa)
32119         /* Use fixed layer 2 ether type of 0xFFFF */
32120         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
32121                 UINT32_C(0xb)
32122         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
32123         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
32124                 UINT32_C(0xc)
32125         /* Any tunneled traffic */
32126         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
32127                 UINT32_C(0xff)
32128         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
32129                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
32130         uint8_t unused_0[3];
32131         /*
32132          * Tunnel identifier.
32133          * Virtual Network Identifier (VNI). Only valid with
32134          * tunnel_types VXLAN, NVGRE, and Geneve.
32135          * Only lower 24-bits of VNI field are used
32136          * in setting up the filter.
32137          */
32138         uint32_t        tunnel_id;
32139         /*
32140          * This value indicates the source MAC address in
32141          * the Ethernet header.
32142          */
32143         uint8_t src_macaddr[6];
32144         /* The meter instance to attach to the flow. */
32145         uint16_t        meter_instance_id;
32146         /*
32147          * A value of 0xfff is considered invalid and implies the
32148          * instance is not configured.
32149          */
32150         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
32151                 UINT32_C(0xffff)
32152         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
32153                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
32154         /*
32155          * This value indicates the destination MAC address in
32156          * the Ethernet header.
32157          */
32158         uint8_t dst_macaddr[6];
32159         /*
32160          * This value indicates the VLAN ID of the outer VLAN tag
32161          * in the Ethernet header.
32162          */
32163         uint16_t        ovlan_vid;
32164         /*
32165          * This value indicates the VLAN ID of the inner VLAN tag
32166          * in the Ethernet header.
32167          */
32168         uint16_t        ivlan_vid;
32169         /* This value indicates the ethertype in the Ethernet header. */
32170         uint16_t        ethertype;
32171         /*
32172          * This value indicates the type of IP address.
32173          * 4 - IPv4
32174          * 6 - IPv6
32175          * All others are invalid.
32176          */
32177         uint8_t ip_addr_type;
32178         /* invalid */
32179         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
32180         /* IPv4 */
32181         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
32182         /* IPv6 */
32183         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
32184         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
32185                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
32186         /*
32187          * The value of protocol filed in IP header.
32188          * Applies to UDP and TCP traffic.
32189          * 6 - TCP
32190          * 17 - UDP
32191          */
32192         uint8_t ip_protocol;
32193         /* invalid */
32194         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
32195         /* TCP */
32196         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
32197         /* UDP */
32198         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
32199         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
32200                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
32201         uint8_t unused_1[2];
32202         /*
32203          * The value of source IP address to be used in filtering.
32204          * For IPv4, first four bytes represent the IP address.
32205          */
32206         uint32_t        src_ipaddr[4];
32207         /*
32208          * big_endian = True
32209          *     The value of destination IP address to be used in filtering.
32210          *     For IPv4, first four bytes represent the IP address.
32211          */
32212         uint32_t        dst_ipaddr[4];
32213         /*
32214          * The value of source port to be used in filtering.
32215          * Applies to UDP and TCP traffic.
32216          */
32217         uint16_t        src_port;
32218         /*
32219          * The value of destination port to be used in filtering.
32220          * Applies to UDP and TCP traffic.
32221          */
32222         uint16_t        dst_port;
32223         /*
32224          * If set, this value shall represent the
32225          * Logical VNIC ID of the destination VNIC for the RX
32226          * path and network port id of the destination port for
32227          * the TX path.
32228          */
32229         uint16_t        dst_id;
32230         /*
32231          * Logical VNIC ID of the VNIC where traffic is
32232          * mirrored.
32233          */
32234         uint16_t        mirror_vnic_id;
32235         /* Logical ID of the encapsulation record. */
32236         uint32_t        encap_record_id;
32237         uint8_t unused_2[4];
32238 } __rte_packed;
32239
32240 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
32241 struct hwrm_cfa_em_flow_alloc_output {
32242         /* The specific error status for the command. */
32243         uint16_t        error_code;
32244         /* The HWRM command request type. */
32245         uint16_t        req_type;
32246         /* The sequence ID from the original command. */
32247         uint16_t        seq_id;
32248         /* The length of the response data in number of bytes. */
32249         uint16_t        resp_len;
32250         /* This value is an opaque id into CFA data structures. */
32251         uint64_t        em_filter_id;
32252         /*
32253          * The flow id value in bit 0-29 is the actual ID of the flow
32254          * associated with this filter and it shall be used to match
32255          * and associate the flow identifier returned in completion
32256          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
32257          * shall indicate no valid flow id.
32258          */
32259         uint32_t        flow_id;
32260         /* Indicate the flow id value. */
32261         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
32262                 UINT32_C(0x3fffffff)
32263         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
32264         /* Indicate type of the flow. */
32265         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
32266                 UINT32_C(0x40000000)
32267         /*
32268          * If this bit set to 0, then it indicates that the flow is
32269          * internal flow.
32270          */
32271         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
32272                 (UINT32_C(0x0) << 30)
32273         /*
32274          * If this bit is set to 1, then it indicates that the flow is
32275          * external flow.
32276          */
32277         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
32278                 (UINT32_C(0x1) << 30)
32279         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
32280                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
32281         /* Indicate the flow direction. */
32282         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
32283                 UINT32_C(0x80000000)
32284         /* If this bit set to 0, then it indicates rx flow. */
32285         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
32286                 (UINT32_C(0x0) << 31)
32287         /* If this bit is set to 1, then it indicates that tx flow. */
32288         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
32289                 (UINT32_C(0x1) << 31)
32290         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
32291                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
32292         uint8_t unused_0[3];
32293         /*
32294          * This field is used in Output records to indicate that the output
32295          * is completely written to RAM. This field should be read as '1'
32296          * to indicate that the output has been completely written.
32297          * When writing a command completion or response to an internal processor,
32298          * the order of writes has to be such that this field is written last.
32299          */
32300         uint8_t valid;
32301 } __rte_packed;
32302
32303 /*************************
32304  * hwrm_cfa_em_flow_free *
32305  *************************/
32306
32307
32308 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
32309 struct hwrm_cfa_em_flow_free_input {
32310         /* The HWRM command request type. */
32311         uint16_t        req_type;
32312         /*
32313          * The completion ring to send the completion event on. This should
32314          * be the NQ ID returned from the `nq_alloc` HWRM command.
32315          */
32316         uint16_t        cmpl_ring;
32317         /*
32318          * The sequence ID is used by the driver for tracking multiple
32319          * commands. This ID is treated as opaque data by the firmware and
32320          * the value is returned in the `hwrm_resp_hdr` upon completion.
32321          */
32322         uint16_t        seq_id;
32323         /*
32324          * The target ID of the command:
32325          * * 0x0-0xFFF8 - The function ID
32326          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32327          * * 0xFFFD - Reserved for user-space HWRM interface
32328          * * 0xFFFF - HWRM
32329          */
32330         uint16_t        target_id;
32331         /*
32332          * A physical address pointer pointing to a host buffer that the
32333          * command's response data will be written. This can be either a host
32334          * physical address (HPA) or a guest physical address (GPA) and must
32335          * point to a physically contiguous block of memory.
32336          */
32337         uint64_t        resp_addr;
32338         /* This value is an opaque id into CFA data structures. */
32339         uint64_t        em_filter_id;
32340 } __rte_packed;
32341
32342 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
32343 struct hwrm_cfa_em_flow_free_output {
32344         /* The specific error status for the command. */
32345         uint16_t        error_code;
32346         /* The HWRM command request type. */
32347         uint16_t        req_type;
32348         /* The sequence ID from the original command. */
32349         uint16_t        seq_id;
32350         /* The length of the response data in number of bytes. */
32351         uint16_t        resp_len;
32352         uint8_t unused_0[7];
32353         /*
32354          * This field is used in Output records to indicate that the output
32355          * is completely written to RAM. This field should be read as '1'
32356          * to indicate that the output has been completely written.
32357          * When writing a command completion or response to an internal processor,
32358          * the order of writes has to be such that this field is written last.
32359          */
32360         uint8_t valid;
32361 } __rte_packed;
32362
32363 /************************
32364  * hwrm_cfa_meter_qcaps *
32365  ************************/
32366
32367
32368 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
32369 struct hwrm_cfa_meter_qcaps_input {
32370         /* The HWRM command request type. */
32371         uint16_t        req_type;
32372         /*
32373          * The completion ring to send the completion event on. This should
32374          * be the NQ ID returned from the `nq_alloc` HWRM command.
32375          */
32376         uint16_t        cmpl_ring;
32377         /*
32378          * The sequence ID is used by the driver for tracking multiple
32379          * commands. This ID is treated as opaque data by the firmware and
32380          * the value is returned in the `hwrm_resp_hdr` upon completion.
32381          */
32382         uint16_t        seq_id;
32383         /*
32384          * The target ID of the command:
32385          * * 0x0-0xFFF8 - The function ID
32386          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32387          * * 0xFFFD - Reserved for user-space HWRM interface
32388          * * 0xFFFF - HWRM
32389          */
32390         uint16_t        target_id;
32391         /*
32392          * A physical address pointer pointing to a host buffer that the
32393          * command's response data will be written. This can be either a host
32394          * physical address (HPA) or a guest physical address (GPA) and must
32395          * point to a physically contiguous block of memory.
32396          */
32397         uint64_t        resp_addr;
32398 } __rte_packed;
32399
32400 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
32401 struct hwrm_cfa_meter_qcaps_output {
32402         /* The specific error status for the command. */
32403         uint16_t        error_code;
32404         /* The HWRM command request type. */
32405         uint16_t        req_type;
32406         /* The sequence ID from the original command. */
32407         uint16_t        seq_id;
32408         /* The length of the response data in number of bytes. */
32409         uint16_t        resp_len;
32410         uint32_t        flags;
32411         /*
32412          * Enumeration denoting the clock at which the Meter is running with.
32413          * This enumeration is used for resources that are similar for both
32414          * TX and RX paths of the chip.
32415          */
32416         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
32417         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
32418         /* 375 MHz */
32419         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
32420         /* 625 MHz */
32421         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
32422         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST \
32423                 HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
32424         uint8_t unused_0[4];
32425         /*
32426          * The minimum guaranteed number of tx meter profiles supported
32427          * for this function.
32428          */
32429         uint16_t        min_tx_profile;
32430         /*
32431          * The maximum non-guaranteed number of tx meter profiles supported
32432          * for this function.
32433          */
32434         uint16_t        max_tx_profile;
32435         /*
32436          * The minimum guaranteed number of rx meter profiles supported
32437          * for this function.
32438          */
32439         uint16_t        min_rx_profile;
32440         /*
32441          * The maximum non-guaranteed number of rx meter profiles supported
32442          * for this function.
32443          */
32444         uint16_t        max_rx_profile;
32445         /*
32446          * The minimum guaranteed number of tx meter instances supported
32447          * for this function.
32448          */
32449         uint16_t        min_tx_instance;
32450         /*
32451          * The maximum non-guaranteed number of tx meter instances supported
32452          * for this function.
32453          */
32454         uint16_t        max_tx_instance;
32455         /*
32456          * The minimum guaranteed number of rx meter instances supported
32457          * for this function.
32458          */
32459         uint16_t        min_rx_instance;
32460         /*
32461          * The maximum non-guaranteed number of rx meter instances supported
32462          * for this function.
32463          */
32464         uint16_t        max_rx_instance;
32465         uint8_t unused_1[7];
32466         /*
32467          * This field is used in Output records to indicate that the output
32468          * is completely written to RAM. This field should be read as '1'
32469          * to indicate that the output has been completely written.
32470          * When writing a command completion or response to an internal processor,
32471          * the order of writes has to be such that this field is written last.
32472          */
32473         uint8_t valid;
32474 } __rte_packed;
32475
32476 /********************************
32477  * hwrm_cfa_meter_profile_alloc *
32478  ********************************/
32479
32480
32481 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
32482 struct hwrm_cfa_meter_profile_alloc_input {
32483         /* The HWRM command request type. */
32484         uint16_t        req_type;
32485         /*
32486          * The completion ring to send the completion event on. This should
32487          * be the NQ ID returned from the `nq_alloc` HWRM command.
32488          */
32489         uint16_t        cmpl_ring;
32490         /*
32491          * The sequence ID is used by the driver for tracking multiple
32492          * commands. This ID is treated as opaque data by the firmware and
32493          * the value is returned in the `hwrm_resp_hdr` upon completion.
32494          */
32495         uint16_t        seq_id;
32496         /*
32497          * The target ID of the command:
32498          * * 0x0-0xFFF8 - The function ID
32499          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32500          * * 0xFFFD - Reserved for user-space HWRM interface
32501          * * 0xFFFF - HWRM
32502          */
32503         uint16_t        target_id;
32504         /*
32505          * A physical address pointer pointing to a host buffer that the
32506          * command's response data will be written. This can be either a host
32507          * physical address (HPA) or a guest physical address (GPA) and must
32508          * point to a physically contiguous block of memory.
32509          */
32510         uint64_t        resp_addr;
32511         uint8_t flags;
32512         /*
32513          * Enumeration denoting the RX, TX type of the resource.
32514          * This enumeration is used for resources that are similar for both
32515          * TX and RX paths of the chip.
32516          */
32517         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
32518         /* tx path */
32519         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
32520                 UINT32_C(0x0)
32521         /* rx path */
32522         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
32523                 UINT32_C(0x1)
32524         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
32525                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
32526         /* The meter algorithm type. */
32527         uint8_t meter_type;
32528         /* RFC 2697 (srTCM) */
32529         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
32530                 UINT32_C(0x0)
32531         /* RFC 2698 (trTCM) */
32532         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
32533                 UINT32_C(0x1)
32534         /* RFC 4115 (trTCM) */
32535         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
32536                 UINT32_C(0x2)
32537         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
32538                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
32539         /*
32540          * This field is reserved for the future use.
32541          * It shall be set to 0.
32542          */
32543         uint16_t        reserved1;
32544         /*
32545          * This field is reserved for the future use.
32546          * It shall be set to 0.
32547          */
32548         uint32_t        reserved2;
32549         /* A meter rate specified in bytes-per-second. */
32550         uint32_t        commit_rate;
32551         /* The bandwidth value. */
32552         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
32553                 UINT32_C(0xfffffff)
32554         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
32555                 0
32556         /* The granularity of the value (bits or bytes). */
32557         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
32558                 UINT32_C(0x10000000)
32559         /* Value is in bits. */
32560         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
32561                 (UINT32_C(0x0) << 28)
32562         /* Value is in bytes. */
32563         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
32564                 (UINT32_C(0x1) << 28)
32565         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
32566                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
32567         /* bw_value_unit is 3 b */
32568         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
32569                 UINT32_C(0xe0000000)
32570         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
32571                 29
32572         /* Value is in Mb or MB (base 10). */
32573         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
32574                 (UINT32_C(0x0) << 29)
32575         /* Value is in Kb or KB (base 10). */
32576         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
32577                 (UINT32_C(0x2) << 29)
32578         /* Value is in bits or bytes. */
32579         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
32580                 (UINT32_C(0x4) << 29)
32581         /* Value is in Gb or GB (base 10). */
32582         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
32583                 (UINT32_C(0x6) << 29)
32584         /* Value is in 1/100th of a percentage of total bandwidth. */
32585         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
32586                 (UINT32_C(0x1) << 29)
32587         /* Raw value */
32588         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
32589                 (UINT32_C(0x7) << 29)
32590         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
32591                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
32592         /* A meter burst size specified in bytes. */
32593         uint32_t        commit_burst;
32594         /* The bandwidth value. */
32595         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
32596                 UINT32_C(0xfffffff)
32597         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
32598                 0
32599         /* The granularity of the value (bits or bytes). */
32600         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
32601                 UINT32_C(0x10000000)
32602         /* Value is in bits. */
32603         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
32604                 (UINT32_C(0x0) << 28)
32605         /* Value is in bytes. */
32606         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
32607                 (UINT32_C(0x1) << 28)
32608         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
32609                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
32610         /* bw_value_unit is 3 b */
32611         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
32612                 UINT32_C(0xe0000000)
32613         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
32614                 29
32615         /* Value is in Mb or MB (base 10). */
32616         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
32617                 (UINT32_C(0x0) << 29)
32618         /* Value is in Kb or KB (base 10). */
32619         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
32620                 (UINT32_C(0x2) << 29)
32621         /* Value is in bits or bytes. */
32622         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
32623                 (UINT32_C(0x4) << 29)
32624         /* Value is in Gb or GB (base 10). */
32625         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
32626                 (UINT32_C(0x6) << 29)
32627         /* Value is in 1/100th of a percentage of total bandwidth. */
32628         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
32629                 (UINT32_C(0x1) << 29)
32630         /* Invalid value */
32631         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
32632                 (UINT32_C(0x7) << 29)
32633         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
32634                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
32635         /* A meter rate specified in bytes-per-second. */
32636         uint32_t        excess_peak_rate;
32637         /* The bandwidth value. */
32638         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
32639                 UINT32_C(0xfffffff)
32640         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
32641                 0
32642         /* The granularity of the value (bits or bytes). */
32643         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
32644                 UINT32_C(0x10000000)
32645         /* Value is in bits. */
32646         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
32647                 (UINT32_C(0x0) << 28)
32648         /* Value is in bytes. */
32649         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
32650                 (UINT32_C(0x1) << 28)
32651         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
32652                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
32653         /* bw_value_unit is 3 b */
32654         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
32655                 UINT32_C(0xe0000000)
32656         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
32657                 29
32658         /* Value is in Mb or MB (base 10). */
32659         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
32660                 (UINT32_C(0x0) << 29)
32661         /* Value is in Kb or KB (base 10). */
32662         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
32663                 (UINT32_C(0x2) << 29)
32664         /* Value is in bits or bytes. */
32665         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
32666                 (UINT32_C(0x4) << 29)
32667         /* Value is in Gb or GB (base 10). */
32668         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
32669                 (UINT32_C(0x6) << 29)
32670         /* Value is in 1/100th of a percentage of total bandwidth. */
32671         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
32672                 (UINT32_C(0x1) << 29)
32673         /* Raw unit */
32674         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
32675                 (UINT32_C(0x7) << 29)
32676         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
32677                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
32678         /* A meter burst size specified in bytes. */
32679         uint32_t        excess_peak_burst;
32680         /* The bandwidth value. */
32681         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
32682                 UINT32_C(0xfffffff)
32683         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
32684                 0
32685         /* The granularity of the value (bits or bytes). */
32686         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
32687                 UINT32_C(0x10000000)
32688         /* Value is in bits. */
32689         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
32690                 (UINT32_C(0x0) << 28)
32691         /* Value is in bytes. */
32692         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
32693                 (UINT32_C(0x1) << 28)
32694         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
32695                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
32696         /* bw_value_unit is 3 b */
32697         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
32698                 UINT32_C(0xe0000000)
32699         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
32700                 29
32701         /* Value is in Mb or MB (base 10). */
32702         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
32703                 (UINT32_C(0x0) << 29)
32704         /* Value is in Kb or KB (base 10). */
32705         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
32706                 (UINT32_C(0x2) << 29)
32707         /* Value is in bits or bytes. */
32708         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
32709                 (UINT32_C(0x4) << 29)
32710         /* Value is in Gb or GB (base 10). */
32711         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
32712                 (UINT32_C(0x6) << 29)
32713         /* Value is in 1/100th of a percentage of total bandwidth. */
32714         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
32715                 (UINT32_C(0x1) << 29)
32716         /* Invalid unit */
32717         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
32718                 (UINT32_C(0x7) << 29)
32719         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
32720                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
32721 } __rte_packed;
32722
32723 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
32724 struct hwrm_cfa_meter_profile_alloc_output {
32725         /* The specific error status for the command. */
32726         uint16_t        error_code;
32727         /* The HWRM command request type. */
32728         uint16_t        req_type;
32729         /* The sequence ID from the original command. */
32730         uint16_t        seq_id;
32731         /* The length of the response data in number of bytes. */
32732         uint16_t        resp_len;
32733         /* This value identifies a meter profile in CFA. */
32734         uint16_t        meter_profile_id;
32735         /*
32736          * A value of 0xfff is considered invalid and implies the
32737          * profile is not configured.
32738          */
32739         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
32740                 UINT32_C(0xffff)
32741         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
32742                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
32743         uint8_t unused_0[5];
32744         /*
32745          * This field is used in Output records to indicate that the output
32746          * is completely written to RAM. This field should be read as '1'
32747          * to indicate that the output has been completely written.
32748          * When writing a command completion or response to an internal processor,
32749          * the order of writes has to be such that this field is written last.
32750          */
32751         uint8_t valid;
32752 } __rte_packed;
32753
32754 /*******************************
32755  * hwrm_cfa_meter_profile_free *
32756  *******************************/
32757
32758
32759 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
32760 struct hwrm_cfa_meter_profile_free_input {
32761         /* The HWRM command request type. */
32762         uint16_t        req_type;
32763         /*
32764          * The completion ring to send the completion event on. This should
32765          * be the NQ ID returned from the `nq_alloc` HWRM command.
32766          */
32767         uint16_t        cmpl_ring;
32768         /*
32769          * The sequence ID is used by the driver for tracking multiple
32770          * commands. This ID is treated as opaque data by the firmware and
32771          * the value is returned in the `hwrm_resp_hdr` upon completion.
32772          */
32773         uint16_t        seq_id;
32774         /*
32775          * The target ID of the command:
32776          * * 0x0-0xFFF8 - The function ID
32777          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32778          * * 0xFFFD - Reserved for user-space HWRM interface
32779          * * 0xFFFF - HWRM
32780          */
32781         uint16_t        target_id;
32782         /*
32783          * A physical address pointer pointing to a host buffer that the
32784          * command's response data will be written. This can be either a host
32785          * physical address (HPA) or a guest physical address (GPA) and must
32786          * point to a physically contiguous block of memory.
32787          */
32788         uint64_t        resp_addr;
32789         uint8_t flags;
32790         /*
32791          * Enumeration denoting the RX, TX type of the resource.
32792          * This enumeration is used for resources that are similar for both
32793          * TX and RX paths of the chip.
32794          */
32795         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
32796         /* tx path */
32797         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
32798                 UINT32_C(0x0)
32799         /* rx path */
32800         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
32801                 UINT32_C(0x1)
32802         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
32803                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
32804         uint8_t unused_0;
32805         /* This value identifies a meter profile in CFA. */
32806         uint16_t        meter_profile_id;
32807         /*
32808          * A value of 0xfff is considered invalid and implies the
32809          * profile is not configured.
32810          */
32811         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
32812                 UINT32_C(0xffff)
32813         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
32814                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
32815         uint8_t unused_1[4];
32816 } __rte_packed;
32817
32818 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
32819 struct hwrm_cfa_meter_profile_free_output {
32820         /* The specific error status for the command. */
32821         uint16_t        error_code;
32822         /* The HWRM command request type. */
32823         uint16_t        req_type;
32824         /* The sequence ID from the original command. */
32825         uint16_t        seq_id;
32826         /* The length of the response data in number of bytes. */
32827         uint16_t        resp_len;
32828         uint8_t unused_0[7];
32829         /*
32830          * This field is used in Output records to indicate that the output
32831          * is completely written to RAM. This field should be read as '1'
32832          * to indicate that the output has been completely written.
32833          * When writing a command completion or response to an internal processor,
32834          * the order of writes has to be such that this field is written last.
32835          */
32836         uint8_t valid;
32837 } __rte_packed;
32838
32839 /******************************
32840  * hwrm_cfa_meter_profile_cfg *
32841  ******************************/
32842
32843
32844 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
32845 struct hwrm_cfa_meter_profile_cfg_input {
32846         /* The HWRM command request type. */
32847         uint16_t        req_type;
32848         /*
32849          * The completion ring to send the completion event on. This should
32850          * be the NQ ID returned from the `nq_alloc` HWRM command.
32851          */
32852         uint16_t        cmpl_ring;
32853         /*
32854          * The sequence ID is used by the driver for tracking multiple
32855          * commands. This ID is treated as opaque data by the firmware and
32856          * the value is returned in the `hwrm_resp_hdr` upon completion.
32857          */
32858         uint16_t        seq_id;
32859         /*
32860          * The target ID of the command:
32861          * * 0x0-0xFFF8 - The function ID
32862          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32863          * * 0xFFFD - Reserved for user-space HWRM interface
32864          * * 0xFFFF - HWRM
32865          */
32866         uint16_t        target_id;
32867         /*
32868          * A physical address pointer pointing to a host buffer that the
32869          * command's response data will be written. This can be either a host
32870          * physical address (HPA) or a guest physical address (GPA) and must
32871          * point to a physically contiguous block of memory.
32872          */
32873         uint64_t        resp_addr;
32874         uint8_t flags;
32875         /*
32876          * Enumeration denoting the RX, TX type of the resource.
32877          * This enumeration is used for resources that are similar for both
32878          * TX and RX paths of the chip.
32879          */
32880         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
32881         /* tx path */
32882         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
32883         /* rx path */
32884         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
32885         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
32886                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
32887         /* The meter algorithm type. */
32888         uint8_t meter_type;
32889         /* RFC 2697 (srTCM) */
32890         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
32891                 UINT32_C(0x0)
32892         /* RFC 2698 (trTCM) */
32893         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
32894                 UINT32_C(0x1)
32895         /* RFC 4115 (trTCM) */
32896         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
32897                 UINT32_C(0x2)
32898         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
32899                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
32900         /* This value identifies a meter profile in CFA. */
32901         uint16_t        meter_profile_id;
32902         /*
32903          * A value of 0xfff is considered invalid and implies the
32904          * profile is not configured.
32905          */
32906         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
32907                 UINT32_C(0xffff)
32908         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
32909                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
32910         /*
32911          * This field is reserved for the future use.
32912          * It shall be set to 0.
32913          */
32914         uint32_t        reserved;
32915         /* A meter rate specified in bytes-per-second. */
32916         uint32_t        commit_rate;
32917         /* The bandwidth value. */
32918         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
32919                 UINT32_C(0xfffffff)
32920         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
32921                 0
32922         /* The granularity of the value (bits or bytes). */
32923         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
32924                 UINT32_C(0x10000000)
32925         /* Value is in bits. */
32926         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
32927                 (UINT32_C(0x0) << 28)
32928         /* Value is in bytes. */
32929         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
32930                 (UINT32_C(0x1) << 28)
32931         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
32932                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
32933         /* bw_value_unit is 3 b */
32934         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
32935                 UINT32_C(0xe0000000)
32936         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
32937                 29
32938         /* Value is in Mb or MB (base 10). */
32939         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
32940                 (UINT32_C(0x0) << 29)
32941         /* Value is in Kb or KB (base 10). */
32942         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
32943                 (UINT32_C(0x2) << 29)
32944         /* Value is in bits or bytes. */
32945         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
32946                 (UINT32_C(0x4) << 29)
32947         /* Value is in Gb or GB (base 10). */
32948         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
32949                 (UINT32_C(0x6) << 29)
32950         /* Value is in 1/100th of a percentage of total bandwidth. */
32951         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
32952                 (UINT32_C(0x1) << 29)
32953         /* Raw value */
32954         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
32955                 (UINT32_C(0x7) << 29)
32956         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
32957                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
32958         /* A meter burst size specified in bytes. */
32959         uint32_t        commit_burst;
32960         /* The bandwidth value. */
32961         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
32962                 UINT32_C(0xfffffff)
32963         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
32964                 0
32965         /* The granularity of the value (bits or bytes). */
32966         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
32967                 UINT32_C(0x10000000)
32968         /* Value is in bits. */
32969         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
32970                 (UINT32_C(0x0) << 28)
32971         /* Value is in bytes. */
32972         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
32973                 (UINT32_C(0x1) << 28)
32974         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
32975                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
32976         /* bw_value_unit is 3 b */
32977         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
32978                 UINT32_C(0xe0000000)
32979         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
32980                 29
32981         /* Value is in Mb or MB (base 10). */
32982         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
32983                 (UINT32_C(0x0) << 29)
32984         /* Value is in Kb or KB (base 10). */
32985         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
32986                 (UINT32_C(0x2) << 29)
32987         /* Value is in bits or bytes. */
32988         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
32989                 (UINT32_C(0x4) << 29)
32990         /* Value is in Gb or GB (base 10). */
32991         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
32992                 (UINT32_C(0x6) << 29)
32993         /* Value is in 1/100th of a percentage of total bandwidth. */
32994         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
32995                 (UINT32_C(0x1) << 29)
32996         /* Invalid value */
32997         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
32998                 (UINT32_C(0x7) << 29)
32999         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
33000                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
33001         /* A meter rate specified in bytes-per-second. */
33002         uint32_t        excess_peak_rate;
33003         /* The bandwidth value. */
33004         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
33005                 UINT32_C(0xfffffff)
33006         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
33007                 0
33008         /* The granularity of the value (bits or bytes). */
33009         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
33010                 UINT32_C(0x10000000)
33011         /* Value is in bits. */
33012         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
33013                 (UINT32_C(0x0) << 28)
33014         /* Value is in bytes. */
33015         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
33016                 (UINT32_C(0x1) << 28)
33017         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
33018                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
33019         /* bw_value_unit is 3 b */
33020         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
33021                 UINT32_C(0xe0000000)
33022         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
33023                 29
33024         /* Value is in Mb or MB (base 10). */
33025         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
33026                 (UINT32_C(0x0) << 29)
33027         /* Value is in Kb or KB (base 10). */
33028         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
33029                 (UINT32_C(0x2) << 29)
33030         /* Value is in bits or bytes. */
33031         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
33032                 (UINT32_C(0x4) << 29)
33033         /* Value is in Gb or GB (base 10). */
33034         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
33035                 (UINT32_C(0x6) << 29)
33036         /* Value is in 1/100th of a percentage of total bandwidth. */
33037         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
33038                 (UINT32_C(0x1) << 29)
33039         /* Raw unit */
33040         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
33041                 (UINT32_C(0x7) << 29)
33042         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
33043                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
33044         /* A meter burst size specified in bytes. */
33045         uint32_t        excess_peak_burst;
33046         /* The bandwidth value. */
33047         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
33048                 UINT32_C(0xfffffff)
33049         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
33050                 0
33051         /* The granularity of the value (bits or bytes). */
33052         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
33053                 UINT32_C(0x10000000)
33054         /* Value is in bits. */
33055         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
33056                 (UINT32_C(0x0) << 28)
33057         /* Value is in bytes. */
33058         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
33059                 (UINT32_C(0x1) << 28)
33060         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
33061                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
33062         /* bw_value_unit is 3 b */
33063         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
33064                 UINT32_C(0xe0000000)
33065         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
33066                 29
33067         /* Value is in Mb or MB (base 10). */
33068         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
33069                 (UINT32_C(0x0) << 29)
33070         /* Value is in Kb or KB (base 10). */
33071         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
33072                 (UINT32_C(0x2) << 29)
33073         /* Value is in bits or bytes. */
33074         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
33075                 (UINT32_C(0x4) << 29)
33076         /* Value is in Gb or GB (base 10). */
33077         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
33078                 (UINT32_C(0x6) << 29)
33079         /* Value is in 1/100th of a percentage of total bandwidth. */
33080         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
33081                 (UINT32_C(0x1) << 29)
33082         /* Invalid unit */
33083         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
33084                 (UINT32_C(0x7) << 29)
33085         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
33086                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
33087 } __rte_packed;
33088
33089 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
33090 struct hwrm_cfa_meter_profile_cfg_output {
33091         /* The specific error status for the command. */
33092         uint16_t        error_code;
33093         /* The HWRM command request type. */
33094         uint16_t        req_type;
33095         /* The sequence ID from the original command. */
33096         uint16_t        seq_id;
33097         /* The length of the response data in number of bytes. */
33098         uint16_t        resp_len;
33099         uint8_t unused_0[7];
33100         /*
33101          * This field is used in Output records to indicate that the output
33102          * is completely written to RAM. This field should be read as '1'
33103          * to indicate that the output has been completely written.
33104          * When writing a command completion or response to an internal processor,
33105          * the order of writes has to be such that this field is written last.
33106          */
33107         uint8_t valid;
33108 } __rte_packed;
33109
33110 /*********************************
33111  * hwrm_cfa_meter_instance_alloc *
33112  *********************************/
33113
33114
33115 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
33116 struct hwrm_cfa_meter_instance_alloc_input {
33117         /* The HWRM command request type. */
33118         uint16_t        req_type;
33119         /*
33120          * The completion ring to send the completion event on. This should
33121          * be the NQ ID returned from the `nq_alloc` HWRM command.
33122          */
33123         uint16_t        cmpl_ring;
33124         /*
33125          * The sequence ID is used by the driver for tracking multiple
33126          * commands. This ID is treated as opaque data by the firmware and
33127          * the value is returned in the `hwrm_resp_hdr` upon completion.
33128          */
33129         uint16_t        seq_id;
33130         /*
33131          * The target ID of the command:
33132          * * 0x0-0xFFF8 - The function ID
33133          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33134          * * 0xFFFD - Reserved for user-space HWRM interface
33135          * * 0xFFFF - HWRM
33136          */
33137         uint16_t        target_id;
33138         /*
33139          * A physical address pointer pointing to a host buffer that the
33140          * command's response data will be written. This can be either a host
33141          * physical address (HPA) or a guest physical address (GPA) and must
33142          * point to a physically contiguous block of memory.
33143          */
33144         uint64_t        resp_addr;
33145         uint8_t flags;
33146         /*
33147          * Enumeration denoting the RX, TX type of the resource.
33148          * This enumeration is used for resources that are similar for both
33149          * TX and RX paths of the chip.
33150          */
33151         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
33152                 UINT32_C(0x1)
33153         /* tx path */
33154         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
33155                 UINT32_C(0x0)
33156         /* rx path */
33157         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
33158                 UINT32_C(0x1)
33159         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
33160                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
33161         uint8_t unused_0;
33162         /* This value identifies a meter profile in CFA. */
33163         uint16_t        meter_profile_id;
33164         /*
33165          * A value of 0xffff is considered invalid and implies the
33166          * profile is not configured.
33167          */
33168         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
33169                 UINT32_C(0xffff)
33170         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
33171                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
33172         uint8_t unused_1[4];
33173 } __rte_packed;
33174
33175 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
33176 struct hwrm_cfa_meter_instance_alloc_output {
33177         /* The specific error status for the command. */
33178         uint16_t        error_code;
33179         /* The HWRM command request type. */
33180         uint16_t        req_type;
33181         /* The sequence ID from the original command. */
33182         uint16_t        seq_id;
33183         /* The length of the response data in number of bytes. */
33184         uint16_t        resp_len;
33185         /* This value identifies a meter instance in CFA. */
33186         uint16_t        meter_instance_id;
33187         /*
33188          * A value of 0xffff is considered invalid and implies the
33189          * instance is not configured.
33190          */
33191         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
33192                 UINT32_C(0xffff)
33193         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
33194                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
33195         uint8_t unused_0[5];
33196         /*
33197          * This field is used in Output records to indicate that the output
33198          * is completely written to RAM. This field should be read as '1'
33199          * to indicate that the output has been completely written.
33200          * When writing a command completion or response to an internal processor,
33201          * the order of writes has to be such that this field is written last.
33202          */
33203         uint8_t valid;
33204 } __rte_packed;
33205
33206 /*******************************
33207  * hwrm_cfa_meter_instance_cfg *
33208  *******************************/
33209
33210
33211 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
33212 struct hwrm_cfa_meter_instance_cfg_input {
33213         /* The HWRM command request type. */
33214         uint16_t        req_type;
33215         /*
33216          * The completion ring to send the completion event on. This should
33217          * be the NQ ID returned from the `nq_alloc` HWRM command.
33218          */
33219         uint16_t        cmpl_ring;
33220         /*
33221          * The sequence ID is used by the driver for tracking multiple
33222          * commands. This ID is treated as opaque data by the firmware and
33223          * the value is returned in the `hwrm_resp_hdr` upon completion.
33224          */
33225         uint16_t        seq_id;
33226         /*
33227          * The target ID of the command:
33228          * * 0x0-0xFFF8 - The function ID
33229          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33230          * * 0xFFFD - Reserved for user-space HWRM interface
33231          * * 0xFFFF - HWRM
33232          */
33233         uint16_t        target_id;
33234         /*
33235          * A physical address pointer pointing to a host buffer that the
33236          * command's response data will be written. This can be either a host
33237          * physical address (HPA) or a guest physical address (GPA) and must
33238          * point to a physically contiguous block of memory.
33239          */
33240         uint64_t        resp_addr;
33241         uint8_t flags;
33242         /*
33243          * Enumeration denoting the RX, TX type of the resource.
33244          * This enumeration is used for resources that are similar for both
33245          * TX and RX paths of the chip.
33246          */
33247         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
33248         /* tx path */
33249         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX \
33250                 UINT32_C(0x0)
33251         /* rx path */
33252         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX \
33253                 UINT32_C(0x1)
33254         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST \
33255                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
33256         uint8_t unused_0;
33257         /*
33258          * This value identifies a new meter profile to be associated with
33259          * the meter instance specified in this command.
33260          */
33261         uint16_t        meter_profile_id;
33262         /*
33263          * A value of 0xffff is considered invalid and implies the
33264          * profile is not configured.
33265          */
33266         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID \
33267                 UINT32_C(0xffff)
33268         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST \
33269                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
33270         /*
33271          * This value identifies the ID of a meter instance that needs to be updated with
33272          * a new meter profile specified in this command.
33273          */
33274         uint16_t        meter_instance_id;
33275         uint8_t unused_1[2];
33276 } __rte_packed;
33277
33278 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
33279 struct hwrm_cfa_meter_instance_cfg_output {
33280         /* The specific error status for the command. */
33281         uint16_t        error_code;
33282         /* The HWRM command request type. */
33283         uint16_t        req_type;
33284         /* The sequence ID from the original command. */
33285         uint16_t        seq_id;
33286         /* The length of the response data in number of bytes. */
33287         uint16_t        resp_len;
33288         uint8_t unused_0[7];
33289         /*
33290          * This field is used in Output records to indicate that the output
33291          * is completely written to RAM. This field should be read as '1'
33292          * to indicate that the output has been completely written.
33293          * When writing a command completion or response to an internal processor,
33294          * the order of writes has to be such that this field is written last.
33295          */
33296         uint8_t valid;
33297 } __rte_packed;
33298
33299 /********************************
33300  * hwrm_cfa_meter_instance_free *
33301  ********************************/
33302
33303
33304 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
33305 struct hwrm_cfa_meter_instance_free_input {
33306         /* The HWRM command request type. */
33307         uint16_t        req_type;
33308         /*
33309          * The completion ring to send the completion event on. This should
33310          * be the NQ ID returned from the `nq_alloc` HWRM command.
33311          */
33312         uint16_t        cmpl_ring;
33313         /*
33314          * The sequence ID is used by the driver for tracking multiple
33315          * commands. This ID is treated as opaque data by the firmware and
33316          * the value is returned in the `hwrm_resp_hdr` upon completion.
33317          */
33318         uint16_t        seq_id;
33319         /*
33320          * The target ID of the command:
33321          * * 0x0-0xFFF8 - The function ID
33322          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33323          * * 0xFFFD - Reserved for user-space HWRM interface
33324          * * 0xFFFF - HWRM
33325          */
33326         uint16_t        target_id;
33327         /*
33328          * A physical address pointer pointing to a host buffer that the
33329          * command's response data will be written. This can be either a host
33330          * physical address (HPA) or a guest physical address (GPA) and must
33331          * point to a physically contiguous block of memory.
33332          */
33333         uint64_t        resp_addr;
33334         uint8_t flags;
33335         /*
33336          * Enumeration denoting the RX, TX type of the resource.
33337          * This enumeration is used for resources that are similar for both
33338          * TX and RX paths of the chip.
33339          */
33340         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
33341         /* tx path */
33342         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
33343                 UINT32_C(0x0)
33344         /* rx path */
33345         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
33346                 UINT32_C(0x1)
33347         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
33348                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
33349         uint8_t unused_0;
33350         /* This value identifies a meter instance in CFA. */
33351         uint16_t        meter_instance_id;
33352         /*
33353          * A value of 0xfff is considered invalid and implies the
33354          * instance is not configured.
33355          */
33356         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
33357                 UINT32_C(0xffff)
33358         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
33359                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
33360         uint8_t unused_1[4];
33361 } __rte_packed;
33362
33363 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
33364 struct hwrm_cfa_meter_instance_free_output {
33365         /* The specific error status for the command. */
33366         uint16_t        error_code;
33367         /* The HWRM command request type. */
33368         uint16_t        req_type;
33369         /* The sequence ID from the original command. */
33370         uint16_t        seq_id;
33371         /* The length of the response data in number of bytes. */
33372         uint16_t        resp_len;
33373         uint8_t unused_0[7];
33374         /*
33375          * This field is used in Output records to indicate that the output
33376          * is completely written to RAM. This field should be read as '1'
33377          * to indicate that the output has been completely written.
33378          * When writing a command completion or response to an internal processor,
33379          * the order of writes has to be such that this field is written last.
33380          */
33381         uint8_t valid;
33382 } __rte_packed;
33383
33384 /*******************************
33385  * hwrm_cfa_decap_filter_alloc *
33386  *******************************/
33387
33388
33389 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
33390 struct hwrm_cfa_decap_filter_alloc_input {
33391         /* The HWRM command request type. */
33392         uint16_t        req_type;
33393         /*
33394          * The completion ring to send the completion event on. This should
33395          * be the NQ ID returned from the `nq_alloc` HWRM command.
33396          */
33397         uint16_t        cmpl_ring;
33398         /*
33399          * The sequence ID is used by the driver for tracking multiple
33400          * commands. This ID is treated as opaque data by the firmware and
33401          * the value is returned in the `hwrm_resp_hdr` upon completion.
33402          */
33403         uint16_t        seq_id;
33404         /*
33405          * The target ID of the command:
33406          * * 0x0-0xFFF8 - The function ID
33407          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33408          * * 0xFFFD - Reserved for user-space HWRM interface
33409          * * 0xFFFF - HWRM
33410          */
33411         uint16_t        target_id;
33412         /*
33413          * A physical address pointer pointing to a host buffer that the
33414          * command's response data will be written. This can be either a host
33415          * physical address (HPA) or a guest physical address (GPA) and must
33416          * point to a physically contiguous block of memory.
33417          */
33418         uint64_t        resp_addr;
33419         uint32_t        flags;
33420         /* ovs_tunnel is 1 b */
33421         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
33422                 UINT32_C(0x1)
33423         uint32_t        enables;
33424         /*
33425          * This bit must be '1' for the tunnel_type field to be
33426          * configured.
33427          */
33428         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
33429                 UINT32_C(0x1)
33430         /*
33431          * This bit must be '1' for the tunnel_id field to be
33432          * configured.
33433          */
33434         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
33435                 UINT32_C(0x2)
33436         /*
33437          * This bit must be '1' for the src_macaddr field to be
33438          * configured.
33439          */
33440         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
33441                 UINT32_C(0x4)
33442         /*
33443          * This bit must be '1' for the dst_macaddr field to be
33444          * configured.
33445          */
33446         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
33447                 UINT32_C(0x8)
33448         /*
33449          * This bit must be '1' for the ovlan_vid field to be
33450          * configured.
33451          */
33452         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
33453                 UINT32_C(0x10)
33454         /*
33455          * This bit must be '1' for the ivlan_vid field to be
33456          * configured.
33457          */
33458         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
33459                 UINT32_C(0x20)
33460         /*
33461          * This bit must be '1' for the t_ovlan_vid field to be
33462          * configured.
33463          */
33464         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
33465                 UINT32_C(0x40)
33466         /*
33467          * This bit must be '1' for the t_ivlan_vid field to be
33468          * configured.
33469          */
33470         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
33471                 UINT32_C(0x80)
33472         /*
33473          * This bit must be '1' for the ethertype field to be
33474          * configured.
33475          */
33476         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
33477                 UINT32_C(0x100)
33478         /*
33479          * This bit must be '1' for the src_ipaddr field to be
33480          * configured.
33481          */
33482         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
33483                 UINT32_C(0x200)
33484         /*
33485          * This bit must be '1' for the dst_ipaddr field to be
33486          * configured.
33487          */
33488         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
33489                 UINT32_C(0x400)
33490         /*
33491          * This bit must be '1' for the ipaddr_type field to be
33492          * configured.
33493          */
33494         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
33495                 UINT32_C(0x800)
33496         /*
33497          * This bit must be '1' for the ip_protocol field to be
33498          * configured.
33499          */
33500         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
33501                 UINT32_C(0x1000)
33502         /*
33503          * This bit must be '1' for the src_port field to be
33504          * configured.
33505          */
33506         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
33507                 UINT32_C(0x2000)
33508         /*
33509          * This bit must be '1' for the dst_port field to be
33510          * configured.
33511          */
33512         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
33513                 UINT32_C(0x4000)
33514         /*
33515          * This bit must be '1' for the dst_id field to be
33516          * configured.
33517          */
33518         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
33519                 UINT32_C(0x8000)
33520         /*
33521          * This bit must be '1' for the mirror_vnic_id field to be
33522          * configured.
33523          */
33524         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
33525                 UINT32_C(0x10000)
33526         /*
33527          * Tunnel identifier.
33528          * Virtual Network Identifier (VNI). Only valid with
33529          * tunnel_types VXLAN, NVGRE, and Geneve.
33530          * Only lower 24-bits of VNI field are used
33531          * in setting up the filter.
33532          */
33533         uint32_t        tunnel_id;
33534         /* Tunnel Type. */
33535         uint8_t tunnel_type;
33536         /* Non-tunnel */
33537         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
33538                 UINT32_C(0x0)
33539         /* Virtual eXtensible Local Area Network (VXLAN) */
33540         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
33541                 UINT32_C(0x1)
33542         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
33543         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
33544                 UINT32_C(0x2)
33545         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
33546         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
33547                 UINT32_C(0x3)
33548         /* IP in IP */
33549         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
33550                 UINT32_C(0x4)
33551         /* Generic Network Virtualization Encapsulation (Geneve) */
33552         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
33553                 UINT32_C(0x5)
33554         /* Multi-Protocol Label Switching (MPLS) */
33555         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
33556                 UINT32_C(0x6)
33557         /* Stateless Transport Tunnel (STT) */
33558         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
33559                 UINT32_C(0x7)
33560         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
33561         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
33562                 UINT32_C(0x8)
33563         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
33564         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
33565                 UINT32_C(0x9)
33566         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
33567         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
33568                 UINT32_C(0xa)
33569         /* Use fixed layer 2 ether type of 0xFFFF */
33570         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
33571                 UINT32_C(0xb)
33572         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
33573         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
33574                 UINT32_C(0xc)
33575         /* Any tunneled traffic */
33576         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
33577                 UINT32_C(0xff)
33578         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
33579                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
33580         uint8_t unused_0;
33581         uint16_t        unused_1;
33582         /*
33583          * This value indicates the source MAC address in
33584          * the Ethernet header.
33585          */
33586         uint8_t src_macaddr[6];
33587         uint8_t unused_2[2];
33588         /*
33589          * This value indicates the destination MAC address in
33590          * the Ethernet header.
33591          */
33592         uint8_t dst_macaddr[6];
33593         /*
33594          * This value indicates the VLAN ID of the outer VLAN tag
33595          * in the Ethernet header.
33596          */
33597         uint16_t        ovlan_vid;
33598         /*
33599          * This value indicates the VLAN ID of the inner VLAN tag
33600          * in the Ethernet header.
33601          */
33602         uint16_t        ivlan_vid;
33603         /*
33604          * This value indicates the VLAN ID of the outer VLAN tag
33605          * in the tunnel Ethernet header.
33606          */
33607         uint16_t        t_ovlan_vid;
33608         /*
33609          * This value indicates the VLAN ID of the inner VLAN tag
33610          * in the tunnel Ethernet header.
33611          */
33612         uint16_t        t_ivlan_vid;
33613         /* This value indicates the ethertype in the Ethernet header. */
33614         uint16_t        ethertype;
33615         /*
33616          * This value indicates the type of IP address.
33617          * 4 - IPv4
33618          * 6 - IPv6
33619          * All others are invalid.
33620          */
33621         uint8_t ip_addr_type;
33622         /* invalid */
33623         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
33624                 UINT32_C(0x0)
33625         /* IPv4 */
33626         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
33627                 UINT32_C(0x4)
33628         /* IPv6 */
33629         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
33630                 UINT32_C(0x6)
33631         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
33632                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
33633         /*
33634          * The value of protocol filed in IP header.
33635          * Applies to UDP and TCP traffic.
33636          * 6 - TCP
33637          * 17 - UDP
33638          */
33639         uint8_t ip_protocol;
33640         /* invalid */
33641         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
33642                 UINT32_C(0x0)
33643         /* TCP */
33644         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
33645                 UINT32_C(0x6)
33646         /* UDP */
33647         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
33648                 UINT32_C(0x11)
33649         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
33650                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
33651         uint16_t        unused_3;
33652         uint32_t        unused_4;
33653         /*
33654          * The value of source IP address to be used in filtering.
33655          * For IPv4, first four bytes represent the IP address.
33656          */
33657         uint32_t        src_ipaddr[4];
33658         /*
33659          * The value of destination IP address to be used in filtering.
33660          * For IPv4, first four bytes represent the IP address.
33661          */
33662         uint32_t        dst_ipaddr[4];
33663         /*
33664          * The value of source port to be used in filtering.
33665          * Applies to UDP and TCP traffic.
33666          */
33667         uint16_t        src_port;
33668         /*
33669          * The value of destination port to be used in filtering.
33670          * Applies to UDP and TCP traffic.
33671          */
33672         uint16_t        dst_port;
33673         /*
33674          * If set, this value shall represent the
33675          * Logical VNIC ID of the destination VNIC for the RX
33676          * path.
33677          */
33678         uint16_t        dst_id;
33679         /*
33680          * If set, this value shall represent the L2 context that matches the L2
33681          * information of the decap filter.
33682          */
33683         uint16_t        l2_ctxt_ref_id;
33684 } __rte_packed;
33685
33686 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
33687 struct hwrm_cfa_decap_filter_alloc_output {
33688         /* The specific error status for the command. */
33689         uint16_t        error_code;
33690         /* The HWRM command request type. */
33691         uint16_t        req_type;
33692         /* The sequence ID from the original command. */
33693         uint16_t        seq_id;
33694         /* The length of the response data in number of bytes. */
33695         uint16_t        resp_len;
33696         /* This value is an opaque id into CFA data structures. */
33697         uint32_t        decap_filter_id;
33698         uint8_t unused_0[3];
33699         /*
33700          * This field is used in Output records to indicate that the output
33701          * is completely written to RAM. This field should be read as '1'
33702          * to indicate that the output has been completely written.
33703          * When writing a command completion or response to an internal processor,
33704          * the order of writes has to be such that this field is written last.
33705          */
33706         uint8_t valid;
33707 } __rte_packed;
33708
33709 /******************************
33710  * hwrm_cfa_decap_filter_free *
33711  ******************************/
33712
33713
33714 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
33715 struct hwrm_cfa_decap_filter_free_input {
33716         /* The HWRM command request type. */
33717         uint16_t        req_type;
33718         /*
33719          * The completion ring to send the completion event on. This should
33720          * be the NQ ID returned from the `nq_alloc` HWRM command.
33721          */
33722         uint16_t        cmpl_ring;
33723         /*
33724          * The sequence ID is used by the driver for tracking multiple
33725          * commands. This ID is treated as opaque data by the firmware and
33726          * the value is returned in the `hwrm_resp_hdr` upon completion.
33727          */
33728         uint16_t        seq_id;
33729         /*
33730          * The target ID of the command:
33731          * * 0x0-0xFFF8 - The function ID
33732          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33733          * * 0xFFFD - Reserved for user-space HWRM interface
33734          * * 0xFFFF - HWRM
33735          */
33736         uint16_t        target_id;
33737         /*
33738          * A physical address pointer pointing to a host buffer that the
33739          * command's response data will be written. This can be either a host
33740          * physical address (HPA) or a guest physical address (GPA) and must
33741          * point to a physically contiguous block of memory.
33742          */
33743         uint64_t        resp_addr;
33744         /* This value is an opaque id into CFA data structures. */
33745         uint32_t        decap_filter_id;
33746         uint8_t unused_0[4];
33747 } __rte_packed;
33748
33749 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
33750 struct hwrm_cfa_decap_filter_free_output {
33751         /* The specific error status for the command. */
33752         uint16_t        error_code;
33753         /* The HWRM command request type. */
33754         uint16_t        req_type;
33755         /* The sequence ID from the original command. */
33756         uint16_t        seq_id;
33757         /* The length of the response data in number of bytes. */
33758         uint16_t        resp_len;
33759         uint8_t unused_0[7];
33760         /*
33761          * This field is used in Output records to indicate that the output
33762          * is completely written to RAM. This field should be read as '1'
33763          * to indicate that the output has been completely written.
33764          * When writing a command completion or response to an internal processor,
33765          * the order of writes has to be such that this field is written last.
33766          */
33767         uint8_t valid;
33768 } __rte_packed;
33769
33770 /***********************
33771  * hwrm_cfa_flow_alloc *
33772  ***********************/
33773
33774
33775 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
33776 struct hwrm_cfa_flow_alloc_input {
33777         /* The HWRM command request type. */
33778         uint16_t        req_type;
33779         /*
33780          * The completion ring to send the completion event on. This should
33781          * be the NQ ID returned from the `nq_alloc` HWRM command.
33782          */
33783         uint16_t        cmpl_ring;
33784         /*
33785          * The sequence ID is used by the driver for tracking multiple
33786          * commands. This ID is treated as opaque data by the firmware and
33787          * the value is returned in the `hwrm_resp_hdr` upon completion.
33788          */
33789         uint16_t        seq_id;
33790         /*
33791          * The target ID of the command:
33792          * * 0x0-0xFFF8 - The function ID
33793          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33794          * * 0xFFFD - Reserved for user-space HWRM interface
33795          * * 0xFFFF - HWRM
33796          */
33797         uint16_t        target_id;
33798         /*
33799          * A physical address pointer pointing to a host buffer that the
33800          * command's response data will be written. This can be either a host
33801          * physical address (HPA) or a guest physical address (GPA) and must
33802          * point to a physically contiguous block of memory.
33803          */
33804         uint64_t        resp_addr;
33805         uint16_t        flags;
33806         /* tunnel is 1 b */
33807         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
33808                 UINT32_C(0x1)
33809         /* num_vlan is 2 b */
33810         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
33811                 UINT32_C(0x6)
33812         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
33813         /* no tags */
33814         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
33815                 (UINT32_C(0x0) << 1)
33816         /* 1 tag */
33817         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
33818                 (UINT32_C(0x1) << 1)
33819         /* 2 tags */
33820         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
33821                 (UINT32_C(0x2) << 1)
33822         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
33823                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
33824         /* Enumeration denoting the Flow Type. */
33825         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
33826                 UINT32_C(0x38)
33827         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
33828         /* L2 flow */
33829         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
33830                 (UINT32_C(0x0) << 3)
33831         /* IPV4 flow */
33832         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
33833                 (UINT32_C(0x1) << 3)
33834         /* IPV6 flow */
33835         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
33836                 (UINT32_C(0x2) << 3)
33837         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
33838                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
33839         /*
33840          * when set to 1, indicates TX flow offload for function specified in src_fid and
33841          * the dst_fid should be set to invalid value. To indicate a VM to VM flow, both
33842          * of the path_tx and path_rx flags need to be set. For virtio vSwitch offload
33843          * case, the src_fid and dst_fid is set to the same fid value. For the SRIOV
33844          * vSwitch offload case, the src_fid and dst_fid must be set to the same VF FID
33845          * belong to the children VFs of the same PF to indicate VM to VM flow.
33846          */
33847         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
33848                 UINT32_C(0x40)
33849         /*
33850          * when set to 1, indicates RX flow offload for function specified in dst_fid and
33851          * the src_fid should be set to invalid value.
33852          */
33853         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
33854                 UINT32_C(0x80)
33855         /*
33856          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan header is
33857          * required and the VXLAN VNI value is stored in the first 24 bits of the dmac field.
33858          * This flag is only valid when the flow direction is RX.
33859          */
33860         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
33861                 UINT32_C(0x100)
33862         /* Set to 1 to indicate vhost_id is specified in the outer_vlan_tci field. */
33863         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN \
33864                 UINT32_C(0x200)
33865         /*
33866          * Tx Flow: vf fid.
33867          * Rx Flow: pf fid.
33868          */
33869         uint16_t        src_fid;
33870         /* Tunnel handle valid when tunnel flag is set. */
33871         uint32_t        tunnel_handle;
33872         uint16_t        action_flags;
33873         /*
33874          * Setting of this flag indicates drop action. If this flag is not set,
33875          * then it should be considered accept action.
33876          */
33877         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
33878                 UINT32_C(0x1)
33879         /* recycle is 1 b */
33880         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
33881                 UINT32_C(0x2)
33882         /*
33883          * Setting of this flag indicates drop action. If this flag is not set,
33884          * then it should be considered accept action.
33885          */
33886         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
33887                 UINT32_C(0x4)
33888         /* meter is 1 b */
33889         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
33890                 UINT32_C(0x8)
33891         /* tunnel is 1 b */
33892         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
33893                 UINT32_C(0x10)
33894         /* nat_src is 1 b */
33895         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
33896                 UINT32_C(0x20)
33897         /* nat_dest is 1 b */
33898         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
33899                 UINT32_C(0x40)
33900         /* nat_ipv4_address is 1 b */
33901         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
33902                 UINT32_C(0x80)
33903         /* l2_header_rewrite is 1 b */
33904         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
33905                 UINT32_C(0x100)
33906         /* ttl_decrement is 1 b */
33907         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
33908                 UINT32_C(0x200)
33909         /*
33910          * If set to 1 and flow direction is TX, it indicates decap of L2 header
33911          * and encap of tunnel header. If set to 1 and flow direction is RX, it
33912          * indicates decap of tunnel header and encap L2 header. The type of tunnel
33913          * is specified in the tunnel_type field.
33914          */
33915         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
33916                 UINT32_C(0x400)
33917         /* If set to 1, flow aging is enabled for this flow. */
33918         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
33919                 UINT32_C(0x800)
33920         /*
33921          * If set to 1 an attempt will be made to try to offload this flow to the
33922          * most optimal flow table resource. If set to 0, the flow will be
33923          * placed to the default flow table resource.
33924          */
33925         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT \
33926                 UINT32_C(0x1000)
33927         /*
33928          * If set to 1 there will be no attempt to allocate an on-chip try to
33929          * offload this flow. If set to 0, which will keep compatibility with the
33930          * older drivers, will cause the FW to attempt to allocate an on-chip flow
33931          * counter for the newly created flow. This will keep the existing behavior
33932          * with EM flows which always had an associated flow counter.
33933          */
33934         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC \
33935                 UINT32_C(0x2000)
33936         /*
33937          * Tx Flow: pf or vf fid.
33938          * Rx Flow: vf fid.
33939          */
33940         uint16_t        dst_fid;
33941         /* VLAN tpid, valid when push_vlan flag is set. */
33942         uint16_t        l2_rewrite_vlan_tpid;
33943         /* VLAN tci, valid when push_vlan flag is set. */
33944         uint16_t        l2_rewrite_vlan_tci;
33945         /* Meter id, valid when meter flag is set. */
33946         uint16_t        act_meter_id;
33947         /* Flow with the same l2 context tcam key. */
33948         uint16_t        ref_flow_handle;
33949         /* This value sets the match value for the ethertype. */
33950         uint16_t        ethertype;
33951         /* valid when num tags is 1 or 2. */
33952         uint16_t        outer_vlan_tci;
33953         /* This value sets the match value for the Destination MAC address. */
33954         uint16_t        dmac[3];
33955         /* valid when num tags is 2. */
33956         uint16_t        inner_vlan_tci;
33957         /* This value sets the match value for the Source MAC address. */
33958         uint16_t        smac[3];
33959         /* The bit length of destination IP address mask. */
33960         uint8_t ip_dst_mask_len;
33961         /* The bit length of source IP address mask. */
33962         uint8_t ip_src_mask_len;
33963         /* The value of destination IPv4/IPv6 address. */
33964         uint32_t        ip_dst[4];
33965         /* The source IPv4/IPv6 address. */
33966         uint32_t        ip_src[4];
33967         /*
33968          * The value of source port.
33969          * Applies to UDP and TCP traffic.
33970          */
33971         uint16_t        l4_src_port;
33972         /*
33973          * The value of source port mask.
33974          * Applies to UDP and TCP traffic.
33975          */
33976         uint16_t        l4_src_port_mask;
33977         /*
33978          * The value of destination port.
33979          * Applies to UDP and TCP traffic.
33980          */
33981         uint16_t        l4_dst_port;
33982         /*
33983          * The value of destination port mask.
33984          * Applies to UDP and TCP traffic.
33985          */
33986         uint16_t        l4_dst_port_mask;
33987         /*
33988          * NAT IPv4/6 address based on address type flag.
33989          * 0 values are ignored.
33990          */
33991         uint32_t        nat_ip_address[4];
33992         /* L2 header re-write Destination MAC address. */
33993         uint16_t        l2_rewrite_dmac[3];
33994         /*
33995          * The NAT source/destination port based on direction flag.
33996          * Applies to UDP and TCP traffic.
33997          * 0 values are ignored.
33998          */
33999         uint16_t        nat_port;
34000         /* L2 header re-write Source MAC address. */
34001         uint16_t        l2_rewrite_smac[3];
34002         /* The value of ip protocol. */
34003         uint8_t ip_proto;
34004         /* Tunnel Type. */
34005         uint8_t tunnel_type;
34006         /* Non-tunnel */
34007         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
34008                 UINT32_C(0x0)
34009         /* Virtual eXtensible Local Area Network (VXLAN) */
34010         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
34011                 UINT32_C(0x1)
34012         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34013         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
34014                 UINT32_C(0x2)
34015         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34016         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
34017                 UINT32_C(0x3)
34018         /* IP in IP */
34019         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
34020                 UINT32_C(0x4)
34021         /* Generic Network Virtualization Encapsulation (Geneve) */
34022         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
34023                 UINT32_C(0x5)
34024         /* Multi-Protocol Label Switching (MPLS) */
34025         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
34026                 UINT32_C(0x6)
34027         /* Stateless Transport Tunnel (STT) */
34028         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
34029                 UINT32_C(0x7)
34030         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34031         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
34032                 UINT32_C(0x8)
34033         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34034         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
34035                 UINT32_C(0x9)
34036         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
34037         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
34038                 UINT32_C(0xa)
34039         /* Use fixed layer 2 ether type of 0xFFFF */
34040         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
34041                 UINT32_C(0xb)
34042         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
34043         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
34044                 UINT32_C(0xc)
34045         /* Any tunneled traffic */
34046         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
34047                 UINT32_C(0xff)
34048         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
34049                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
34050 } __rte_packed;
34051
34052 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
34053 struct hwrm_cfa_flow_alloc_output {
34054         /* The specific error status for the command. */
34055         uint16_t        error_code;
34056         /* The HWRM command request type. */
34057         uint16_t        req_type;
34058         /* The sequence ID from the original command. */
34059         uint16_t        seq_id;
34060         /* The length of the response data in number of bytes. */
34061         uint16_t        resp_len;
34062         /* Flow record index. */
34063         uint16_t        flow_handle;
34064         uint8_t unused_0[2];
34065         /*
34066          * The flow id value in bit 0-29 is the actual ID of the flow
34067          * associated with this filter and it shall be used to match
34068          * and associate the flow identifier returned in completion
34069          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
34070          * shall indicate no valid flow id.
34071          */
34072         uint32_t        flow_id;
34073         /* Indicate the flow id value. */
34074         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
34075                 UINT32_C(0x3fffffff)
34076         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
34077         /* Indicate type of the flow. */
34078         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
34079                 UINT32_C(0x40000000)
34080         /*
34081          * If this bit set to 0, then it indicates that the flow is
34082          * internal flow.
34083          */
34084         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
34085                 (UINT32_C(0x0) << 30)
34086         /*
34087          * If this bit is set to 1, then it indicates that the flow is
34088          * external flow.
34089          */
34090         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
34091                 (UINT32_C(0x1) << 30)
34092         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
34093                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
34094         /* Indicate the flow direction. */
34095         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
34096                 UINT32_C(0x80000000)
34097         /* If this bit set to 0, then it indicates rx flow. */
34098         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
34099                 (UINT32_C(0x0) << 31)
34100         /* If this bit is set to 1, then it indicates that tx flow. */
34101         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
34102                 (UINT32_C(0x1) << 31)
34103         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
34104                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
34105         /* This value identifies a set of CFA data structures used for a flow. */
34106         uint64_t        ext_flow_handle;
34107         uint32_t        flow_counter_id;
34108         uint8_t unused_1[3];
34109         /*
34110          * This field is used in Output records to indicate that the output
34111          * is completely written to RAM. This field should be read as '1'
34112          * to indicate that the output has been completely written.
34113          * When writing a command completion or response to an internal processor,
34114          * the order of writes has to be such that this field is written last.
34115          */
34116         uint8_t valid;
34117 } __rte_packed;
34118
34119 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
34120 struct hwrm_cfa_flow_alloc_cmd_err {
34121         /*
34122          * command specific error codes that goes to
34123          * the cmd_err field in Common HWRM Error Response.
34124          */
34125         uint8_t code;
34126         /* Unknown error */
34127         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN         UINT32_C(0x0)
34128         /* No more L2 Context TCAM */
34129         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
34130         /* No more action records */
34131         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
34132         /* No more flow counters */
34133         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER    UINT32_C(0x3)
34134         /* No more wild-card TCAM */
34135         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
34136         /* Hash collsion in exact match tables */
34137         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
34138         /* Key is already installed */
34139         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS      UINT32_C(0x6)
34140         /* Flow Context DB is out of resource */
34141         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB    UINT32_C(0x7)
34142         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
34143                 HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
34144         uint8_t unused_0[7];
34145 } __rte_packed;
34146
34147 /**********************
34148  * hwrm_cfa_flow_free *
34149  **********************/
34150
34151
34152 /* hwrm_cfa_flow_free_input (size:256b/32B) */
34153 struct hwrm_cfa_flow_free_input {
34154         /* The HWRM command request type. */
34155         uint16_t        req_type;
34156         /*
34157          * The completion ring to send the completion event on. This should
34158          * be the NQ ID returned from the `nq_alloc` HWRM command.
34159          */
34160         uint16_t        cmpl_ring;
34161         /*
34162          * The sequence ID is used by the driver for tracking multiple
34163          * commands. This ID is treated as opaque data by the firmware and
34164          * the value is returned in the `hwrm_resp_hdr` upon completion.
34165          */
34166         uint16_t        seq_id;
34167         /*
34168          * The target ID of the command:
34169          * * 0x0-0xFFF8 - The function ID
34170          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34171          * * 0xFFFD - Reserved for user-space HWRM interface
34172          * * 0xFFFF - HWRM
34173          */
34174         uint16_t        target_id;
34175         /*
34176          * A physical address pointer pointing to a host buffer that the
34177          * command's response data will be written. This can be either a host
34178          * physical address (HPA) or a guest physical address (GPA) and must
34179          * point to a physically contiguous block of memory.
34180          */
34181         uint64_t        resp_addr;
34182         /* Flow record index. */
34183         uint16_t        flow_handle;
34184         uint16_t        unused_0;
34185         /* Flow counter id to be freed. */
34186         uint32_t        flow_counter_id;
34187         /* This value identifies a set of CFA data structures used for a flow. */
34188         uint64_t        ext_flow_handle;
34189 } __rte_packed;
34190
34191 /* hwrm_cfa_flow_free_output (size:256b/32B) */
34192 struct hwrm_cfa_flow_free_output {
34193         /* The specific error status for the command. */
34194         uint16_t        error_code;
34195         /* The HWRM command request type. */
34196         uint16_t        req_type;
34197         /* The sequence ID from the original command. */
34198         uint16_t        seq_id;
34199         /* The length of the response data in number of bytes. */
34200         uint16_t        resp_len;
34201         /* packet is 64 b */
34202         uint64_t        packet;
34203         /* byte is 64 b */
34204         uint64_t        byte;
34205         uint8_t unused_0[7];
34206         /*
34207          * This field is used in Output records to indicate that the output
34208          * is completely written to RAM. This field should be read as '1'
34209          * to indicate that the output has been completely written.
34210          * When writing a command completion or response to an internal processor,
34211          * the order of writes has to be such that this field is written last.
34212          */
34213         uint8_t valid;
34214 } __rte_packed;
34215
34216 /* hwrm_cfa_flow_action_data (size:960b/120B) */
34217 struct hwrm_cfa_flow_action_data {
34218         uint16_t        action_flags;
34219         /* Setting of this flag indicates accept action. */
34220         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD \
34221                 UINT32_C(0x1)
34222         /* Setting of this flag indicates recycle action. */
34223         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE \
34224                 UINT32_C(0x2)
34225         /* Setting of this flag indicates drop action. */
34226         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP \
34227                 UINT32_C(0x4)
34228         /* Setting of this flag indicates meter action. */
34229         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER \
34230                 UINT32_C(0x8)
34231         /* Setting of this flag indicates tunnel action. */
34232         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL \
34233                 UINT32_C(0x10)
34234         /*
34235          * If set to 1 and flow direction is TX, it indicates decap of L2 header
34236          * and encap of tunnel header. If set to 1 and flow direction is RX, it
34237          * indicates decap of tunnel header and encap L2 header.
34238          */
34239         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP \
34240                 UINT32_C(0x20)
34241         /* Setting of this flag indicates ttl decrement action. */
34242         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT \
34243                 UINT32_C(0x40)
34244         /* If set to 1, flow aging is enabled for this flow. */
34245         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED \
34246                 UINT32_C(0x80)
34247         /* Setting of this flag indicates encap action. */
34248         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP \
34249                 UINT32_C(0x100)
34250         /* Setting of this flag indicates decap action. */
34251         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP \
34252                 UINT32_C(0x200)
34253         /* Meter id. */
34254         uint16_t        act_meter_id;
34255         /* VNIC id. */
34256         uint16_t        vnic_id;
34257         /* vport number. */
34258         uint16_t        vport_id;
34259         /* The NAT source/destination. */
34260         uint16_t        nat_port;
34261         uint16_t        unused_0[3];
34262         /* NAT IPv4/IPv6 address. */
34263         uint32_t        nat_ip_address[4];
34264         /* Encapsulation Type. */
34265         uint8_t encap_type;
34266         /* Virtual eXtensible Local Area Network (VXLAN) */
34267         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN        UINT32_C(0x1)
34268         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34269         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE        UINT32_C(0x2)
34270         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
34271         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE        UINT32_C(0x3)
34272         /* IP in IP */
34273         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP         UINT32_C(0x4)
34274         /* Generic Network Virtualization Encapsulation (Geneve) */
34275         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE       UINT32_C(0x5)
34276         /* Multi-Protocol Label Switching (MPLS) */
34277         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS         UINT32_C(0x6)
34278         /* VLAN */
34279         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN         UINT32_C(0x7)
34280         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34281         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE        UINT32_C(0x8)
34282         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34283         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4     UINT32_C(0x9)
34284         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
34285         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1     UINT32_C(0xa)
34286         /* Use fixed layer 2 ether type of 0xFFFF */
34287         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE     UINT32_C(0xb)
34288         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
34289         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
34290         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST \
34291                 HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
34292         uint8_t unused[7];
34293         /* This value is encap data for the associated encap type. */
34294         uint32_t        encap_data[20];
34295 } __rte_packed;
34296
34297 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
34298 struct hwrm_cfa_flow_tunnel_hdr_data {
34299         /* Tunnel Type. */
34300         uint8_t tunnel_type;
34301         /* Non-tunnel */
34302         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL \
34303                 UINT32_C(0x0)
34304         /* Virtual eXtensible Local Area Network (VXLAN) */
34305         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN \
34306                 UINT32_C(0x1)
34307         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34308         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE \
34309                 UINT32_C(0x2)
34310         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34311         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE \
34312                 UINT32_C(0x3)
34313         /* IP in IP */
34314         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP \
34315                 UINT32_C(0x4)
34316         /* Generic Network Virtualization Encapsulation (Geneve) */
34317         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE \
34318                 UINT32_C(0x5)
34319         /* Multi-Protocol Label Switching (MPLS) */
34320         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS \
34321                 UINT32_C(0x6)
34322         /* Stateless Transport Tunnel (STT) */
34323         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT \
34324                 UINT32_C(0x7)
34325         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34326         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE \
34327                 UINT32_C(0x8)
34328         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34329         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 \
34330                 UINT32_C(0x9)
34331         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
34332         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 \
34333                 UINT32_C(0xa)
34334         /* Use fixed layer 2 ether type of 0xFFFF */
34335         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE \
34336                 UINT32_C(0xb)
34337         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
34338         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 \
34339                 UINT32_C(0xc)
34340         /* Any tunneled traffic */
34341         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL \
34342                 UINT32_C(0xff)
34343         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST \
34344                 HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
34345         uint8_t unused[3];
34346         /*
34347          * Tunnel identifier.
34348          * Virtual Network Identifier (VNI).
34349          */
34350         uint32_t        tunnel_id;
34351 } __rte_packed;
34352
34353 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
34354 struct hwrm_cfa_flow_l4_key_data {
34355         /* The value of source port. */
34356         uint16_t        l4_src_port;
34357         /* The value of destination port. */
34358         uint16_t        l4_dst_port;
34359         uint32_t        unused;
34360 } __rte_packed;
34361
34362 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
34363 struct hwrm_cfa_flow_l3_key_data {
34364         /* The value of ip protocol. */
34365         uint8_t ip_protocol;
34366         uint8_t unused_0[7];
34367         /* The value of destination IPv4/IPv6 address. */
34368         uint32_t        ip_dst[4];
34369         /* The source IPv4/IPv6 address. */
34370         uint32_t        ip_src[4];
34371         /* NAT IPv4/IPv6 address. */
34372         uint32_t        nat_ip_address[4];
34373         uint32_t        unused[2];
34374 } __rte_packed;
34375
34376 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
34377 struct hwrm_cfa_flow_l2_key_data {
34378         /* Destination MAC address. */
34379         uint16_t        dmac[3];
34380         uint16_t        unused_0;
34381         /* Source MAC address. */
34382         uint16_t        smac[3];
34383         uint16_t        unused_1;
34384         /* L2 header re-write Destination MAC address. */
34385         uint16_t        l2_rewrite_dmac[3];
34386         uint16_t        unused_2;
34387         /* L2 header re-write Source MAC address. */
34388         uint16_t        l2_rewrite_smac[3];
34389         /* Ethertype. */
34390         uint16_t        ethertype;
34391         /* Number of VLAN tags. */
34392         uint16_t        num_vlan_tags;
34393         /* VLAN tpid. */
34394         uint16_t        l2_rewrite_vlan_tpid;
34395         /* VLAN tci. */
34396         uint16_t        l2_rewrite_vlan_tci;
34397         uint8_t unused_3[2];
34398         /* Outer VLAN TPID. */
34399         uint16_t        ovlan_tpid;
34400         /* Outer VLAN TCI. */
34401         uint16_t        ovlan_tci;
34402         /* Inner VLAN TPID. */
34403         uint16_t        ivlan_tpid;
34404         /* Inner VLAN TCI. */
34405         uint16_t        ivlan_tci;
34406         uint8_t unused[8];
34407 } __rte_packed;
34408
34409 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
34410 struct hwrm_cfa_flow_key_data {
34411         /* Flow associated tunnel L2 header key info. */
34412         uint32_t        t_l2_key_data[14];
34413         /* Flow associated tunnel L2 header mask info. */
34414         uint32_t        t_l2_key_mask[14];
34415         /* Flow associated tunnel L3 header key info. */
34416         uint32_t        t_l3_key_data[16];
34417         /* Flow associated tunnel L3 header mask info. */
34418         uint32_t        t_l3_key_mask[16];
34419         /* Flow associated tunnel L4 header key info. */
34420         uint32_t        t_l4_key_data[2];
34421         /* Flow associated tunnel L4 header mask info. */
34422         uint32_t        t_l4_key_mask[2];
34423         /* Flow associated tunnel header info. */
34424         uint32_t        tunnel_hdr[2];
34425         /* Flow associated L2 header key info. */
34426         uint32_t        l2_key_data[14];
34427         /* Flow associated L2 header mask info. */
34428         uint32_t        l2_key_mask[14];
34429         /* Flow associated L3 header key info. */
34430         uint32_t        l3_key_data[16];
34431         /* Flow associated L3 header mask info. */
34432         uint32_t        l3_key_mask[16];
34433         /* Flow associated L4 header key info. */
34434         uint32_t        l4_key_data[2];
34435         /* Flow associated L4 header mask info. */
34436         uint32_t        l4_key_mask[2];
34437 } __rte_packed;
34438
34439 /**********************
34440  * hwrm_cfa_flow_info *
34441  **********************/
34442
34443
34444 /* hwrm_cfa_flow_info_input (size:256b/32B) */
34445 struct hwrm_cfa_flow_info_input {
34446         /* The HWRM command request type. */
34447         uint16_t        req_type;
34448         /*
34449          * The completion ring to send the completion event on. This should
34450          * be the NQ ID returned from the `nq_alloc` HWRM command.
34451          */
34452         uint16_t        cmpl_ring;
34453         /*
34454          * The sequence ID is used by the driver for tracking multiple
34455          * commands. This ID is treated as opaque data by the firmware and
34456          * the value is returned in the `hwrm_resp_hdr` upon completion.
34457          */
34458         uint16_t        seq_id;
34459         /*
34460          * The target ID of the command:
34461          * * 0x0-0xFFF8 - The function ID
34462          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34463          * * 0xFFFD - Reserved for user-space HWRM interface
34464          * * 0xFFFF - HWRM
34465          */
34466         uint16_t        target_id;
34467         /*
34468          * A physical address pointer pointing to a host buffer that the
34469          * command's response data will be written. This can be either a host
34470          * physical address (HPA) or a guest physical address (GPA) and must
34471          * point to a physically contiguous block of memory.
34472          */
34473         uint64_t        resp_addr;
34474         /* Flow record index. */
34475         uint16_t        flow_handle;
34476         /* Max flow handle */
34477         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
34478                 UINT32_C(0xfff)
34479         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
34480         /* CNP flow handle */
34481         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
34482                 UINT32_C(0x1000)
34483         /* RoCEv1 flow handle */
34484         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
34485                 UINT32_C(0x2000)
34486         /* RoCEv2 flow handle */
34487         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
34488                 UINT32_C(0x4000)
34489         /* Direction rx = 1 */
34490         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
34491                 UINT32_C(0x8000)
34492         uint8_t unused_0[6];
34493         /* This value identifies a set of CFA data structures used for a flow. */
34494         uint64_t        ext_flow_handle;
34495 } __rte_packed;
34496
34497 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
34498 struct hwrm_cfa_flow_info_output {
34499         /* The specific error status for the command. */
34500         uint16_t        error_code;
34501         /* The HWRM command request type. */
34502         uint16_t        req_type;
34503         /* The sequence ID from the original command. */
34504         uint16_t        seq_id;
34505         /* The length of the response data in number of bytes. */
34506         uint16_t        resp_len;
34507         uint8_t flags;
34508         /* When set to 1, indicates the configuration is the TX flow. */
34509         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX     UINT32_C(0x1)
34510         /* When set to 1, indicates the configuration is the RX flow. */
34511         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX     UINT32_C(0x2)
34512         /* profile is 8 b */
34513         uint8_t profile;
34514         /* src_fid is 16 b */
34515         uint16_t        src_fid;
34516         /* dst_fid is 16 b */
34517         uint16_t        dst_fid;
34518         /* l2_ctxt_id is 16 b */
34519         uint16_t        l2_ctxt_id;
34520         /* em_info is 64 b */
34521         uint64_t        em_info;
34522         /* tcam_info is 64 b */
34523         uint64_t        tcam_info;
34524         /* vfp_tcam_info is 64 b */
34525         uint64_t        vfp_tcam_info;
34526         /* ar_id is 16 b */
34527         uint16_t        ar_id;
34528         /* flow_handle is 16 b */
34529         uint16_t        flow_handle;
34530         /* tunnel_handle is 32 b */
34531         uint32_t        tunnel_handle;
34532         /* The flow aging timer for the flow, the unit is 100 milliseconds */
34533         uint16_t        flow_timer;
34534         uint8_t unused_0[6];
34535         /* Flow associated L2, L3 and L4 headers info. */
34536         uint32_t        flow_key_data[130];
34537         /* Flow associated action record info. */
34538         uint32_t        flow_action_info[30];
34539         uint8_t unused_1[7];
34540         /*
34541          * This field is used in Output records to indicate that the output
34542          * is completely written to RAM. This field should be read as '1'
34543          * to indicate that the output has been completely written.
34544          * When writing a command completion or response to an internal processor,
34545          * the order of writes has to be such that this field is written last.
34546          */
34547         uint8_t valid;
34548 } __rte_packed;
34549
34550 /***********************
34551  * hwrm_cfa_flow_flush *
34552  ***********************/
34553
34554
34555 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
34556 struct hwrm_cfa_flow_flush_input {
34557         /* The HWRM command request type. */
34558         uint16_t        req_type;
34559         /*
34560          * The completion ring to send the completion event on. This should
34561          * be the NQ ID returned from the `nq_alloc` HWRM command.
34562          */
34563         uint16_t        cmpl_ring;
34564         /*
34565          * The sequence ID is used by the driver for tracking multiple
34566          * commands. This ID is treated as opaque data by the firmware and
34567          * the value is returned in the `hwrm_resp_hdr` upon completion.
34568          */
34569         uint16_t        seq_id;
34570         /*
34571          * The target ID of the command:
34572          * * 0x0-0xFFF8 - The function ID
34573          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34574          * * 0xFFFD - Reserved for user-space HWRM interface
34575          * * 0xFFFF - HWRM
34576          */
34577         uint16_t        target_id;
34578         /*
34579          * A physical address pointer pointing to a host buffer that the
34580          * command's response data will be written. This can be either a host
34581          * physical address (HPA) or a guest physical address (GPA) and must
34582          * point to a physically contiguous block of memory.
34583          */
34584         uint64_t        resp_addr;
34585         /* flags is 32 b */
34586         uint32_t        flags;
34587         /*
34588          * Set to 1 to indicate the page size, page layers, and flow_handle_table_dma_addr
34589          * fields are valid. The flow flush operation should only flush the flows from the
34590          * flow table specified. This flag is set to 0 by older driver. For older firmware,
34591          * setting this flag has no effect.
34592          */
34593         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID \
34594                 UINT32_C(0x1)
34595         /*
34596          * Set to 1 to indicate flow flush operation to cleanup all the flows, meters, CFA
34597          * context memory tables etc. This flag is set to 0 by older driver. For older firmware,
34598          * setting this flag has no effect.
34599          */
34600         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL \
34601                 UINT32_C(0x2)
34602         /*
34603          * Set to 1 to indicate flow flush operation to cleanup all the flows by the caller.
34604          * This flag is set to 0 by older driver. For older firmware, setting this flag has no effect.
34605          */
34606         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT \
34607                 UINT32_C(0x4)
34608         /* Set to 1 to indicate the flow counter IDs are included in the flow table. */
34609         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC \
34610                 UINT32_C(0x8000000)
34611         /*
34612          * This specifies the size of flow handle entries provided by the driver
34613          * in the flow table specified below. Only two flow handle size enums are defined.
34614          */
34615         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK \
34616                 UINT32_C(0xc0000000)
34617         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT \
34618                 30
34619         /* The flow handle is 16bit */
34620         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT \
34621                 (UINT32_C(0x0) << 30)
34622         /* The flow handle is 64bit */
34623         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT \
34624                 (UINT32_C(0x1) << 30)
34625         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST \
34626                 HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
34627         /* Specify page size of the flow table memory. */
34628         uint8_t page_size;
34629         /* The page size is 4K */
34630         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
34631         /* The page size is 8K */
34632         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
34633         /* The page size is 64K */
34634         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
34635         /* The page size is 256K */
34636         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
34637         /* The page size is 1M */
34638         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
34639         /* The page size is 2M */
34640         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
34641         /* The page size is 4M */
34642         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
34643         /* The page size is 1G */
34644         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
34645         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST \
34646                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
34647         /* FLow table memory indirect levels. */
34648         uint8_t page_level;
34649         /* PBL pointer is physical start address. */
34650         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
34651         /* PBL pointer points to PTE table. */
34652         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
34653         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
34654         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
34655         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST \
34656                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
34657         /* number of flows in the flow table */
34658         uint16_t        num_flows;
34659         /* Pointer to the PBL, or PDL depending on number of levels */
34660         uint64_t        page_dir;
34661 } __rte_packed;
34662
34663 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
34664 struct hwrm_cfa_flow_flush_output {
34665         /* The specific error status for the command. */
34666         uint16_t        error_code;
34667         /* The HWRM command request type. */
34668         uint16_t        req_type;
34669         /* The sequence ID from the original command. */
34670         uint16_t        seq_id;
34671         /* The length of the response data in number of bytes. */
34672         uint16_t        resp_len;
34673         uint8_t unused_0[7];
34674         /*
34675          * This field is used in Output records to indicate that the output
34676          * is completely written to RAM. This field should be read as '1'
34677          * to indicate that the output has been completely written.
34678          * When writing a command completion or response to an internal processor,
34679          * the order of writes has to be such that this field is written last.
34680          */
34681         uint8_t valid;
34682 } __rte_packed;
34683
34684 /***********************
34685  * hwrm_cfa_flow_stats *
34686  ***********************/
34687
34688
34689 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
34690 struct hwrm_cfa_flow_stats_input {
34691         /* The HWRM command request type. */
34692         uint16_t        req_type;
34693         /*
34694          * The completion ring to send the completion event on. This should
34695          * be the NQ ID returned from the `nq_alloc` HWRM command.
34696          */
34697         uint16_t        cmpl_ring;
34698         /*
34699          * The sequence ID is used by the driver for tracking multiple
34700          * commands. This ID is treated as opaque data by the firmware and
34701          * the value is returned in the `hwrm_resp_hdr` upon completion.
34702          */
34703         uint16_t        seq_id;
34704         /*
34705          * The target ID of the command:
34706          * * 0x0-0xFFF8 - The function ID
34707          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34708          * * 0xFFFD - Reserved for user-space HWRM interface
34709          * * 0xFFFF - HWRM
34710          */
34711         uint16_t        target_id;
34712         /*
34713          * A physical address pointer pointing to a host buffer that the
34714          * command's response data will be written. This can be either a host
34715          * physical address (HPA) or a guest physical address (GPA) and must
34716          * point to a physically contiguous block of memory.
34717          */
34718         uint64_t        resp_addr;
34719         /* Flow handle. */
34720         uint16_t        num_flows;
34721         /* Flow handle. */
34722         uint16_t        flow_handle_0;
34723         /* Flow handle. */
34724         uint16_t        flow_handle_1;
34725         /* Flow handle. */
34726         uint16_t        flow_handle_2;
34727         /* Flow handle. */
34728         uint16_t        flow_handle_3;
34729         /* Flow handle. */
34730         uint16_t        flow_handle_4;
34731         /* Flow handle. */
34732         uint16_t        flow_handle_5;
34733         /* Flow handle. */
34734         uint16_t        flow_handle_6;
34735         /* Flow handle. */
34736         uint16_t        flow_handle_7;
34737         /* Flow handle. */
34738         uint16_t        flow_handle_8;
34739         /* Flow handle. */
34740         uint16_t        flow_handle_9;
34741         uint8_t unused_0[2];
34742         /* Flow ID of a flow. */
34743         uint32_t        flow_id_0;
34744         /* Flow ID of a flow. */
34745         uint32_t        flow_id_1;
34746         /* Flow ID of a flow. */
34747         uint32_t        flow_id_2;
34748         /* Flow ID of a flow. */
34749         uint32_t        flow_id_3;
34750         /* Flow ID of a flow. */
34751         uint32_t        flow_id_4;
34752         /* Flow ID of a flow. */
34753         uint32_t        flow_id_5;
34754         /* Flow ID of a flow. */
34755         uint32_t        flow_id_6;
34756         /* Flow ID of a flow. */
34757         uint32_t        flow_id_7;
34758         /* Flow ID of a flow. */
34759         uint32_t        flow_id_8;
34760         /* Flow ID of a flow. */
34761         uint32_t        flow_id_9;
34762 } __rte_packed;
34763
34764 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
34765 struct hwrm_cfa_flow_stats_output {
34766         /* The specific error status for the command. */
34767         uint16_t        error_code;
34768         /* The HWRM command request type. */
34769         uint16_t        req_type;
34770         /* The sequence ID from the original command. */
34771         uint16_t        seq_id;
34772         /* The length of the response data in number of bytes. */
34773         uint16_t        resp_len;
34774         /* packet_0 is 64 b */
34775         uint64_t        packet_0;
34776         /* packet_1 is 64 b */
34777         uint64_t        packet_1;
34778         /* packet_2 is 64 b */
34779         uint64_t        packet_2;
34780         /* packet_3 is 64 b */
34781         uint64_t        packet_3;
34782         /* packet_4 is 64 b */
34783         uint64_t        packet_4;
34784         /* packet_5 is 64 b */
34785         uint64_t        packet_5;
34786         /* packet_6 is 64 b */
34787         uint64_t        packet_6;
34788         /* packet_7 is 64 b */
34789         uint64_t        packet_7;
34790         /* packet_8 is 64 b */
34791         uint64_t        packet_8;
34792         /* packet_9 is 64 b */
34793         uint64_t        packet_9;
34794         /* byte_0 is 64 b */
34795         uint64_t        byte_0;
34796         /* byte_1 is 64 b */
34797         uint64_t        byte_1;
34798         /* byte_2 is 64 b */
34799         uint64_t        byte_2;
34800         /* byte_3 is 64 b */
34801         uint64_t        byte_3;
34802         /* byte_4 is 64 b */
34803         uint64_t        byte_4;
34804         /* byte_5 is 64 b */
34805         uint64_t        byte_5;
34806         /* byte_6 is 64 b */
34807         uint64_t        byte_6;
34808         /* byte_7 is 64 b */
34809         uint64_t        byte_7;
34810         /* byte_8 is 64 b */
34811         uint64_t        byte_8;
34812         /* byte_9 is 64 b */
34813         uint64_t        byte_9;
34814         uint8_t unused_0[7];
34815         /*
34816          * This field is used in Output records to indicate that the output
34817          * is completely written to RAM. This field should be read as '1'
34818          * to indicate that the output has been completely written.
34819          * When writing a command completion or response to an internal processor,
34820          * the order of writes has to be such that this field is written last.
34821          */
34822         uint8_t valid;
34823 } __rte_packed;
34824
34825 /***********************************
34826  * hwrm_cfa_flow_aging_timer_reset *
34827  ***********************************/
34828
34829
34830 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
34831 struct hwrm_cfa_flow_aging_timer_reset_input {
34832         /* The HWRM command request type. */
34833         uint16_t        req_type;
34834         /*
34835          * The completion ring to send the completion event on. This should
34836          * be the NQ ID returned from the `nq_alloc` HWRM command.
34837          */
34838         uint16_t        cmpl_ring;
34839         /*
34840          * The sequence ID is used by the driver for tracking multiple
34841          * commands. This ID is treated as opaque data by the firmware and
34842          * the value is returned in the `hwrm_resp_hdr` upon completion.
34843          */
34844         uint16_t        seq_id;
34845         /*
34846          * The target ID of the command:
34847          * * 0x0-0xFFF8 - The function ID
34848          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34849          * * 0xFFFD - Reserved for user-space HWRM interface
34850          * * 0xFFFF - HWRM
34851          */
34852         uint16_t        target_id;
34853         /*
34854          * A physical address pointer pointing to a host buffer that the
34855          * command's response data will be written. This can be either a host
34856          * physical address (HPA) or a guest physical address (GPA) and must
34857          * point to a physically contiguous block of memory.
34858          */
34859         uint64_t        resp_addr;
34860         /* Flow record index. */
34861         uint16_t        flow_handle;
34862         uint8_t unused_0[2];
34863         /*
34864          * New flow timer value for the flow specified in the ext_flow_handle.
34865          * The flow timer unit is 100ms.
34866          */
34867         uint32_t        flow_timer;
34868         /* This value identifies a set of CFA data structures used for a flow. */
34869         uint64_t        ext_flow_handle;
34870 } __rte_packed;
34871
34872 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
34873 struct hwrm_cfa_flow_aging_timer_reset_output {
34874         /* The specific error status for the command. */
34875         uint16_t        error_code;
34876         /* The HWRM command request type. */
34877         uint16_t        req_type;
34878         /* The sequence ID from the original command. */
34879         uint16_t        seq_id;
34880         /* The length of the response data in number of bytes. */
34881         uint16_t        resp_len;
34882         uint8_t unused_0[7];
34883         /*
34884          * This field is used in Output records to indicate that the output
34885          * is completely written to RAM. This field should be read as '1'
34886          * to indicate that the output has been completely written.
34887          * When writing a command completion or response to an internal processor,
34888          * the order of writes has to be such that this field is written last.
34889          */
34890         uint8_t valid;
34891 } __rte_packed;
34892
34893 /***************************
34894  * hwrm_cfa_flow_aging_cfg *
34895  ***************************/
34896
34897
34898 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
34899 struct hwrm_cfa_flow_aging_cfg_input {
34900         /* The HWRM command request type. */
34901         uint16_t        req_type;
34902         /*
34903          * The completion ring to send the completion event on. This should
34904          * be the NQ ID returned from the `nq_alloc` HWRM command.
34905          */
34906         uint16_t        cmpl_ring;
34907         /*
34908          * The sequence ID is used by the driver for tracking multiple
34909          * commands. This ID is treated as opaque data by the firmware and
34910          * the value is returned in the `hwrm_resp_hdr` upon completion.
34911          */
34912         uint16_t        seq_id;
34913         /*
34914          * The target ID of the command:
34915          * * 0x0-0xFFF8 - The function ID
34916          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34917          * * 0xFFFD - Reserved for user-space HWRM interface
34918          * * 0xFFFF - HWRM
34919          */
34920         uint16_t        target_id;
34921         /*
34922          * A physical address pointer pointing to a host buffer that the
34923          * command's response data will be written. This can be either a host
34924          * physical address (HPA) or a guest physical address (GPA) and must
34925          * point to a physically contiguous block of memory.
34926          */
34927         uint64_t        resp_addr;
34928         /* The bit field to enable per flow aging configuration. */
34929         uint16_t        enables;
34930         /* This bit must be '1' for the tcp flow timer field to be configured */
34931         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
34932                 UINT32_C(0x1)
34933         /* This bit must be '1' for the tcp finish timer field to be configured */
34934         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
34935                 UINT32_C(0x2)
34936         /* This bit must be '1' for the udp flow timer field to be configured */
34937         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
34938                 UINT32_C(0x4)
34939         /* This bit must be '1' for the eem dma interval field to be configured */
34940         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL \
34941                 UINT32_C(0x8)
34942         /* This bit must be '1' for the eem notice interval field to be configured */
34943         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL \
34944                 UINT32_C(0x10)
34945         /* This bit must be '1' for the eem context memory maximum entries field to be configured */
34946         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES \
34947                 UINT32_C(0x20)
34948         /* This bit must be '1' for the eem context memory ID field to be configured */
34949         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID \
34950                 UINT32_C(0x40)
34951         /* This bit must be '1' for the eem context memory type field to be configured */
34952         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE \
34953                 UINT32_C(0x80)
34954         uint8_t flags;
34955         /* Enumeration denoting the RX, TX type of the resource. */
34956         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH       UINT32_C(0x1)
34957         /* tx path */
34958         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX      UINT32_C(0x0)
34959         /* rx path */
34960         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX      UINT32_C(0x1)
34961         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
34962                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
34963         /* Enumeration denoting the enable, disable eem flow aging configuration. */
34964         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM        UINT32_C(0x2)
34965         /* tx path */
34966         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE \
34967                 (UINT32_C(0x0) << 1)
34968         /* rx path */
34969         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE \
34970                 (UINT32_C(0x1) << 1)
34971         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST \
34972                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
34973         uint8_t unused_0;
34974         /* The flow aging timer for all TCP flows, the unit is 100 milliseconds. */
34975         uint32_t        tcp_flow_timer;
34976         /* The TCP finished timer for all TCP flows, the unit is 100 milliseconds. */
34977         uint32_t        tcp_fin_timer;
34978         /* The flow aging timer for all UDP flows, the unit is 100 milliseconds. */
34979         uint32_t        udp_flow_timer;
34980         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
34981         uint16_t        eem_dma_interval;
34982         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
34983         uint16_t        eem_notice_interval;
34984         /* The maximum entries number in the eem context memory. */
34985         uint32_t        eem_ctx_max_entries;
34986         /* The context memory ID for eem flow aging. */
34987         uint16_t        eem_ctx_id;
34988         uint16_t        eem_ctx_mem_type;
34989         /* The content of context memory is eem ejection data, the size of each entry is 4 bytes. */
34990         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA \
34991                 UINT32_C(0x0)
34992         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
34993                 HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
34994         uint8_t unused_1[4];
34995 } __rte_packed;
34996
34997 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
34998 struct hwrm_cfa_flow_aging_cfg_output {
34999         /* The specific error status for the command. */
35000         uint16_t        error_code;
35001         /* The HWRM command request type. */
35002         uint16_t        req_type;
35003         /* The sequence ID from the original command. */
35004         uint16_t        seq_id;
35005         /* The length of the response data in number of bytes. */
35006         uint16_t        resp_len;
35007         uint8_t unused_0[7];
35008         /*
35009          * This field is used in Output records to indicate that the output
35010          * is completely written to RAM. This field should be read as '1'
35011          * to indicate that the output has been completely written.
35012          * When writing a command completion or response to an internal processor,
35013          * the order of writes has to be such that this field is written last.
35014          */
35015         uint8_t valid;
35016 } __rte_packed;
35017
35018 /****************************
35019  * hwrm_cfa_flow_aging_qcfg *
35020  ****************************/
35021
35022
35023 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
35024 struct hwrm_cfa_flow_aging_qcfg_input {
35025         /* The HWRM command request type. */
35026         uint16_t        req_type;
35027         /*
35028          * The completion ring to send the completion event on. This should
35029          * be the NQ ID returned from the `nq_alloc` HWRM command.
35030          */
35031         uint16_t        cmpl_ring;
35032         /*
35033          * The sequence ID is used by the driver for tracking multiple
35034          * commands. This ID is treated as opaque data by the firmware and
35035          * the value is returned in the `hwrm_resp_hdr` upon completion.
35036          */
35037         uint16_t        seq_id;
35038         /*
35039          * The target ID of the command:
35040          * * 0x0-0xFFF8 - The function ID
35041          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35042          * * 0xFFFD - Reserved for user-space HWRM interface
35043          * * 0xFFFF - HWRM
35044          */
35045         uint16_t        target_id;
35046         /*
35047          * A physical address pointer pointing to a host buffer that the
35048          * command's response data will be written. This can be either a host
35049          * physical address (HPA) or a guest physical address (GPA) and must
35050          * point to a physically contiguous block of memory.
35051          */
35052         uint64_t        resp_addr;
35053         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
35054         uint8_t flags;
35055         /* Enumeration denoting the RX, TX type of the resource. */
35056         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
35057         /* tx path */
35058         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
35059         /* rx path */
35060         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
35061         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
35062                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
35063         uint8_t unused_0[7];
35064 } __rte_packed;
35065
35066 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
35067 struct hwrm_cfa_flow_aging_qcfg_output {
35068         /* The specific error status for the command. */
35069         uint16_t        error_code;
35070         /* The HWRM command request type. */
35071         uint16_t        req_type;
35072         /* The sequence ID from the original command. */
35073         uint16_t        seq_id;
35074         /* The length of the response data in number of bytes. */
35075         uint16_t        resp_len;
35076         /* The current flow aging timer for all TCP flows, the unit is 100 millisecond. */
35077         uint32_t        tcp_flow_timer;
35078         /* The current TCP finished timer for all TCP flows, the unit is 100 millisecond. */
35079         uint32_t        tcp_fin_timer;
35080         /* The current flow aging timer for all UDP flows, the unit is 100 millisecond. */
35081         uint32_t        udp_flow_timer;
35082         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
35083         uint16_t        eem_dma_interval;
35084         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
35085         uint16_t        eem_notice_interval;
35086         /* The maximum entries number in the eem context memory. */
35087         uint32_t        eem_ctx_max_entries;
35088         /* The context memory ID for eem flow aging. */
35089         uint16_t        eem_ctx_id;
35090         /* The context memory type for eem flow aging. */
35091         uint16_t        eem_ctx_mem_type;
35092         uint8_t unused_0[7];
35093         /*
35094          * This field is used in Output records to indicate that the output
35095          * is completely written to RAM. This field should be read as '1'
35096          * to indicate that the output has been completely written.
35097          * When writing a command completion or response to an internal processor,
35098          * the order of writes has to be such that this field is written last.
35099          */
35100         uint8_t valid;
35101 } __rte_packed;
35102
35103 /*****************************
35104  * hwrm_cfa_flow_aging_qcaps *
35105  *****************************/
35106
35107
35108 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
35109 struct hwrm_cfa_flow_aging_qcaps_input {
35110         /* The HWRM command request type. */
35111         uint16_t        req_type;
35112         /*
35113          * The completion ring to send the completion event on. This should
35114          * be the NQ ID returned from the `nq_alloc` HWRM command.
35115          */
35116         uint16_t        cmpl_ring;
35117         /*
35118          * The sequence ID is used by the driver for tracking multiple
35119          * commands. This ID is treated as opaque data by the firmware and
35120          * the value is returned in the `hwrm_resp_hdr` upon completion.
35121          */
35122         uint16_t        seq_id;
35123         /*
35124          * The target ID of the command:
35125          * * 0x0-0xFFF8 - The function ID
35126          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35127          * * 0xFFFD - Reserved for user-space HWRM interface
35128          * * 0xFFFF - HWRM
35129          */
35130         uint16_t        target_id;
35131         /*
35132          * A physical address pointer pointing to a host buffer that the
35133          * command's response data will be written. This can be either a host
35134          * physical address (HPA) or a guest physical address (GPA) and must
35135          * point to a physically contiguous block of memory.
35136          */
35137         uint64_t        resp_addr;
35138         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
35139         uint8_t flags;
35140         /* Enumeration denoting the RX, TX type of the resource. */
35141         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
35142         /* tx path */
35143         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
35144         /* rx path */
35145         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
35146         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
35147                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
35148         uint8_t unused_0[7];
35149 } __rte_packed;
35150
35151 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
35152 struct hwrm_cfa_flow_aging_qcaps_output {
35153         /* The specific error status for the command. */
35154         uint16_t        error_code;
35155         /* The HWRM command request type. */
35156         uint16_t        req_type;
35157         /* The sequence ID from the original command. */
35158         uint16_t        seq_id;
35159         /* The length of the response data in number of bytes. */
35160         uint16_t        resp_len;
35161         /* The maximum flow aging timer for all TCP flows, the unit is 100 millisecond. */
35162         uint32_t        max_tcp_flow_timer;
35163         /* The maximum TCP finished timer for all TCP flows, the unit is 100 millisecond. */
35164         uint32_t        max_tcp_fin_timer;
35165         /* The maximum flow aging timer for all UDP flows, the unit is 100 millisecond. */
35166         uint32_t        max_udp_flow_timer;
35167         /* The maximum aging flows that HW can support. */
35168         uint32_t        max_aging_flows;
35169         uint8_t unused_0[7];
35170         /*
35171          * This field is used in Output records to indicate that the output
35172          * is completely written to RAM. This field should be read as '1'
35173          * to indicate that the output has been completely written.
35174          * When writing a command completion or response to an internal processor,
35175          * the order of writes has to be such that this field is written last.
35176          */
35177         uint8_t valid;
35178 } __rte_packed;
35179
35180 /**********************************
35181  * hwrm_cfa_tcp_flag_process_qcfg *
35182  **********************************/
35183
35184
35185 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
35186 struct hwrm_cfa_tcp_flag_process_qcfg_input {
35187         /* The HWRM command request type. */
35188         uint16_t        req_type;
35189         /*
35190          * The completion ring to send the completion event on. This should
35191          * be the NQ ID returned from the `nq_alloc` HWRM command.
35192          */
35193         uint16_t        cmpl_ring;
35194         /*
35195          * The sequence ID is used by the driver for tracking multiple
35196          * commands. This ID is treated as opaque data by the firmware and
35197          * the value is returned in the `hwrm_resp_hdr` upon completion.
35198          */
35199         uint16_t        seq_id;
35200         /*
35201          * The target ID of the command:
35202          * * 0x0-0xFFF8 - The function ID
35203          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35204          * * 0xFFFD - Reserved for user-space HWRM interface
35205          * * 0xFFFF - HWRM
35206          */
35207         uint16_t        target_id;
35208         /*
35209          * A physical address pointer pointing to a host buffer that the
35210          * command's response data will be written. This can be either a host
35211          * physical address (HPA) or a guest physical address (GPA) and must
35212          * point to a physically contiguous block of memory.
35213          */
35214         uint64_t        resp_addr;
35215 } __rte_packed;
35216
35217 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
35218 struct hwrm_cfa_tcp_flag_process_qcfg_output {
35219         /* The specific error status for the command. */
35220         uint16_t        error_code;
35221         /* The HWRM command request type. */
35222         uint16_t        req_type;
35223         /* The sequence ID from the original command. */
35224         uint16_t        seq_id;
35225         /* The length of the response data in number of bytes. */
35226         uint16_t        resp_len;
35227         /* The port 0 RX mirror action record ID. */
35228         uint16_t        rx_ar_id_port0;
35229         /* The port 1 RX mirror action record ID. */
35230         uint16_t        rx_ar_id_port1;
35231         /* The port 0 RX action record ID for TX TCP flag packets from loopback path. */
35232         uint16_t        tx_ar_id_port0;
35233         /* The port 1 RX action record ID for TX TCP flag packets from loopback path. */
35234         uint16_t        tx_ar_id_port1;
35235         uint8_t unused_0[7];
35236         /*
35237          * This field is used in Output records to indicate that the output
35238          * is completely written to RAM. This field should be read as '1'
35239          * to indicate that the output has been completely written.
35240          * When writing a command completion or response to an internal processor,
35241          * the order of writes has to be such that this field is written last.
35242          */
35243         uint8_t valid;
35244 } __rte_packed;
35245
35246 /**********************
35247  * hwrm_cfa_pair_info *
35248  **********************/
35249
35250
35251 /* hwrm_cfa_pair_info_input (size:448b/56B) */
35252 struct hwrm_cfa_pair_info_input {
35253         /* The HWRM command request type. */
35254         uint16_t        req_type;
35255         /*
35256          * The completion ring to send the completion event on. This should
35257          * be the NQ ID returned from the `nq_alloc` HWRM command.
35258          */
35259         uint16_t        cmpl_ring;
35260         /*
35261          * The sequence ID is used by the driver for tracking multiple
35262          * commands. This ID is treated as opaque data by the firmware and
35263          * the value is returned in the `hwrm_resp_hdr` upon completion.
35264          */
35265         uint16_t        seq_id;
35266         /*
35267          * The target ID of the command:
35268          * * 0x0-0xFFF8 - The function ID
35269          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35270          * * 0xFFFD - Reserved for user-space HWRM interface
35271          * * 0xFFFF - HWRM
35272          */
35273         uint16_t        target_id;
35274         /*
35275          * A physical address pointer pointing to a host buffer that the
35276          * command's response data will be written. This can be either a host
35277          * physical address (HPA) or a guest physical address (GPA) and must
35278          * point to a physically contiguous block of memory.
35279          */
35280         uint64_t        resp_addr;
35281         uint32_t        flags;
35282         /* If this flag is set, lookup by name else lookup by index. */
35283         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
35284         /* If this flag is set, lookup by PF id and VF id. */
35285         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
35286         /* Pair table index. */
35287         uint16_t        pair_index;
35288         /* Pair pf index. */
35289         uint8_t pair_pfid;
35290         /* Pair vf index. */
35291         uint8_t pair_vfid;
35292         /* Pair name (32 byte string). */
35293         char    pair_name[32];
35294 } __rte_packed;
35295
35296 /* hwrm_cfa_pair_info_output (size:576b/72B) */
35297 struct hwrm_cfa_pair_info_output {
35298         /* The specific error status for the command. */
35299         uint16_t        error_code;
35300         /* The HWRM command request type. */
35301         uint16_t        req_type;
35302         /* The sequence ID from the original command. */
35303         uint16_t        seq_id;
35304         /* The length of the response data in number of bytes. */
35305         uint16_t        resp_len;
35306         /* Pair table index. */
35307         uint16_t        next_pair_index;
35308         /* Pair member a's fid. */
35309         uint16_t        a_fid;
35310         /* Logical host number. */
35311         uint8_t host_a_index;
35312         /* Logical PF number. */
35313         uint8_t pf_a_index;
35314         /* Pair member a's Linux logical VF number. */
35315         uint16_t        vf_a_index;
35316         /* Rx CFA code. */
35317         uint16_t        rx_cfa_code_a;
35318         /* Tx CFA action. */
35319         uint16_t        tx_cfa_action_a;
35320         /* Pair member b's fid. */
35321         uint16_t        b_fid;
35322         /* Logical host number. */
35323         uint8_t host_b_index;
35324         /* Logical PF number. */
35325         uint8_t pf_b_index;
35326         /* Pair member a's Linux logical VF number. */
35327         uint16_t        vf_b_index;
35328         /* Rx CFA code. */
35329         uint16_t        rx_cfa_code_b;
35330         /* Tx CFA action. */
35331         uint16_t        tx_cfa_action_b;
35332         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
35333         uint8_t pair_mode;
35334         /* Pair between VF on local host with PF or VF on specified host. */
35335         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
35336         /* Pair between REP on local host with PF or VF on specified host. */
35337         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
35338         /* Pair between REP on local host with REP on specified host. */
35339         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
35340         /* Pair for the proxy interface. */
35341         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
35342         /* Pair for the PF interface. */
35343         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
35344         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
35345                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
35346         /* Pair state. */
35347         uint8_t pair_state;
35348         /* Pair has been allocated */
35349         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
35350         /* Both pair members are active */
35351         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
35352         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
35353                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
35354         /* Pair name (32 byte string). */
35355         char    pair_name[32];
35356         uint8_t unused_0[7];
35357         /*
35358          * This field is used in Output records to indicate that the output
35359          * is completely written to RAM. This field should be read as '1'
35360          * to indicate that the output has been completely written.
35361          * When writing a command completion or response to an internal processor,
35362          * the order of writes has to be such that this field is written last.
35363          */
35364         uint8_t valid;
35365 } __rte_packed;
35366
35367 /**********************
35368  * hwrm_cfa_vfr_alloc *
35369  **********************/
35370
35371
35372 /* hwrm_cfa_vfr_alloc_input (size:448b/56B) */
35373 struct hwrm_cfa_vfr_alloc_input {
35374         /* The HWRM command request type. */
35375         uint16_t        req_type;
35376         /*
35377          * The completion ring to send the completion event on. This should
35378          * be the NQ ID returned from the `nq_alloc` HWRM command.
35379          */
35380         uint16_t        cmpl_ring;
35381         /*
35382          * The sequence ID is used by the driver for tracking multiple
35383          * commands. This ID is treated as opaque data by the firmware and
35384          * the value is returned in the `hwrm_resp_hdr` upon completion.
35385          */
35386         uint16_t        seq_id;
35387         /*
35388          * The target ID of the command:
35389          * * 0x0-0xFFF8 - The function ID
35390          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35391          * * 0xFFFD - Reserved for user-space HWRM interface
35392          * * 0xFFFF - HWRM
35393          */
35394         uint16_t        target_id;
35395         /*
35396          * A physical address pointer pointing to a host buffer that the
35397          * command's response data will be written. This can be either a host
35398          * physical address (HPA) or a guest physical address (GPA) and must
35399          * point to a physically contiguous block of memory.
35400          */
35401         uint64_t        resp_addr;
35402         /* Logical VF number (range: 0 -> MAX_VFS -1). */
35403         uint16_t        vf_id;
35404         /*
35405          * This field is reserved for the future use.
35406          * It shall be set to 0.
35407          */
35408         uint16_t        reserved;
35409         uint8_t unused_0[4];
35410         /* VF Representor name (32 byte string). */
35411         char    vfr_name[32];
35412 } __rte_packed;
35413
35414 /* hwrm_cfa_vfr_alloc_output (size:128b/16B) */
35415 struct hwrm_cfa_vfr_alloc_output {
35416         /* The specific error status for the command. */
35417         uint16_t        error_code;
35418         /* The HWRM command request type. */
35419         uint16_t        req_type;
35420         /* The sequence ID from the original command. */
35421         uint16_t        seq_id;
35422         /* The length of the response data in number of bytes. */
35423         uint16_t        resp_len;
35424         /* Rx CFA code. */
35425         uint16_t        rx_cfa_code;
35426         /* Tx CFA action. */
35427         uint16_t        tx_cfa_action;
35428         uint8_t unused_0[3];
35429         /*
35430          * This field is used in Output records to indicate that the output
35431          * is completely written to RAM.  This field should be read as '1'
35432          * to indicate that the output has been completely written.
35433          * When writing a command completion or response to an internal processor,
35434          * the order of writes has to be such that this field is written last.
35435          */
35436         uint8_t valid;
35437 } __rte_packed;
35438
35439 /*********************
35440  * hwrm_cfa_vfr_free *
35441  *********************/
35442
35443
35444 /* hwrm_cfa_vfr_free_input (size:448b/56B) */
35445 struct hwrm_cfa_vfr_free_input {
35446         /* The HWRM command request type. */
35447         uint16_t        req_type;
35448         /*
35449          * The completion ring to send the completion event on. This should
35450          * be the NQ ID returned from the `nq_alloc` HWRM command.
35451          */
35452         uint16_t        cmpl_ring;
35453         /*
35454          * The sequence ID is used by the driver for tracking multiple
35455          * commands. This ID is treated as opaque data by the firmware and
35456          * the value is returned in the `hwrm_resp_hdr` upon completion.
35457          */
35458         uint16_t        seq_id;
35459         /*
35460          * The target ID of the command:
35461          * * 0x0-0xFFF8 - The function ID
35462          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35463          * * 0xFFFD - Reserved for user-space HWRM interface
35464          * * 0xFFFF - HWRM
35465          */
35466         uint16_t        target_id;
35467         /*
35468          * A physical address pointer pointing to a host buffer that the
35469          * command's response data will be written. This can be either a host
35470          * physical address (HPA) or a guest physical address (GPA) and must
35471          * point to a physically contiguous block of memory.
35472          */
35473         uint64_t        resp_addr;
35474         /* VF Representor name (32 byte string). */
35475         char            vfr_name[32];
35476         /* Logical VF number (range: 0 -> MAX_VFS -1). */
35477         uint16_t        vf_id;
35478         uint16_t        reserved;
35479         uint8_t         unused_0[4];
35480 } __rte_packed;
35481
35482 /* hwrm_cfa_vfr_free_output (size:128b/16B) */
35483 struct hwrm_cfa_vfr_free_output {
35484         /* The specific error status for the command. */
35485         uint16_t        error_code;
35486         /* The HWRM command request type. */
35487         uint16_t        req_type;
35488         /* The sequence ID from the original command. */
35489         uint16_t        seq_id;
35490         /* The length of the response data in number of bytes. */
35491         uint16_t        resp_len;
35492         uint8_t unused_0[7];
35493         /*
35494          * This field is used in Output records to indicate that the output
35495          * is completely written to RAM.  This field should be read as '1'
35496          * to indicate that the output has been completely written.
35497          * When writing a command completion or response to an internal processor,
35498          * the order of writes has to be such that this field is written last.
35499          */
35500         uint8_t valid;
35501 } __rte_packed;
35502
35503
35504
35505 /***************************************
35506  * hwrm_cfa_redirect_query_tunnel_type *
35507  ***************************************/
35508
35509
35510 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
35511 struct hwrm_cfa_redirect_query_tunnel_type_input {
35512         /* The HWRM command request type. */
35513         uint16_t        req_type;
35514         /*
35515          * The completion ring to send the completion event on. This should
35516          * be the NQ ID returned from the `nq_alloc` HWRM command.
35517          */
35518         uint16_t        cmpl_ring;
35519         /*
35520          * The sequence ID is used by the driver for tracking multiple
35521          * commands. This ID is treated as opaque data by the firmware and
35522          * the value is returned in the `hwrm_resp_hdr` upon completion.
35523          */
35524         uint16_t        seq_id;
35525         /*
35526          * The target ID of the command:
35527          * * 0x0-0xFFF8 - The function ID
35528          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35529          * * 0xFFFD - Reserved for user-space HWRM interface
35530          * * 0xFFFF - HWRM
35531          */
35532         uint16_t        target_id;
35533         /*
35534          * A physical address pointer pointing to a host buffer that the
35535          * command's response data will be written. This can be either a host
35536          * physical address (HPA) or a guest physical address (GPA) and must
35537          * point to a physically contiguous block of memory.
35538          */
35539         uint64_t        resp_addr;
35540         /* The source function id. */
35541         uint16_t        src_fid;
35542         uint8_t unused_0[6];
35543 } __rte_packed;
35544
35545 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
35546 struct hwrm_cfa_redirect_query_tunnel_type_output {
35547         /* The specific error status for the command. */
35548         uint16_t        error_code;
35549         /* The HWRM command request type. */
35550         uint16_t        req_type;
35551         /* The sequence ID from the original command. */
35552         uint16_t        seq_id;
35553         /* The length of the response data in number of bytes. */
35554         uint16_t        resp_len;
35555         /* Tunnel Mask. */
35556         uint32_t        tunnel_mask;
35557         /* Non-tunnel */
35558         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
35559                 UINT32_C(0x1)
35560         /* Virtual eXtensible Local Area Network (VXLAN) */
35561         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
35562                 UINT32_C(0x2)
35563         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
35564         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
35565                 UINT32_C(0x4)
35566         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
35567         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
35568                 UINT32_C(0x8)
35569         /* IP in IP */
35570         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
35571                 UINT32_C(0x10)
35572         /* Generic Network Virtualization Encapsulation (Geneve) */
35573         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
35574                 UINT32_C(0x20)
35575         /* Multi-Protocol Label Switching (MPLS) */
35576         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
35577                 UINT32_C(0x40)
35578         /* Stateless Transport Tunnel (STT) */
35579         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
35580                 UINT32_C(0x80)
35581         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
35582         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
35583                 UINT32_C(0x100)
35584         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
35585         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
35586                 UINT32_C(0x200)
35587         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
35588         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
35589                 UINT32_C(0x400)
35590         /* Any tunneled traffic */
35591         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
35592                 UINT32_C(0x800)
35593         /* Use fixed layer 2 ether type of 0xFFFF */
35594         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
35595                 UINT32_C(0x1000)
35596         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
35597         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
35598                 UINT32_C(0x2000)
35599         uint8_t unused_0[3];
35600         /*
35601          * This field is used in Output records to indicate that the output
35602          * is completely written to RAM. This field should be read as '1'
35603          * to indicate that the output has been completely written.
35604          * When writing a command completion or response to an internal processor,
35605          * the order of writes has to be such that this field is written last.
35606          */
35607         uint8_t valid;
35608 } __rte_packed;
35609
35610 /*************************
35611  * hwrm_cfa_ctx_mem_rgtr *
35612  *************************/
35613
35614
35615 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
35616 struct hwrm_cfa_ctx_mem_rgtr_input {
35617         /* The HWRM command request type. */
35618         uint16_t        req_type;
35619         /*
35620          * The completion ring to send the completion event on. This should
35621          * be the NQ ID returned from the `nq_alloc` HWRM command.
35622          */
35623         uint16_t        cmpl_ring;
35624         /*
35625          * The sequence ID is used by the driver for tracking multiple
35626          * commands. This ID is treated as opaque data by the firmware and
35627          * the value is returned in the `hwrm_resp_hdr` upon completion.
35628          */
35629         uint16_t        seq_id;
35630         /*
35631          * The target ID of the command:
35632          * * 0x0-0xFFF8 - The function ID
35633          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35634          * * 0xFFFD - Reserved for user-space HWRM interface
35635          * * 0xFFFF - HWRM
35636          */
35637         uint16_t        target_id;
35638         /*
35639          * A physical address pointer pointing to a host buffer that the
35640          * command's response data will be written. This can be either a host
35641          * physical address (HPA) or a guest physical address (GPA) and must
35642          * point to a physically contiguous block of memory.
35643          */
35644         uint64_t        resp_addr;
35645         uint16_t        flags;
35646         /* Counter PBL indirect levels. */
35647         uint8_t page_level;
35648         /* PBL pointer is physical start address. */
35649         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
35650         /* PBL pointer points to PTE table. */
35651         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
35652         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
35653         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
35654         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
35655                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
35656         /* Page size. */
35657         uint8_t page_size;
35658         /* 4KB page size. */
35659         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
35660         /* 8KB page size. */
35661         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
35662         /* 64KB page size. */
35663         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
35664         /* 256KB page size. */
35665         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
35666         /* 1MB page size. */
35667         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
35668         /* 2MB page size. */
35669         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
35670         /* 4MB page size. */
35671         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
35672         /* 1GB page size. */
35673         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
35674         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
35675                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
35676         uint32_t        unused_0;
35677         /* Pointer to the PBL, or PDL depending on number of levels */
35678         uint64_t        page_dir;
35679 } __rte_packed;
35680
35681 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
35682 struct hwrm_cfa_ctx_mem_rgtr_output {
35683         /* The specific error status for the command. */
35684         uint16_t        error_code;
35685         /* The HWRM command request type. */
35686         uint16_t        req_type;
35687         /* The sequence ID from the original command. */
35688         uint16_t        seq_id;
35689         /* The length of the response data in number of bytes. */
35690         uint16_t        resp_len;
35691         /*
35692          * Id/Handle to the recently register context memory. This handle is passed
35693          * to the CFA feature.
35694          */
35695         uint16_t        ctx_id;
35696         uint8_t unused_0[5];
35697         /*
35698          * This field is used in Output records to indicate that the output
35699          * is completely written to RAM. This field should be read as '1'
35700          * to indicate that the output has been completely written.
35701          * When writing a command completion or response to an internal processor,
35702          * the order of writes has to be such that this field is written last.
35703          */
35704         uint8_t valid;
35705 } __rte_packed;
35706
35707 /***************************
35708  * hwrm_cfa_ctx_mem_unrgtr *
35709  ***************************/
35710
35711
35712 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
35713 struct hwrm_cfa_ctx_mem_unrgtr_input {
35714         /* The HWRM command request type. */
35715         uint16_t        req_type;
35716         /*
35717          * The completion ring to send the completion event on. This should
35718          * be the NQ ID returned from the `nq_alloc` HWRM command.
35719          */
35720         uint16_t        cmpl_ring;
35721         /*
35722          * The sequence ID is used by the driver for tracking multiple
35723          * commands. This ID is treated as opaque data by the firmware and
35724          * the value is returned in the `hwrm_resp_hdr` upon completion.
35725          */
35726         uint16_t        seq_id;
35727         /*
35728          * The target ID of the command:
35729          * * 0x0-0xFFF8 - The function ID
35730          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35731          * * 0xFFFD - Reserved for user-space HWRM interface
35732          * * 0xFFFF - HWRM
35733          */
35734         uint16_t        target_id;
35735         /*
35736          * A physical address pointer pointing to a host buffer that the
35737          * command's response data will be written. This can be either a host
35738          * physical address (HPA) or a guest physical address (GPA) and must
35739          * point to a physically contiguous block of memory.
35740          */
35741         uint64_t        resp_addr;
35742         /*
35743          * Id/Handle to the recently register context memory. This handle is passed
35744          * to the CFA feature.
35745          */
35746         uint16_t        ctx_id;
35747         uint8_t unused_0[6];
35748 } __rte_packed;
35749
35750 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
35751 struct hwrm_cfa_ctx_mem_unrgtr_output {
35752         /* The specific error status for the command. */
35753         uint16_t        error_code;
35754         /* The HWRM command request type. */
35755         uint16_t        req_type;
35756         /* The sequence ID from the original command. */
35757         uint16_t        seq_id;
35758         /* The length of the response data in number of bytes. */
35759         uint16_t        resp_len;
35760         uint8_t unused_0[7];
35761         /*
35762          * This field is used in Output records to indicate that the output
35763          * is completely written to RAM. This field should be read as '1'
35764          * to indicate that the output has been completely written.
35765          * When writing a command completion or response to an internal processor,
35766          * the order of writes has to be such that this field is written last.
35767          */
35768         uint8_t valid;
35769 } __rte_packed;
35770
35771 /*************************
35772  * hwrm_cfa_ctx_mem_qctx *
35773  *************************/
35774
35775
35776 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
35777 struct hwrm_cfa_ctx_mem_qctx_input {
35778         /* The HWRM command request type. */
35779         uint16_t        req_type;
35780         /*
35781          * The completion ring to send the completion event on. This should
35782          * be the NQ ID returned from the `nq_alloc` HWRM command.
35783          */
35784         uint16_t        cmpl_ring;
35785         /*
35786          * The sequence ID is used by the driver for tracking multiple
35787          * commands. This ID is treated as opaque data by the firmware and
35788          * the value is returned in the `hwrm_resp_hdr` upon completion.
35789          */
35790         uint16_t        seq_id;
35791         /*
35792          * The target ID of the command:
35793          * * 0x0-0xFFF8 - The function ID
35794          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35795          * * 0xFFFD - Reserved for user-space HWRM interface
35796          * * 0xFFFF - HWRM
35797          */
35798         uint16_t        target_id;
35799         /*
35800          * A physical address pointer pointing to a host buffer that the
35801          * command's response data will be written. This can be either a host
35802          * physical address (HPA) or a guest physical address (GPA) and must
35803          * point to a physically contiguous block of memory.
35804          */
35805         uint64_t        resp_addr;
35806         /*
35807          * Id/Handle to the recently register context memory. This handle is passed
35808          * to the CFA feature.
35809          */
35810         uint16_t        ctx_id;
35811         uint8_t unused_0[6];
35812 } __rte_packed;
35813
35814 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
35815 struct hwrm_cfa_ctx_mem_qctx_output {
35816         /* The specific error status for the command. */
35817         uint16_t        error_code;
35818         /* The HWRM command request type. */
35819         uint16_t        req_type;
35820         /* The sequence ID from the original command. */
35821         uint16_t        seq_id;
35822         /* The length of the response data in number of bytes. */
35823         uint16_t        resp_len;
35824         uint16_t        flags;
35825         /* Counter PBL indirect levels. */
35826         uint8_t page_level;
35827         /* PBL pointer is physical start address. */
35828         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
35829         /* PBL pointer points to PTE table. */
35830         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
35831         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
35832         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
35833         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST \
35834                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
35835         /* Page size. */
35836         uint8_t page_size;
35837         /* 4KB page size. */
35838         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
35839         /* 8KB page size. */
35840         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
35841         /* 64KB page size. */
35842         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
35843         /* 256KB page size. */
35844         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
35845         /* 1MB page size. */
35846         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
35847         /* 2MB page size. */
35848         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
35849         /* 4MB page size. */
35850         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
35851         /* 1GB page size. */
35852         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
35853         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST \
35854                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
35855         uint8_t unused_0[4];
35856         /* Pointer to the PBL, or PDL depending on number of levels */
35857         uint64_t        page_dir;
35858         uint8_t unused_1[7];
35859         /*
35860          * This field is used in Output records to indicate that the output
35861          * is completely written to RAM. This field should be read as '1'
35862          * to indicate that the output has been completely written.
35863          * When writing a command completion or response to an internal processor,
35864          * the order of writes has to be such that this field is written last.
35865          */
35866         uint8_t valid;
35867 } __rte_packed;
35868
35869 /**************************
35870  * hwrm_cfa_ctx_mem_qcaps *
35871  **************************/
35872
35873
35874 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
35875 struct hwrm_cfa_ctx_mem_qcaps_input {
35876         /* The HWRM command request type. */
35877         uint16_t        req_type;
35878         /*
35879          * The completion ring to send the completion event on. This should
35880          * be the NQ ID returned from the `nq_alloc` HWRM command.
35881          */
35882         uint16_t        cmpl_ring;
35883         /*
35884          * The sequence ID is used by the driver for tracking multiple
35885          * commands. This ID is treated as opaque data by the firmware and
35886          * the value is returned in the `hwrm_resp_hdr` upon completion.
35887          */
35888         uint16_t        seq_id;
35889         /*
35890          * The target ID of the command:
35891          * * 0x0-0xFFF8 - The function ID
35892          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35893          * * 0xFFFD - Reserved for user-space HWRM interface
35894          * * 0xFFFF - HWRM
35895          */
35896         uint16_t        target_id;
35897         /*
35898          * A physical address pointer pointing to a host buffer that the
35899          * command's response data will be written. This can be either a host
35900          * physical address (HPA) or a guest physical address (GPA) and must
35901          * point to a physically contiguous block of memory.
35902          */
35903         uint64_t        resp_addr;
35904 } __rte_packed;
35905
35906 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
35907 struct hwrm_cfa_ctx_mem_qcaps_output {
35908         /* The specific error status for the command. */
35909         uint16_t        error_code;
35910         /* The HWRM command request type. */
35911         uint16_t        req_type;
35912         /* The sequence ID from the original command. */
35913         uint16_t        seq_id;
35914         /* The length of the response data in number of bytes. */
35915         uint16_t        resp_len;
35916         /* Indicates the maximum number of context memory which can be registered. */
35917         uint16_t        max_entries;
35918         uint8_t unused_0[5];
35919         /*
35920          * This field is used in Output records to indicate that the output
35921          * is completely written to RAM. This field should be read as '1'
35922          * to indicate that the output has been completely written.
35923          * When writing a command completion or response to an internal processor,
35924          * the order of writes has to be such that this field is written last.
35925          */
35926         uint8_t valid;
35927 } __rte_packed;
35928
35929 /**********************
35930  * hwrm_cfa_eem_qcaps *
35931  **********************/
35932
35933
35934 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
35935 struct hwrm_cfa_eem_qcaps_input {
35936         /* The HWRM command request type. */
35937         uint16_t        req_type;
35938         /*
35939          * The completion ring to send the completion event on. This should
35940          * be the NQ ID returned from the `nq_alloc` HWRM command.
35941          */
35942         uint16_t        cmpl_ring;
35943         /*
35944          * The sequence ID is used by the driver for tracking multiple
35945          * commands. This ID is treated as opaque data by the firmware and
35946          * the value is returned in the `hwrm_resp_hdr` upon completion.
35947          */
35948         uint16_t        seq_id;
35949         /*
35950          * The target ID of the command:
35951          * * 0x0-0xFFF8 - The function ID
35952          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35953          * * 0xFFFD - Reserved for user-space HWRM interface
35954          * * 0xFFFF - HWRM
35955          */
35956         uint16_t        target_id;
35957         /*
35958          * A physical address pointer pointing to a host buffer that the
35959          * command's response data will be written. This can be either a host
35960          * physical address (HPA) or a guest physical address (GPA) and must
35961          * point to a physically contiguous block of memory.
35962          */
35963         uint64_t        resp_addr;
35964         uint32_t        flags;
35965         /*
35966          * When set to 1, indicates the configuration will apply to TX flows
35967          * which are to be offloaded.
35968          * Note if this bit is set then the path_rx bit can't be set.
35969          */
35970         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX \
35971                 UINT32_C(0x1)
35972         /*
35973          * When set to 1, indicates the configuration will apply to RX flows
35974          * which are to be offloaded.
35975          * Note if this bit is set then the path_tx bit can't be set.
35976          */
35977         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX \
35978                 UINT32_C(0x2)
35979         /* When set to 1, all offloaded flows will be sent to EEM. */
35980         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
35981                 UINT32_C(0x4)
35982         uint32_t        unused_0;
35983 } __rte_packed;
35984
35985 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
35986 struct hwrm_cfa_eem_qcaps_output {
35987         /* The specific error status for the command. */
35988         uint16_t        error_code;
35989         /* The HWRM command request type. */
35990         uint16_t        req_type;
35991         /* The sequence ID from the original command. */
35992         uint16_t        seq_id;
35993         /* The length of the response data in number of bytes. */
35994         uint16_t        resp_len;
35995         uint32_t        flags;
35996         /*
35997          * When set to 1, indicates the configuration will apply to TX flows
35998          * which are to be offloaded.
35999          * Note if this bit is set then the path_rx bit can't be set.
36000          */
36001         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX \
36002                 UINT32_C(0x1)
36003         /*
36004          * When set to 1, indicates the configuration will apply to RX flows
36005          * which are to be offloaded.
36006          * Note if this bit is set then the path_tx bit can't be set.
36007          */
36008         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX \
36009                 UINT32_C(0x2)
36010         /*
36011          * When set to 1, indicates the the FW supports the Centralized
36012          * Memory Model. The concept designates one entity for the
36013          * memory allocation while all others ‘subscribe’ to it.
36014          */
36015         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
36016                 UINT32_C(0x4)
36017         /*
36018          * When set to 1, indicates the the FW supports the Detached
36019          * Centralized Memory Model. The memory is allocated and managed
36020          * as a separate entity. All PFs and VFs will be granted direct
36021          * or semi-direct access to the allocated memory while none of
36022          * which can interfere with the management of the memory.
36023          */
36024         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
36025                 UINT32_C(0x8)
36026         uint32_t        unused_0;
36027         uint32_t        supported;
36028         /*
36029          * If set to 1, then EEM KEY0 table is supported using crc32 hash.
36030          * If set to 0, EEM KEY0 table is not supported.
36031          */
36032         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
36033                 UINT32_C(0x1)
36034         /*
36035          * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
36036          * If set to 0, EEM KEY1 table is not supported.
36037          */
36038         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
36039                 UINT32_C(0x2)
36040         /*
36041          * If set to 1, then EEM External Record table is supported.
36042          * If set to 0, EEM External Record table is not supported.
36043          * (This table includes action record, EFC pointers, encap pointers)
36044          */
36045         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
36046                 UINT32_C(0x4)
36047         /*
36048          * If set to 1, then EEM External Flow Counters table is supported.
36049          * If set to 0, EEM External Flow Counters table is not supported.
36050          */
36051         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
36052                 UINT32_C(0x8)
36053         /*
36054          * If set to 1, then FID table used for implicit flow flush is supported.
36055          * If set to 0, then FID table used for implicit flow flush is not supported.
36056          */
36057         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
36058                 UINT32_C(0x10)
36059         /*
36060          * The maximum number of entries supported by EEM. When configuring the host memory
36061          * the number of numbers of entries that can supported are -
36062          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M entries.
36063          * Any value that are not these values, the FW will round down to the closest support
36064          * number of entries.
36065          */
36066         uint32_t        max_entries_supported;
36067         /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
36068         uint16_t        key_entry_size;
36069         /* The entry size in bytes of each entry in the EEM RECORD tables. */
36070         uint16_t        record_entry_size;
36071         /* The entry size in bytes of each entry in the EEM EFC tables. */
36072         uint16_t        efc_entry_size;
36073         /* The FID size in bytes of each entry in the EEM FID tables. */
36074         uint16_t        fid_entry_size;
36075         uint8_t unused_1[7];
36076         /*
36077          * This field is used in Output records to indicate that the output
36078          * is completely written to RAM. This field should be read as '1'
36079          * to indicate that the output has been completely written.
36080          * When writing a command completion or response to an internal processor,
36081          * the order of writes has to be such that this field is written last.
36082          */
36083         uint8_t valid;
36084 } __rte_packed;
36085
36086 /********************
36087  * hwrm_cfa_eem_cfg *
36088  ********************/
36089
36090
36091 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
36092 struct hwrm_cfa_eem_cfg_input {
36093         /* The HWRM command request type. */
36094         uint16_t        req_type;
36095         /*
36096          * The completion ring to send the completion event on. This should
36097          * be the NQ ID returned from the `nq_alloc` HWRM command.
36098          */
36099         uint16_t        cmpl_ring;
36100         /*
36101          * The sequence ID is used by the driver for tracking multiple
36102          * commands. This ID is treated as opaque data by the firmware and
36103          * the value is returned in the `hwrm_resp_hdr` upon completion.
36104          */
36105         uint16_t        seq_id;
36106         /*
36107          * The target ID of the command:
36108          * * 0x0-0xFFF8 - The function ID
36109          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36110          * * 0xFFFD - Reserved for user-space HWRM interface
36111          * * 0xFFFF - HWRM
36112          */
36113         uint16_t        target_id;
36114         /*
36115          * A physical address pointer pointing to a host buffer that the
36116          * command's response data will be written. This can be either a host
36117          * physical address (HPA) or a guest physical address (GPA) and must
36118          * point to a physically contiguous block of memory.
36119          */
36120         uint64_t        resp_addr;
36121         uint32_t        flags;
36122         /*
36123          * When set to 1, indicates the configuration will apply to TX flows
36124          * which are to be offloaded.
36125          * Note if this bit is set then the path_rx bit can't be set.
36126          */
36127         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX \
36128                 UINT32_C(0x1)
36129         /*
36130          * When set to 1, indicates the configuration will apply to RX flows
36131          * which are to be offloaded.
36132          * Note if this bit is set then the path_tx bit can't be set.
36133          */
36134         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX \
36135                 UINT32_C(0x2)
36136         /* When set to 1, all offloaded flows will be sent to EEM. */
36137         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
36138                 UINT32_C(0x4)
36139         /* When set to 1, secondary, 0 means primary. */
36140         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF \
36141                 UINT32_C(0x8)
36142         /*
36143          * Group_id which used by Firmware to identify memory pools belonging
36144          * to certain group.
36145          */
36146         uint16_t        group_id;
36147         uint16_t        unused_0;
36148         /*
36149          * Configured EEM with the given number of entries. All the EEM tables KEY0, KEY1,
36150          * RECORD, EFC all have the same number of entries and all tables will be configured
36151          * using this value. Current minimum value is 32k. Current maximum value is 128M.
36152          */
36153         uint32_t        num_entries;
36154         uint32_t        unused_1;
36155         /* Configured EEM with the given context if for KEY0 table. */
36156         uint16_t        key0_ctx_id;
36157         /* Configured EEM with the given context if for KEY1 table. */
36158         uint16_t        key1_ctx_id;
36159         /* Configured EEM with the given context if for RECORD table. */
36160         uint16_t        record_ctx_id;
36161         /* Configured EEM with the given context if for EFC table. */
36162         uint16_t        efc_ctx_id;
36163         /* Configured EEM with the given context if for EFC table. */
36164         uint16_t        fid_ctx_id;
36165         uint16_t        unused_2;
36166         uint32_t        unused_3;
36167 } __rte_packed;
36168
36169 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
36170 struct hwrm_cfa_eem_cfg_output {
36171         /* The specific error status for the command. */
36172         uint16_t        error_code;
36173         /* The HWRM command request type. */
36174         uint16_t        req_type;
36175         /* The sequence ID from the original command. */
36176         uint16_t        seq_id;
36177         /* The length of the response data in number of bytes. */
36178         uint16_t        resp_len;
36179         uint8_t unused_0[7];
36180         /*
36181          * This field is used in Output records to indicate that the output
36182          * is completely written to RAM. This field should be read as '1'
36183          * to indicate that the output has been completely written.
36184          * When writing a command completion or response to an internal processor,
36185          * the order of writes has to be such that this field is written last.
36186          */
36187         uint8_t valid;
36188 } __rte_packed;
36189
36190 /*********************
36191  * hwrm_cfa_eem_qcfg *
36192  *********************/
36193
36194
36195 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
36196 struct hwrm_cfa_eem_qcfg_input {
36197         /* The HWRM command request type. */
36198         uint16_t        req_type;
36199         /*
36200          * The completion ring to send the completion event on. This should
36201          * be the NQ ID returned from the `nq_alloc` HWRM command.
36202          */
36203         uint16_t        cmpl_ring;
36204         /*
36205          * The sequence ID is used by the driver for tracking multiple
36206          * commands. This ID is treated as opaque data by the firmware and
36207          * the value is returned in the `hwrm_resp_hdr` upon completion.
36208          */
36209         uint16_t        seq_id;
36210         /*
36211          * The target ID of the command:
36212          * * 0x0-0xFFF8 - The function ID
36213          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36214          * * 0xFFFD - Reserved for user-space HWRM interface
36215          * * 0xFFFF - HWRM
36216          */
36217         uint16_t        target_id;
36218         /*
36219          * A physical address pointer pointing to a host buffer that the
36220          * command's response data will be written. This can be either a host
36221          * physical address (HPA) or a guest physical address (GPA) and must
36222          * point to a physically contiguous block of memory.
36223          */
36224         uint64_t        resp_addr;
36225         uint32_t        flags;
36226         /* When set to 1, indicates the configuration is the TX flow. */
36227         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
36228         /* When set to 1, indicates the configuration is the RX flow. */
36229         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
36230         uint32_t        unused_0;
36231 } __rte_packed;
36232
36233 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
36234 struct hwrm_cfa_eem_qcfg_output {
36235         /* The specific error status for the command. */
36236         uint16_t        error_code;
36237         /* The HWRM command request type. */
36238         uint16_t        req_type;
36239         /* The sequence ID from the original command. */
36240         uint16_t        seq_id;
36241         /* The length of the response data in number of bytes. */
36242         uint16_t        resp_len;
36243         uint32_t        flags;
36244         /* When set to 1, indicates the configuration is the TX flow. */
36245         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX \
36246                 UINT32_C(0x1)
36247         /* When set to 1, indicates the configuration is the RX flow. */
36248         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX \
36249                 UINT32_C(0x2)
36250         /* When set to 1, all offloaded flows will be sent to EEM. */
36251         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
36252                 UINT32_C(0x4)
36253         /* The number of entries the FW has configured for EEM. */
36254         uint32_t        num_entries;
36255         /* Configured EEM with the given context if for KEY0 table. */
36256         uint16_t        key0_ctx_id;
36257         /* Configured EEM with the given context if for KEY1 table. */
36258         uint16_t        key1_ctx_id;
36259         /* Configured EEM with the given context if for RECORD table. */
36260         uint16_t        record_ctx_id;
36261         /* Configured EEM with the given context if for EFC table. */
36262         uint16_t        efc_ctx_id;
36263         /* Configured EEM with the given context if for EFC table. */
36264         uint16_t        fid_ctx_id;
36265         uint8_t unused_2[5];
36266         /*
36267          * This field is used in Output records to indicate that the output
36268          * is completely written to RAM. This field should be read as '1'
36269          * to indicate that the output has been completely written.
36270          * When writing a command completion or response to an internal processor,
36271          * the order of writes has to be such that this field is written last.
36272          */
36273         uint8_t valid;
36274 } __rte_packed;
36275
36276 /*******************
36277  * hwrm_cfa_eem_op *
36278  *******************/
36279
36280
36281 /* hwrm_cfa_eem_op_input (size:192b/24B) */
36282 struct hwrm_cfa_eem_op_input {
36283         /* The HWRM command request type. */
36284         uint16_t        req_type;
36285         /*
36286          * The completion ring to send the completion event on. This should
36287          * be the NQ ID returned from the `nq_alloc` HWRM command.
36288          */
36289         uint16_t        cmpl_ring;
36290         /*
36291          * The sequence ID is used by the driver for tracking multiple
36292          * commands. This ID is treated as opaque data by the firmware and
36293          * the value is returned in the `hwrm_resp_hdr` upon completion.
36294          */
36295         uint16_t        seq_id;
36296         /*
36297          * The target ID of the command:
36298          * * 0x0-0xFFF8 - The function ID
36299          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36300          * * 0xFFFD - Reserved for user-space HWRM interface
36301          * * 0xFFFF - HWRM
36302          */
36303         uint16_t        target_id;
36304         /*
36305          * A physical address pointer pointing to a host buffer that the
36306          * command's response data will be written. This can be either a host
36307          * physical address (HPA) or a guest physical address (GPA) and must
36308          * point to a physically contiguous block of memory.
36309          */
36310         uint64_t        resp_addr;
36311         uint32_t        flags;
36312         /*
36313          * When set to 1, indicates the host memory which is passed will be
36314          * used for the TX flow offload function specified in fid.
36315          * Note if this bit is set then the path_rx bit can't be set.
36316          */
36317         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
36318         /*
36319          * When set to 1, indicates the host memory which is passed will be
36320          * used for the RX flow offload function specified in fid.
36321          * Note if this bit is set then the path_tx bit can't be set.
36322          */
36323         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
36324         uint16_t        unused_0;
36325         /* The number of EEM key table entries to be configured. */
36326         uint16_t        op;
36327         /* This value is reserved and should not be used. */
36328         #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED    UINT32_C(0x0)
36329         /*
36330          * To properly stop EEM and ensure there are no DMA's, the caller
36331          * must disable EEM for the given PF, using this call. This will
36332          * safely disable EEM and ensure that all DMA'ed to the
36333          * keys/records/efc have been completed.
36334          */
36335         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
36336         /*
36337          * Once the EEM host memory has been configured, EEM options have
36338          * been configured. Then the caller should enable EEM for the given
36339          * PF. Note once this call has been made, then the EEM mechanism
36340          * will be active and DMA's will occur as packets are processed.
36341          */
36342         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
36343         /*
36344          * Clear EEM settings for the given PF so that the register values
36345          * are reset back to there initial state.
36346          */
36347         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
36348         #define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
36349                 HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
36350 } __rte_packed;
36351
36352 /* hwrm_cfa_eem_op_output (size:128b/16B) */
36353 struct hwrm_cfa_eem_op_output {
36354         /* The specific error status for the command. */
36355         uint16_t        error_code;
36356         /* The HWRM command request type. */
36357         uint16_t        req_type;
36358         /* The sequence ID from the original command. */
36359         uint16_t        seq_id;
36360         /* The length of the response data in number of bytes. */
36361         uint16_t        resp_len;
36362         uint8_t unused_0[7];
36363         /*
36364          * This field is used in Output records to indicate that the output
36365          * is completely written to RAM. This field should be read as '1'
36366          * to indicate that the output has been completely written.
36367          * When writing a command completion or response to an internal processor,
36368          * the order of writes has to be such that this field is written last.
36369          */
36370         uint8_t valid;
36371 } __rte_packed;
36372
36373 /********************************
36374  * hwrm_cfa_adv_flow_mgnt_qcaps *
36375  ********************************/
36376
36377
36378 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
36379 struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
36380         /* The HWRM command request type. */
36381         uint16_t        req_type;
36382         /*
36383          * The completion ring to send the completion event on. This should
36384          * be the NQ ID returned from the `nq_alloc` HWRM command.
36385          */
36386         uint16_t        cmpl_ring;
36387         /*
36388          * The sequence ID is used by the driver for tracking multiple
36389          * commands. This ID is treated as opaque data by the firmware and
36390          * the value is returned in the `hwrm_resp_hdr` upon completion.
36391          */
36392         uint16_t        seq_id;
36393         /*
36394          * The target ID of the command:
36395          * * 0x0-0xFFF8 - The function ID
36396          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36397          * * 0xFFFD - Reserved for user-space HWRM interface
36398          * * 0xFFFF - HWRM
36399          */
36400         uint16_t        target_id;
36401         /*
36402          * A physical address pointer pointing to a host buffer that the
36403          * command's response data will be written. This can be either a host
36404          * physical address (HPA) or a guest physical address (GPA) and must
36405          * point to a physically contiguous block of memory.
36406          */
36407         uint64_t        resp_addr;
36408         uint32_t        unused_0[4];
36409 } __rte_packed;
36410
36411 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
36412 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
36413         /* The specific error status for the command. */
36414         uint16_t        error_code;
36415         /* The HWRM command request type. */
36416         uint16_t        req_type;
36417         /* The sequence ID from the original command. */
36418         uint16_t        seq_id;
36419         /* The length of the response data in number of bytes. */
36420         uint16_t        resp_len;
36421         uint32_t        flags;
36422         /*
36423          * Value of 1 to indicate firmware support 16-bit flow handle.
36424          * Value of 0 to indicate firmware not support 16-bit flow handle.
36425          */
36426         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED \
36427                 UINT32_C(0x1)
36428         /*
36429          * Value of 1 to indicate firmware support 64-bit flow handle.
36430          * Value of 0 to indicate firmware not support 64-bit flow handle.
36431          */
36432         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED \
36433                 UINT32_C(0x2)
36434         /*
36435          * Value of 1 to indicate firmware support flow batch delete operation through
36436          * HWRM_CFA_FLOW_FLUSH command.
36437          * Value of 0 to indicate that the firmware does not support flow batch delete
36438          * operation.
36439          */
36440         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED \
36441                 UINT32_C(0x4)
36442         /*
36443          * Value of 1 to indicate that the firmware support flow reset all operation through
36444          * HWRM_CFA_FLOW_FLUSH command.
36445          * Value of 0 indicates firmware does not support flow reset all operation.
36446          */
36447         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED \
36448                 UINT32_C(0x8)
36449         /*
36450          * Value of 1 to indicate that firmware supports use of FID as dest_id in
36451          * HWRM_CFA_NTUPLE_ALLOC/CFG commands.
36452          * Value of 0 indicates firmware does not support use of FID as dest_id.
36453          */
36454         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED \
36455                 UINT32_C(0x10)
36456         /*
36457          * Value of 1 to indicate that firmware supports TX EEM flows.
36458          * Value of 0 indicates firmware does not support TX EEM flows.
36459          */
36460         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED \
36461                 UINT32_C(0x20)
36462         /*
36463          * Value of 1 to indicate that firmware supports RX EEM flows.
36464          * Value of 0 indicates firmware does not support RX EEM flows.
36465          */
36466         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED \
36467                 UINT32_C(0x40)
36468         /*
36469          * Value of 1 to indicate that firmware supports the dynamic allocation of an
36470          * on-chip flow counter which can be used for EEM flows.
36471          * Value of 0 indicates firmware does not support the dynamic allocation of an
36472          * on-chip flow counter.
36473          */
36474         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED \
36475                 UINT32_C(0x80)
36476         /*
36477          * Value of 1 to indicate that firmware supports setting of
36478          * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
36479          * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
36480          */
36481         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED \
36482                 UINT32_C(0x100)
36483         /*
36484          * Value of 1 to indicate that firmware supports untagged matching
36485          * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
36486          * indicates firmware does not support untagged matching.
36487          */
36488         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED \
36489                 UINT32_C(0x200)
36490         /*
36491          * Value of 1 to indicate that firmware supports XDP filter. Value
36492          * of 0 indicates firmware does not support XDP filter.
36493          */
36494         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED \
36495                 UINT32_C(0x400)
36496         /*
36497          * Value of 1 to indicate that the firmware support L2 header source
36498          * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
36499          * Value of 0 indicates firmware does not support L2 header source
36500          * fields matching.
36501          */
36502         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED \
36503                 UINT32_C(0x800)
36504         /*
36505          * If set to 1, firmware is capable of supporting ARP ethertype as
36506          * matching criteria for HWRM_CFA_NTUPLE_FILTER_ALLOC command on the
36507          * RX direction. By default, this flag should be 0 for older version
36508          * of firmware.
36509          */
36510         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ARP_SUPPORTED \
36511                 UINT32_C(0x1000)
36512         /*
36513          * Value of 1 to indicate that firmware supports setting of
36514          * rfs_ring_tbl_idx in dst_id field of the HWRM_CFA_NTUPLE_ALLOC
36515          * command. Value of 0 indicates firmware does not support
36516          * rfs_ring_tbl_idx in dst_id field.
36517          */
36518         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V2_SUPPORTED \
36519                 UINT32_C(0x2000)
36520         /*
36521          * If set to 1, firmware is capable of supporting IPv4/IPv6 as
36522          * ethertype in HWRM_CFA_NTUPLE_FILTER_ALLOC command on the RX
36523          * direction. By default, this flag should be 0 for older version
36524          * of firmware.
36525          */
36526         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ETHERTYPE_IP_SUPPORTED \
36527                 UINT32_C(0x4000)
36528         uint8_t unused_0[3];
36529         /*
36530          * This field is used in Output records to indicate that the output
36531          * is completely written to RAM. This field should be read as '1'
36532          * to indicate that the output has been completely written.
36533          * When writing a command completion or response to an internal processor,
36534          * the order of writes has to be such that this field is written last.
36535          */
36536         uint8_t valid;
36537 } __rte_packed;
36538
36539 /******************
36540  * hwrm_cfa_tflib *
36541  ******************/
36542
36543
36544 /* hwrm_cfa_tflib_input (size:1024b/128B) */
36545 struct hwrm_cfa_tflib_input {
36546         /* The HWRM command request type. */
36547         uint16_t        req_type;
36548         /*
36549          * The completion ring to send the completion event on. This should
36550          * be the NQ ID returned from the `nq_alloc` HWRM command.
36551          */
36552         uint16_t        cmpl_ring;
36553         /*
36554          * The sequence ID is used by the driver for tracking multiple
36555          * commands. This ID is treated as opaque data by the firmware and
36556          * the value is returned in the `hwrm_resp_hdr` upon completion.
36557          */
36558         uint16_t        seq_id;
36559         /*
36560          * The target ID of the command:
36561          * * 0x0-0xFFF8 - The function ID
36562          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36563          * * 0xFFFD - Reserved for user-space HWRM interface
36564          * * 0xFFFF - HWRM
36565          */
36566         uint16_t        target_id;
36567         /*
36568          * A physical address pointer pointing to a host buffer that the
36569          * command's response data will be written. This can be either a host
36570          * physical address (HPA) or a guest physical address (GPA) and must
36571          * point to a physically contiguous block of memory.
36572          */
36573         uint64_t        resp_addr;
36574         /* TFLIB message type. */
36575         uint16_t        tf_type;
36576         /* TFLIB message subtype. */
36577         uint16_t        tf_subtype;
36578         /* unused. */
36579         uint8_t unused0[4];
36580         /* TFLIB request data. */
36581         uint32_t        tf_req[26];
36582 } __rte_packed;
36583
36584 /* hwrm_cfa_tflib_output (size:5632b/704B) */
36585 struct hwrm_cfa_tflib_output {
36586         /* The specific error status for the command. */
36587         uint16_t        error_code;
36588         /* The HWRM command request type. */
36589         uint16_t        req_type;
36590         /* The sequence ID from the original command. */
36591         uint16_t        seq_id;
36592         /* The length of the response data in number of bytes. */
36593         uint16_t        resp_len;
36594         /* TFLIB message type. */
36595         uint16_t        tf_type;
36596         /* TFLIB message subtype. */
36597         uint16_t        tf_subtype;
36598         /* TFLIB response code */
36599         uint32_t        tf_resp_code;
36600         /* TFLIB response data. */
36601         uint32_t        tf_resp[170];
36602         /* unused. */
36603         uint8_t unused1[7];
36604         /*
36605          * This field is used in Output records to indicate that the output
36606          * is completely written to RAM. This field should be read as '1'
36607          * to indicate that the output has been completely written.
36608          * When writing a command completion or response to an internal processor,
36609          * the order of writes has to be such that this field is written last.
36610          */
36611         uint8_t valid;
36612 } __rte_packed;
36613
36614 /***********
36615  * hwrm_tf *
36616  ***********/
36617
36618
36619 /* hwrm_tf_input (size:1024b/128B) */
36620 struct hwrm_tf_input {
36621         /* The HWRM command request type. */
36622         uint16_t        req_type;
36623         /*
36624          * The completion ring to send the completion event on. This should
36625          * be the NQ ID returned from the `nq_alloc` HWRM command.
36626          */
36627         uint16_t        cmpl_ring;
36628         /*
36629          * The sequence ID is used by the driver for tracking multiple
36630          * commands. This ID is treated as opaque data by the firmware and
36631          * the value is returned in the `hwrm_resp_hdr` upon completion.
36632          */
36633         uint16_t        seq_id;
36634         /*
36635          * The target ID of the command:
36636          * * 0x0-0xFFF8 - The function ID
36637          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36638          * * 0xFFFD - Reserved for user-space HWRM interface
36639          * * 0xFFFF - HWRM
36640          */
36641         uint16_t        target_id;
36642         /*
36643          * A physical address pointer pointing to a host buffer that the
36644          * command's response data will be written. This can be either a host
36645          * physical address (HPA) or a guest physical address (GPA) and must
36646          * point to a physically contiguous block of memory.
36647          */
36648         uint64_t        resp_addr;
36649         /* TF message type. */
36650         uint16_t        type;
36651         /* TF message subtype. */
36652         uint16_t        subtype;
36653         /* unused. */
36654         uint8_t unused0[4];
36655         /* TF request data. */
36656         uint32_t        req[26];
36657 } __rte_packed;
36658
36659 /* hwrm_tf_output (size:5632b/704B) */
36660 struct hwrm_tf_output {
36661         /* The specific error status for the command. */
36662         uint16_t        error_code;
36663         /* The HWRM command request type. */
36664         uint16_t        req_type;
36665         /* The sequence ID from the original command. */
36666         uint16_t        seq_id;
36667         /* The length of the response data in number of bytes. */
36668         uint16_t        resp_len;
36669         /* TF message type. */
36670         uint16_t        type;
36671         /* TF message subtype. */
36672         uint16_t        subtype;
36673         /* TF response code */
36674         uint32_t        resp_code;
36675         /* TF response data. */
36676         uint32_t        resp[170];
36677         /* unused. */
36678         uint8_t unused1[7];
36679         /*
36680          * This field is used in Output records to indicate that the
36681          * output is completely written to RAM. This field should be
36682          * read as '1' to indicate that the output has been
36683          * completely written.  When writing a command completion or
36684          * response to an internal processor, the order of writes has
36685          * to be such that this field is written last.
36686          */
36687         uint8_t valid;
36688 } __rte_packed;
36689
36690 /***********************
36691  * hwrm_tf_version_get *
36692  ***********************/
36693
36694
36695 /* hwrm_tf_version_get_input (size:128b/16B) */
36696 struct hwrm_tf_version_get_input {
36697         /* The HWRM command request type. */
36698         uint16_t        req_type;
36699         /*
36700          * The completion ring to send the completion event on. This should
36701          * be the NQ ID returned from the `nq_alloc` HWRM command.
36702          */
36703         uint16_t        cmpl_ring;
36704         /*
36705          * The sequence ID is used by the driver for tracking multiple
36706          * commands. This ID is treated as opaque data by the firmware and
36707          * the value is returned in the `hwrm_resp_hdr` upon completion.
36708          */
36709         uint16_t        seq_id;
36710         /*
36711          * The target ID of the command:
36712          * * 0x0-0xFFF8 - The function ID
36713          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36714          * * 0xFFFD - Reserved for user-space HWRM interface
36715          * * 0xFFFF - HWRM
36716          */
36717         uint16_t        target_id;
36718         /*
36719          * A physical address pointer pointing to a host buffer that the
36720          * command's response data will be written. This can be either a host
36721          * physical address (HPA) or a guest physical address (GPA) and must
36722          * point to a physically contiguous block of memory.
36723          */
36724         uint64_t        resp_addr;
36725 } __rte_packed;
36726
36727 /* hwrm_tf_version_get_output (size:128b/16B) */
36728 struct hwrm_tf_version_get_output {
36729         /* The specific error status for the command. */
36730         uint16_t        error_code;
36731         /* The HWRM command request type. */
36732         uint16_t        req_type;
36733         /* The sequence ID from the original command. */
36734         uint16_t        seq_id;
36735         /* The length of the response data in number of bytes. */
36736         uint16_t        resp_len;
36737         /* Version Major number. */
36738         uint8_t major;
36739         /* Version Minor number. */
36740         uint8_t minor;
36741         /* Version Update number. */
36742         uint8_t update;
36743         /* unused. */
36744         uint8_t unused0[4];
36745         /*
36746          * This field is used in Output records to indicate that the output
36747          * is completely written to RAM. This field should be read as '1'
36748          * to indicate that the output has been completely written.
36749          * When writing a command completion or response to an internal
36750          * processor, the order of writes has to be such that this field is
36751          * written last.
36752          */
36753         uint8_t valid;
36754 } __rte_packed;
36755
36756 /************************
36757  * hwrm_tf_session_open *
36758  ************************/
36759
36760
36761 /* hwrm_tf_session_open_input (size:640b/80B) */
36762 struct hwrm_tf_session_open_input {
36763         /* The HWRM command request type. */
36764         uint16_t        req_type;
36765         /*
36766          * The completion ring to send the completion event on. This should
36767          * be the NQ ID returned from the `nq_alloc` HWRM command.
36768          */
36769         uint16_t        cmpl_ring;
36770         /*
36771          * The sequence ID is used by the driver for tracking multiple
36772          * commands. This ID is treated as opaque data by the firmware and
36773          * the value is returned in the `hwrm_resp_hdr` upon completion.
36774          */
36775         uint16_t        seq_id;
36776         /*
36777          * The target ID of the command:
36778          * * 0x0-0xFFF8 - The function ID
36779          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36780          * * 0xFFFD - Reserved for user-space HWRM interface
36781          * * 0xFFFF - HWRM
36782          */
36783         uint16_t        target_id;
36784         /*
36785          * A physical address pointer pointing to a host buffer that the
36786          * command's response data will be written. This can be either a host
36787          * physical address (HPA) or a guest physical address (GPA) and must
36788          * point to a physically contiguous block of memory.
36789          */
36790         uint64_t        resp_addr;
36791         /* Name of the session. */
36792         uint8_t session_name[64];
36793 } __rte_packed;
36794
36795 /* hwrm_tf_session_open_output (size:192b/24B) */
36796 struct hwrm_tf_session_open_output {
36797         /* The specific error status for the command. */
36798         uint16_t        error_code;
36799         /* The HWRM command request type. */
36800         uint16_t        req_type;
36801         /* The sequence ID from the original command. */
36802         uint16_t        seq_id;
36803         /* The length of the response data in number of bytes. */
36804         uint16_t        resp_len;
36805         /*
36806          * Unique session identifier for the session created by the
36807          * firmware.
36808          */
36809         uint32_t        fw_session_id;
36810         /*
36811          * Unique session client identifier for the first client on
36812          * the newly created session.
36813          */
36814         uint32_t        fw_session_client_id;
36815         /* unused. */
36816         uint32_t        unused0;
36817         /* unused. */
36818         uint8_t unused1[3];
36819         /*
36820          * This field is used in Output records to indicate that the output
36821          * is completely written to RAM. This field should be read as '1'
36822          * to indicate that the output has been completely written.
36823          * When writing a command completion or response to an internal
36824          * processor, the order of writes has to be such that this field is
36825          * written last.
36826          */
36827         uint8_t valid;
36828 } __rte_packed;
36829
36830 /**************************
36831  * hwrm_tf_session_attach *
36832  **************************/
36833
36834
36835 /* hwrm_tf_session_attach_input (size:704b/88B) */
36836 struct hwrm_tf_session_attach_input {
36837         /* The HWRM command request type. */
36838         uint16_t        req_type;
36839         /*
36840          * The completion ring to send the completion event on. This should
36841          * be the NQ ID returned from the `nq_alloc` HWRM command.
36842          */
36843         uint16_t        cmpl_ring;
36844         /*
36845          * The sequence ID is used by the driver for tracking multiple
36846          * commands. This ID is treated as opaque data by the firmware and
36847          * the value is returned in the `hwrm_resp_hdr` upon completion.
36848          */
36849         uint16_t        seq_id;
36850         /*
36851          * The target ID of the command:
36852          * * 0x0-0xFFF8 - The function ID
36853          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36854          * * 0xFFFD - Reserved for user-space HWRM interface
36855          * * 0xFFFF - HWRM
36856          */
36857         uint16_t        target_id;
36858         /*
36859          * A physical address pointer pointing to a host buffer that the
36860          * command's response data will be written. This can be either a host
36861          * physical address (HPA) or a guest physical address (GPA) and must
36862          * point to a physically contiguous block of memory.
36863          */
36864         uint64_t        resp_addr;
36865         /*
36866          * Unique session identifier for the session that the attach
36867          * request want to attach to. This value originates from the
36868          * shared session memory that the attach request opened by
36869          * way of the 'attach name' that was passed in to the core
36870          * attach API.
36871          * The fw_session_id of the attach session includes PCIe bus
36872          * info to distinguish the PF and session info to identify
36873          * the associated TruFlow session.
36874          */
36875         uint32_t        attach_fw_session_id;
36876         /* unused. */
36877         uint32_t        unused0;
36878         /* Name of the session it self. */
36879         uint8_t session_name[64];
36880 } __rte_packed;
36881
36882 /* hwrm_tf_session_attach_output (size:128b/16B) */
36883 struct hwrm_tf_session_attach_output {
36884         /* The specific error status for the command. */
36885         uint16_t        error_code;
36886         /* The HWRM command request type. */
36887         uint16_t        req_type;
36888         /* The sequence ID from the original command. */
36889         uint16_t        seq_id;
36890         /* The length of the response data in number of bytes. */
36891         uint16_t        resp_len;
36892         /*
36893          * Unique session identifier for the session created by the
36894          * firmware. It includes PCIe bus info to distinguish the PF
36895          * and session info to identify the associated TruFlow
36896          * session. This fw_session_id is unique to the attach
36897          * request.
36898          */
36899         uint32_t        fw_session_id;
36900         /* unused. */
36901         uint8_t unused0[3];
36902         /*
36903          * This field is used in Output records to indicate that the output
36904          * is completely written to RAM. This field should be read as '1'
36905          * to indicate that the output has been completely written.
36906          * When writing a command completion or response to an internal
36907          * processor, the order of writes has to be such that this field is
36908          * written last.
36909          */
36910         uint8_t valid;
36911 } __rte_packed;
36912
36913 /****************************
36914  * hwrm_tf_session_register *
36915  ****************************/
36916
36917
36918 /* hwrm_tf_session_register_input (size:704b/88B) */
36919 struct hwrm_tf_session_register_input {
36920         /* The HWRM command request type. */
36921         uint16_t        req_type;
36922         /*
36923          * The completion ring to send the completion event on. This should
36924          * be the NQ ID returned from the `nq_alloc` HWRM command.
36925          */
36926         uint16_t        cmpl_ring;
36927         /*
36928          * The sequence ID is used by the driver for tracking multiple
36929          * commands. This ID is treated as opaque data by the firmware and
36930          * the value is returned in the `hwrm_resp_hdr` upon completion.
36931          */
36932         uint16_t        seq_id;
36933         /*
36934          * The target ID of the command:
36935          * * 0x0-0xFFF8 - The function ID
36936          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36937          * * 0xFFFD - Reserved for user-space HWRM interface
36938          * * 0xFFFF - HWRM
36939          */
36940         uint16_t        target_id;
36941         /*
36942          * A physical address pointer pointing to a host buffer that the
36943          * command's response data will be written. This can be either a host
36944          * physical address (HPA) or a guest physical address (GPA) and must
36945          * point to a physically contiguous block of memory.
36946          */
36947         uint64_t        resp_addr;
36948         /*
36949          * Unique session identifier for the session that the
36950          * register request want to create a new client on. This
36951          * value originates from the first open request.
36952          * The fw_session_id of the attach session includes PCIe bus
36953          * info to distinguish the PF and session info to identify
36954          * the associated TruFlow session.
36955          */
36956         uint32_t        fw_session_id;
36957         /* unused. */
36958         uint32_t        unused0;
36959         /* Name of the session client. */
36960         uint8_t session_client_name[64];
36961 } __rte_packed;
36962
36963 /* hwrm_tf_session_register_output (size:128b/16B) */
36964 struct hwrm_tf_session_register_output {
36965         /* The specific error status for the command. */
36966         uint16_t        error_code;
36967         /* The HWRM command request type. */
36968         uint16_t        req_type;
36969         /* The sequence ID from the original command. */
36970         uint16_t        seq_id;
36971         /* The length of the response data in number of bytes. */
36972         uint16_t        resp_len;
36973         /*
36974          * Unique session client identifier for the session created
36975          * by the firmware. It includes the session the client it
36976          * attached to and session client info.
36977          */
36978         uint32_t        fw_session_client_id;
36979         /* unused. */
36980         uint8_t unused0[3];
36981         /*
36982          * This field is used in Output records to indicate that the output
36983          * is completely written to RAM. This field should be read as '1'
36984          * to indicate that the output has been completely written.
36985          * When writing a command completion or response to an internal
36986          * processor, the order of writes has to be such that this field is
36987          * written last.
36988          */
36989         uint8_t valid;
36990 } __rte_packed;
36991
36992 /******************************
36993  * hwrm_tf_session_unregister *
36994  ******************************/
36995
36996
36997 /* hwrm_tf_session_unregister_input (size:192b/24B) */
36998 struct hwrm_tf_session_unregister_input {
36999         /* The HWRM command request type. */
37000         uint16_t        req_type;
37001         /*
37002          * The completion ring to send the completion event on. This should
37003          * be the NQ ID returned from the `nq_alloc` HWRM command.
37004          */
37005         uint16_t        cmpl_ring;
37006         /*
37007          * The sequence ID is used by the driver for tracking multiple
37008          * commands. This ID is treated as opaque data by the firmware and
37009          * the value is returned in the `hwrm_resp_hdr` upon completion.
37010          */
37011         uint16_t        seq_id;
37012         /*
37013          * The target ID of the command:
37014          * * 0x0-0xFFF8 - The function ID
37015          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37016          * * 0xFFFD - Reserved for user-space HWRM interface
37017          * * 0xFFFF - HWRM
37018          */
37019         uint16_t        target_id;
37020         /*
37021          * A physical address pointer pointing to a host buffer that the
37022          * command's response data will be written. This can be either a host
37023          * physical address (HPA) or a guest physical address (GPA) and must
37024          * point to a physically contiguous block of memory.
37025          */
37026         uint64_t        resp_addr;
37027         /*
37028          * Unique session identifier for the session that the
37029          * unregister request want to close a session client on.
37030          */
37031         uint32_t        fw_session_id;
37032         /*
37033          * Unique session client identifier for the session that the
37034          * unregister request want to close.
37035          */
37036         uint32_t        fw_session_client_id;
37037 } __rte_packed;
37038
37039 /* hwrm_tf_session_unregister_output (size:128b/16B) */
37040 struct hwrm_tf_session_unregister_output {
37041         /* The specific error status for the command. */
37042         uint16_t        error_code;
37043         /* The HWRM command request type. */
37044         uint16_t        req_type;
37045         /* The sequence ID from the original command. */
37046         uint16_t        seq_id;
37047         /* The length of the response data in number of bytes. */
37048         uint16_t        resp_len;
37049         /* unused. */
37050         uint8_t unused0[7];
37051         /*
37052          * This field is used in Output records to indicate that the output
37053          * is completely written to RAM. This field should be read as '1'
37054          * to indicate that the output has been completely written.
37055          * When writing a command completion or response to an internal
37056          * processor, the order of writes has to be such that this field is
37057          * written last.
37058          */
37059         uint8_t valid;
37060 } __rte_packed;
37061
37062 /*************************
37063  * hwrm_tf_session_close *
37064  *************************/
37065
37066
37067 /* hwrm_tf_session_close_input (size:192b/24B) */
37068 struct hwrm_tf_session_close_input {
37069         /* The HWRM command request type. */
37070         uint16_t        req_type;
37071         /*
37072          * The completion ring to send the completion event on. This should
37073          * be the NQ ID returned from the `nq_alloc` HWRM command.
37074          */
37075         uint16_t        cmpl_ring;
37076         /*
37077          * The sequence ID is used by the driver for tracking multiple
37078          * commands. This ID is treated as opaque data by the firmware and
37079          * the value is returned in the `hwrm_resp_hdr` upon completion.
37080          */
37081         uint16_t        seq_id;
37082         /*
37083          * The target ID of the command:
37084          * * 0x0-0xFFF8 - The function ID
37085          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37086          * * 0xFFFD - Reserved for user-space HWRM interface
37087          * * 0xFFFF - HWRM
37088          */
37089         uint16_t        target_id;
37090         /*
37091          * A physical address pointer pointing to a host buffer that the
37092          * command's response data will be written. This can be either a host
37093          * physical address (HPA) or a guest physical address (GPA) and must
37094          * point to a physically contiguous block of memory.
37095          */
37096         uint64_t        resp_addr;
37097         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37098         uint32_t        fw_session_id;
37099         /* unused. */
37100         uint8_t unused0[4];
37101 } __rte_packed;
37102
37103 /* hwrm_tf_session_close_output (size:128b/16B) */
37104 struct hwrm_tf_session_close_output {
37105         /* The specific error status for the command. */
37106         uint16_t        error_code;
37107         /* The HWRM command request type. */
37108         uint16_t        req_type;
37109         /* The sequence ID from the original command. */
37110         uint16_t        seq_id;
37111         /* The length of the response data in number of bytes. */
37112         uint16_t        resp_len;
37113         /* unused. */
37114         uint8_t unused0[7];
37115         /*
37116          * This field is used in Output records to indicate that the output
37117          * is completely written to RAM. This field should be read as '1'
37118          * to indicate that the output has been completely written.
37119          * When writing a command completion or response to an internal
37120          * processor, the order of writes has to be such that this field
37121          * is written last.
37122          */
37123         uint8_t valid;
37124 } __rte_packed;
37125
37126 /************************
37127  * hwrm_tf_session_qcfg *
37128  ************************/
37129
37130
37131 /* hwrm_tf_session_qcfg_input (size:192b/24B) */
37132 struct hwrm_tf_session_qcfg_input {
37133         /* The HWRM command request type. */
37134         uint16_t        req_type;
37135         /*
37136          * The completion ring to send the completion event on. This should
37137          * be the NQ ID returned from the `nq_alloc` HWRM command.
37138          */
37139         uint16_t        cmpl_ring;
37140         /*
37141          * The sequence ID is used by the driver for tracking multiple
37142          * commands. This ID is treated as opaque data by the firmware and
37143          * the value is returned in the `hwrm_resp_hdr` upon completion.
37144          */
37145         uint16_t        seq_id;
37146         /*
37147          * The target ID of the command:
37148          * * 0x0-0xFFF8 - The function ID
37149          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37150          * * 0xFFFD - Reserved for user-space HWRM interface
37151          * * 0xFFFF - HWRM
37152          */
37153         uint16_t        target_id;
37154         /*
37155          * A physical address pointer pointing to a host buffer that the
37156          * command's response data will be written. This can be either a host
37157          * physical address (HPA) or a guest physical address (GPA) and must
37158          * point to a physically contiguous block of memory.
37159          */
37160         uint64_t        resp_addr;
37161         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37162         uint32_t        fw_session_id;
37163         /* unused. */
37164         uint8_t unused0[4];
37165 } __rte_packed;
37166
37167 /* hwrm_tf_session_qcfg_output (size:128b/16B) */
37168 struct hwrm_tf_session_qcfg_output {
37169         /* The specific error status for the command. */
37170         uint16_t        error_code;
37171         /* The HWRM command request type. */
37172         uint16_t        req_type;
37173         /* The sequence ID from the original command. */
37174         uint16_t        seq_id;
37175         /* The length of the response data in number of bytes. */
37176         uint16_t        resp_len;
37177         /* RX action control settings flags. */
37178         uint8_t rx_act_flags;
37179         /*
37180          * A value of 1 in this field indicates that Global Flow ID
37181          * reporting into cfa_code and cfa_metadata is enabled.
37182          */
37183         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_GFID_EN \
37184                 UINT32_C(0x1)
37185         /*
37186          * A value of 1 in this field indicates that both inner and outer
37187          * are stripped and inner tag is passed.
37188          * Enabled.
37189          */
37190         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_VTAG_DLT_BOTH \
37191                 UINT32_C(0x2)
37192         /*
37193          * A value of 1 in this field indicates that the re-use of
37194          * existing tunnel L2 header SMAC is enabled for
37195          * Non-tunnel L2, L2-L3 and IP-IP tunnel.
37196          */
37197         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_TECT_SMAC_OVR_RUTNSL2 \
37198                 UINT32_C(0x4)
37199         /* TX Action control settings flags. */
37200         uint8_t tx_act_flags;
37201         /* Disabled. */
37202         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_ABCR_VEB_EN \
37203                 UINT32_C(0x1)
37204         /*
37205          * When set to 1 any GRE tunnels will include the
37206          * optional Key field.
37207          */
37208         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_GRE_SET_K \
37209                 UINT32_C(0x2)
37210         /*
37211          * When set to 1, for GRE tunnels, the IPV6 Traffic Class (TC)
37212          * field of the outer header is inherited from the inner header
37213          * (if present) or the fixed value as taken from the encap
37214          * record.
37215          */
37216         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV6_TC_IH \
37217                 UINT32_C(0x4)
37218         /*
37219          * When set to 1, for GRE tunnels, the IPV4 Type Of Service (TOS)
37220          * field of the outer header is inherited from the inner header
37221          * (if present) or the fixed value as taken from the encap record.
37222          */
37223         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV4_TOS_IH \
37224                 UINT32_C(0x8)
37225         /* unused. */
37226         uint8_t unused0[5];
37227         /*
37228          * This field is used in Output records to indicate that the output
37229          * is completely written to RAM. This field should be read as '1'
37230          * to indicate that the output has been completely written.
37231          * When writing a command completion or response to an internal
37232          * processor, the order of writes has to be such that this field
37233          * is written last.
37234          */
37235         uint8_t valid;
37236 } __rte_packed;
37237
37238 /******************************
37239  * hwrm_tf_session_resc_qcaps *
37240  ******************************/
37241
37242
37243 /* hwrm_tf_session_resc_qcaps_input (size:256b/32B) */
37244 struct hwrm_tf_session_resc_qcaps_input {
37245         /* The HWRM command request type. */
37246         uint16_t        req_type;
37247         /*
37248          * The completion ring to send the completion event on. This should
37249          * be the NQ ID returned from the `nq_alloc` HWRM command.
37250          */
37251         uint16_t        cmpl_ring;
37252         /*
37253          * The sequence ID is used by the driver for tracking multiple
37254          * commands. This ID is treated as opaque data by the firmware and
37255          * the value is returned in the `hwrm_resp_hdr` upon completion.
37256          */
37257         uint16_t        seq_id;
37258         /*
37259          * The target ID of the command:
37260          * * 0x0-0xFFF8 - The function ID
37261          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37262          * * 0xFFFD - Reserved for user-space HWRM interface
37263          * * 0xFFFF - HWRM
37264          */
37265         uint16_t        target_id;
37266         /*
37267          * A physical address pointer pointing to a host buffer that the
37268          * command's response data will be written. This can be either a host
37269          * physical address (HPA) or a guest physical address (GPA) and must
37270          * point to a physically contiguous block of memory.
37271          */
37272         uint64_t        resp_addr;
37273         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37274         uint32_t        fw_session_id;
37275         /* Control flags. */
37276         uint16_t        flags;
37277         /* Indicates the flow direction. */
37278         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR     UINT32_C(0x1)
37279         /* If this bit set to 0, then it indicates rx flow. */
37280         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
37281         /* If this bit is set to 1, then it indicates that tx flow. */
37282         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
37283         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST \
37284                 HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX
37285         /*
37286          * Defines the size of the provided qcaps_addr array
37287          * buffer. The size should be set to the Resource Manager
37288          * provided max number of qcaps entries which is device
37289          * specific. Resource Manager gets the max size from HCAPI
37290          * RM.
37291          */
37292         uint16_t        qcaps_size;
37293         /*
37294          * This is the DMA address for the qcaps output data array
37295          * buffer. Array is of tf_rm_resc_req_entry type and is
37296          * device specific.
37297          */
37298         uint64_t        qcaps_addr;
37299 } __rte_packed;
37300
37301 /* hwrm_tf_session_resc_qcaps_output (size:192b/24B) */
37302 struct hwrm_tf_session_resc_qcaps_output {
37303         /* The specific error status for the command. */
37304         uint16_t        error_code;
37305         /* The HWRM command request type. */
37306         uint16_t        req_type;
37307         /* The sequence ID from the original command. */
37308         uint16_t        seq_id;
37309         /* The length of the response data in number of bytes. */
37310         uint16_t        resp_len;
37311         /* Control flags. */
37312         uint32_t        flags;
37313         /* Session reservation strategy. */
37314         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK \
37315                 UINT32_C(0x3)
37316         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT \
37317                 0
37318         /* Static partitioning. */
37319         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC \
37320                 UINT32_C(0x0)
37321         /* Strategy 1. */
37322         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1 \
37323                 UINT32_C(0x1)
37324         /* Strategy 2. */
37325         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2 \
37326                 UINT32_C(0x2)
37327         /* Strategy 3. */
37328         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3 \
37329                 UINT32_C(0x3)
37330         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST \
37331                 HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3
37332         /*
37333          * Size of the returned qcaps_addr data array buffer. The
37334          * value cannot exceed the size defined by the input msg,
37335          * qcaps_size.
37336          */
37337         uint16_t        size;
37338         /* unused. */
37339         uint16_t        unused0;
37340         /* unused. */
37341         uint8_t unused1[7];
37342         /*
37343          * This field is used in Output records to indicate that the output
37344          * is completely written to RAM. This field should be read as '1'
37345          * to indicate that the output has been completely written.
37346          * When writing a command completion or response to an internal
37347          * processor, the order of writes has to be such that this field is
37348          * written last.
37349          */
37350         uint8_t valid;
37351 } __rte_packed;
37352
37353 /******************************
37354  * hwrm_tf_session_resc_alloc *
37355  ******************************/
37356
37357
37358 /* hwrm_tf_session_resc_alloc_input (size:320b/40B) */
37359 struct hwrm_tf_session_resc_alloc_input {
37360         /* The HWRM command request type. */
37361         uint16_t        req_type;
37362         /*
37363          * The completion ring to send the completion event on. This should
37364          * be the NQ ID returned from the `nq_alloc` HWRM command.
37365          */
37366         uint16_t        cmpl_ring;
37367         /*
37368          * The sequence ID is used by the driver for tracking multiple
37369          * commands. This ID is treated as opaque data by the firmware and
37370          * the value is returned in the `hwrm_resp_hdr` upon completion.
37371          */
37372         uint16_t        seq_id;
37373         /*
37374          * The target ID of the command:
37375          * * 0x0-0xFFF8 - The function ID
37376          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37377          * * 0xFFFD - Reserved for user-space HWRM interface
37378          * * 0xFFFF - HWRM
37379          */
37380         uint16_t        target_id;
37381         /*
37382          * A physical address pointer pointing to a host buffer that the
37383          * command's response data will be written. This can be either a host
37384          * physical address (HPA) or a guest physical address (GPA) and must
37385          * point to a physically contiguous block of memory.
37386          */
37387         uint64_t        resp_addr;
37388         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37389         uint32_t        fw_session_id;
37390         /* Control flags. */
37391         uint16_t        flags;
37392         /* Indicates the flow direction. */
37393         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR     UINT32_C(0x1)
37394         /* If this bit set to 0, then it indicates rx flow. */
37395         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
37396         /* If this bit is set to 1, then it indicates that tx flow. */
37397         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
37398         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST \
37399                 HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX
37400         /*
37401          * Defines the array size of the provided req_addr and
37402          * resv_addr array buffers. Should be set to the number of
37403          * request entries.
37404          */
37405         uint16_t        req_size;
37406         /*
37407          * This is the DMA address for the request input data array
37408          * buffer. Array is of tf_rm_resc_req_entry type. Size of the
37409          * array buffer is provided by the 'req_size' field in this
37410          * message.
37411          */
37412         uint64_t        req_addr;
37413         /*
37414          * This is the DMA address for the resc output data array
37415          * buffer. Array is of tf_rm_resc_entry type. Size of the array
37416          * buffer is provided by the 'req_size' field in this
37417          * message.
37418          */
37419         uint64_t        resc_addr;
37420 } __rte_packed;
37421
37422 /* hwrm_tf_session_resc_alloc_output (size:128b/16B) */
37423 struct hwrm_tf_session_resc_alloc_output {
37424         /* The specific error status for the command. */
37425         uint16_t        error_code;
37426         /* The HWRM command request type. */
37427         uint16_t        req_type;
37428         /* The sequence ID from the original command. */
37429         uint16_t        seq_id;
37430         /* The length of the response data in number of bytes. */
37431         uint16_t        resp_len;
37432         /*
37433          * Size of the returned tf_rm_resc_entry data array. The value
37434          * cannot exceed the req_size defined by the input msg. The data
37435          * array is returned using the resv_addr specified DMA
37436          * address also provided by the input msg.
37437          */
37438         uint16_t        size;
37439         /* unused. */
37440         uint8_t unused0[5];
37441         /*
37442          * This field is used in Output records to indicate that the output
37443          * is completely written to RAM. This field should be read as '1'
37444          * to indicate that the output has been completely written.
37445          * When writing a command completion or response to an internal
37446          * processor, the order of writes has to be such that this field is
37447          * written last.
37448          */
37449         uint8_t valid;
37450 } __rte_packed;
37451
37452 /*****************************
37453  * hwrm_tf_session_resc_free *
37454  *****************************/
37455
37456
37457 /* hwrm_tf_session_resc_free_input (size:256b/32B) */
37458 struct hwrm_tf_session_resc_free_input {
37459         /* The HWRM command request type. */
37460         uint16_t        req_type;
37461         /*
37462          * The completion ring to send the completion event on. This should
37463          * be the NQ ID returned from the `nq_alloc` HWRM command.
37464          */
37465         uint16_t        cmpl_ring;
37466         /*
37467          * The sequence ID is used by the driver for tracking multiple
37468          * commands. This ID is treated as opaque data by the firmware and
37469          * the value is returned in the `hwrm_resp_hdr` upon completion.
37470          */
37471         uint16_t        seq_id;
37472         /*
37473          * The target ID of the command:
37474          * * 0x0-0xFFF8 - The function ID
37475          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37476          * * 0xFFFD - Reserved for user-space HWRM interface
37477          * * 0xFFFF - HWRM
37478          */
37479         uint16_t        target_id;
37480         /*
37481          * A physical address pointer pointing to a host buffer that the
37482          * command's response data will be written. This can be either a host
37483          * physical address (HPA) or a guest physical address (GPA) and must
37484          * point to a physically contiguous block of memory.
37485          */
37486         uint64_t        resp_addr;
37487         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37488         uint32_t        fw_session_id;
37489         /* Control flags. */
37490         uint16_t        flags;
37491         /* Indicates the flow direction. */
37492         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR     UINT32_C(0x1)
37493         /* If this bit set to 0, then it indicates rx flow. */
37494         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
37495         /* If this bit is set to 1, then it indicates that tx flow. */
37496         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
37497         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_LAST \
37498                 HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX
37499         /*
37500          * Defines the size, in bytes, of the provided free_addr
37501          * buffer.
37502          */
37503         uint16_t        free_size;
37504         /*
37505          * This is the DMA address for the free input data array
37506          * buffer.  Array is of tf_rm_resc_entry type. Size of the
37507          * buffer is provided by the 'free_size' field of this
37508          * message.
37509          */
37510         uint64_t        free_addr;
37511 } __rte_packed;
37512
37513 /* hwrm_tf_session_resc_free_output (size:128b/16B) */
37514 struct hwrm_tf_session_resc_free_output {
37515         /* The specific error status for the command. */
37516         uint16_t        error_code;
37517         /* The HWRM command request type. */
37518         uint16_t        req_type;
37519         /* The sequence ID from the original command. */
37520         uint16_t        seq_id;
37521         /* The length of the response data in number of bytes. */
37522         uint16_t        resp_len;
37523         /* unused. */
37524         uint8_t unused0[7];
37525         /*
37526          * This field is used in Output records to indicate that the output
37527          * is completely written to RAM. This field should be read as '1'
37528          * to indicate that the output has been completely written.
37529          * When writing a command completion or response to an internal
37530          * processor, the order of writes has to be such that this field is
37531          * written last.
37532          */
37533         uint8_t valid;
37534 } __rte_packed;
37535
37536 /******************************
37537  * hwrm_tf_session_resc_flush *
37538  ******************************/
37539
37540
37541 /* hwrm_tf_session_resc_flush_input (size:256b/32B) */
37542 struct hwrm_tf_session_resc_flush_input {
37543         /* The HWRM command request type. */
37544         uint16_t        req_type;
37545         /*
37546          * The completion ring to send the completion event on. This should
37547          * be the NQ ID returned from the `nq_alloc` HWRM command.
37548          */
37549         uint16_t        cmpl_ring;
37550         /*
37551          * The sequence ID is used by the driver for tracking multiple
37552          * commands. This ID is treated as opaque data by the firmware and
37553          * the value is returned in the `hwrm_resp_hdr` upon completion.
37554          */
37555         uint16_t        seq_id;
37556         /*
37557          * The target ID of the command:
37558          * * 0x0-0xFFF8 - The function ID
37559          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37560          * * 0xFFFD - Reserved for user-space HWRM interface
37561          * * 0xFFFF - HWRM
37562          */
37563         uint16_t        target_id;
37564         /*
37565          * A physical address pointer pointing to a host buffer that the
37566          * command's response data will be written. This can be either a host
37567          * physical address (HPA) or a guest physical address (GPA) and must
37568          * point to a physically contiguous block of memory.
37569          */
37570         uint64_t        resp_addr;
37571         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37572         uint32_t        fw_session_id;
37573         /* Control flags. */
37574         uint16_t        flags;
37575         /* Indicates the flow direction. */
37576         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR     UINT32_C(0x1)
37577         /* If this bit set to 0, then it indicates rx flow. */
37578         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
37579         /* If this bit is set to 1, then it indicates that tx flow. */
37580         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
37581         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_LAST \
37582                 HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX
37583         /*
37584          * Defines the size, in bytes, of the provided flush_addr
37585          * buffer.
37586          */
37587         uint16_t        flush_size;
37588         /*
37589          * This is the DMA address for the flush input data array
37590          * buffer.  Array of tf_rm_resc_entry type. Size of the
37591          * buffer is provided by the 'flush_size' field in this
37592          * message.
37593          */
37594         uint64_t        flush_addr;
37595 } __rte_packed;
37596
37597 /* hwrm_tf_session_resc_flush_output (size:128b/16B) */
37598 struct hwrm_tf_session_resc_flush_output {
37599         /* The specific error status for the command. */
37600         uint16_t        error_code;
37601         /* The HWRM command request type. */
37602         uint16_t        req_type;
37603         /* The sequence ID from the original command. */
37604         uint16_t        seq_id;
37605         /* The length of the response data in number of bytes. */
37606         uint16_t        resp_len;
37607         /* unused. */
37608         uint8_t unused0[7];
37609         /*
37610          * This field is used in Output records to indicate that the output
37611          * is completely written to RAM. This field should be read as '1'
37612          * to indicate that the output has been completely written.
37613          * When writing a command completion or response to an internal
37614          * processor, the order of writes has to be such that this field is
37615          * written last.
37616          */
37617         uint8_t valid;
37618 } __rte_packed;
37619
37620 /* TruFlow RM capability of a resource. */
37621 /* tf_rm_resc_req_entry (size:64b/8B) */
37622 struct tf_rm_resc_req_entry {
37623         /* Type of the resource, defined globally in HCAPI RM. */
37624         uint32_t        type;
37625         /* Minimum value. */
37626         uint16_t        min;
37627         /* Maximum value. */
37628         uint16_t        max;
37629 } __rte_packed;
37630
37631 /* TruFlow RM reservation information. */
37632 /* tf_rm_resc_entry (size:64b/8B) */
37633 struct tf_rm_resc_entry {
37634         /* Type of the resource, defined globally in HCAPI RM. */
37635         uint32_t        type;
37636         /* Start offset. */
37637         uint16_t        start;
37638         /* Number of resources. */
37639         uint16_t        stride;
37640 } __rte_packed;
37641
37642 /************************
37643  * hwrm_tf_tbl_type_get *
37644  ************************/
37645
37646
37647 /* hwrm_tf_tbl_type_get_input (size:256b/32B) */
37648 struct hwrm_tf_tbl_type_get_input {
37649         /* The HWRM command request type. */
37650         uint16_t        req_type;
37651         /*
37652          * The completion ring to send the completion event on. This should
37653          * be the NQ ID returned from the `nq_alloc` HWRM command.
37654          */
37655         uint16_t        cmpl_ring;
37656         /*
37657          * The sequence ID is used by the driver for tracking multiple
37658          * commands. This ID is treated as opaque data by the firmware and
37659          * the value is returned in the `hwrm_resp_hdr` upon completion.
37660          */
37661         uint16_t        seq_id;
37662         /*
37663          * The target ID of the command:
37664          * * 0x0-0xFFF8 - The function ID
37665          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37666          * * 0xFFFD - Reserved for user-space HWRM interface
37667          * * 0xFFFF - HWRM
37668          */
37669         uint16_t        target_id;
37670         /*
37671          * A physical address pointer pointing to a host buffer that the
37672          * command's response data will be written. This can be either a host
37673          * physical address (HPA) or a guest physical address (GPA) and must
37674          * point to a physically contiguous block of memory.
37675          */
37676         uint64_t        resp_addr;
37677         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37678         uint32_t        fw_session_id;
37679         /* Control flags. */
37680         uint16_t        flags;
37681         /* Indicates the flow direction. */
37682         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
37683         /* If this bit set to 0, then it indicates rx flow. */
37684         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
37685         /* If this bit is set to 1, then it indicates that tx flow. */
37686         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
37687         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_LAST \
37688                 HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX
37689         /* unused. */
37690         uint8_t unused0[2];
37691         /*
37692          * Type of the resource, defined globally in the
37693          * hwrm_tf_resc_type enum.
37694          */
37695         uint32_t        type;
37696         /* Index of the type to retrieve. */
37697         uint32_t        index;
37698 } __rte_packed;
37699
37700 /* hwrm_tf_tbl_type_get_output (size:1216b/152B) */
37701 struct hwrm_tf_tbl_type_get_output {
37702         /* The specific error status for the command. */
37703         uint16_t        error_code;
37704         /* The HWRM command request type. */
37705         uint16_t        req_type;
37706         /* The sequence ID from the original command. */
37707         uint16_t        seq_id;
37708         /* The length of the response data in number of bytes. */
37709         uint16_t        resp_len;
37710         /* Response code. */
37711         uint32_t        resp_code;
37712         /* Response size. */
37713         uint16_t        size;
37714         /* unused */
37715         uint16_t        unused0;
37716         /* Response data. */
37717         uint8_t data[128];
37718         /* unused */
37719         uint8_t unused1[7];
37720         /*
37721          * This field is used in Output records to indicate that the output
37722          * is completely written to RAM. This field should be read as '1'
37723          * to indicate that the output has been completely written.
37724          * When writing a command completion or response to an internal
37725          * processor, the order of writes has to be such that this field
37726          * is written last.
37727          */
37728         uint8_t valid;
37729 } __rte_packed;
37730
37731 /************************
37732  * hwrm_tf_tbl_type_set *
37733  ************************/
37734
37735
37736 /* hwrm_tf_tbl_type_set_input (size:1024b/128B) */
37737 struct hwrm_tf_tbl_type_set_input {
37738         /* The HWRM command request type. */
37739         uint16_t        req_type;
37740         /*
37741          * The completion ring to send the completion event on. This should
37742          * be the NQ ID returned from the `nq_alloc` HWRM command.
37743          */
37744         uint16_t        cmpl_ring;
37745         /*
37746          * The sequence ID is used by the driver for tracking multiple
37747          * commands. This ID is treated as opaque data by the firmware and
37748          * the value is returned in the `hwrm_resp_hdr` upon completion.
37749          */
37750         uint16_t        seq_id;
37751         /*
37752          * The target ID of the command:
37753          * * 0x0-0xFFF8 - The function ID
37754          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37755          * * 0xFFFD - Reserved for user-space HWRM interface
37756          * * 0xFFFF - HWRM
37757          */
37758         uint16_t        target_id;
37759         /*
37760          * A physical address pointer pointing to a host buffer that the
37761          * command's response data will be written. This can be either a host
37762          * physical address (HPA) or a guest physical address (GPA) and must
37763          * point to a physically contiguous block of memory.
37764          */
37765         uint64_t        resp_addr;
37766         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
37767         uint32_t        fw_session_id;
37768         /* Control flags. */
37769         uint16_t        flags;
37770         /* Indicates the flow direction. */
37771         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
37772         /* If this bit set to 0, then it indicates rx flow. */
37773         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
37774         /* If this bit is set to 1, then it indicates that tx flow. */
37775         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
37776         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_LAST \
37777                 HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX
37778         /* unused. */
37779         uint8_t unused0[2];
37780         /*
37781          * Type of the resource, defined globally in the
37782          * hwrm_tf_resc_type enum.
37783          */
37784         uint32_t        type;
37785         /* Index of the type to retrieve. */
37786         uint32_t        index;
37787         /* Size of the data to set. */
37788         uint16_t        size;
37789         /* unused */
37790         uint8_t unused1[6];
37791         /* Data to be set. */
37792         uint8_t data[88];
37793 } __rte_packed;
37794
37795 /* hwrm_tf_tbl_type_set_output (size:128b/16B) */
37796 struct hwrm_tf_tbl_type_set_output {
37797         /* The specific error status for the command. */
37798         uint16_t        error_code;
37799         /* The HWRM command request type. */
37800         uint16_t        req_type;
37801         /* The sequence ID from the original command. */
37802         uint16_t        seq_id;
37803         /* The length of the response data in number of bytes. */
37804         uint16_t        resp_len;
37805         /* unused. */
37806         uint8_t unused0[7];
37807         /*
37808          * This field is used in Output records to indicate that the output
37809          * is completely written to RAM. This field should be read as '1'
37810          * to indicate that the output has been completely written.
37811          * When writing a command completion or response to an internal
37812          * processor, the order of writes has to be such that this field
37813          * is written last.
37814          */
37815         uint8_t valid;
37816 } __rte_packed;
37817
37818 /*************************
37819  * hwrm_tf_ctxt_mem_rgtr *
37820  *************************/
37821
37822
37823 /* hwrm_tf_ctxt_mem_rgtr_input (size:256b/32B) */
37824 struct hwrm_tf_ctxt_mem_rgtr_input {
37825         /* The HWRM command request type. */
37826         uint16_t        req_type;
37827         /*
37828          * The completion ring to send the completion event on. This should
37829          * be the NQ ID returned from the `nq_alloc` HWRM command.
37830          */
37831         uint16_t        cmpl_ring;
37832         /*
37833          * The sequence ID is used by the driver for tracking multiple
37834          * commands. This ID is treated as opaque data by the firmware and
37835          * the value is returned in the `hwrm_resp_hdr` upon completion.
37836          */
37837         uint16_t        seq_id;
37838         /*
37839          * The target ID of the command:
37840          * * 0x0-0xFFF8 - The function ID
37841          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37842          * * 0xFFFD - Reserved for user-space HWRM interface
37843          * * 0xFFFF - HWRM
37844          */
37845         uint16_t        target_id;
37846         /*
37847          * A physical address pointer pointing to a host buffer that the
37848          * command's response data will be written. This can be either a host
37849          * physical address (HPA) or a guest physical address (GPA) and must
37850          * point to a physically contiguous block of memory.
37851          */
37852         uint64_t        resp_addr;
37853         /* Control flags. */
37854         uint16_t        flags;
37855         /* Counter PBL indirect levels. */
37856         uint8_t page_level;
37857         /* PBL pointer is physical start address. */
37858         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
37859         /* PBL pointer points to PTE table. */
37860         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
37861         /*
37862          * PBL pointer points to PDE table with each entry pointing
37863          * to PTE tables.
37864          */
37865         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
37866         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
37867                 HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
37868         /* Page size. */
37869         uint8_t page_size;
37870         /* 4KB page size. */
37871         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
37872         /* 8KB page size. */
37873         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
37874         /* 64KB page size. */
37875         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
37876         /* 256KB page size. */
37877         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
37878         /* 1MB page size. */
37879         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
37880         /* 2MB page size. */
37881         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
37882         /* 4MB page size. */
37883         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
37884         /* 1GB page size. */
37885         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
37886         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
37887                 HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G
37888         /* unused. */
37889         uint32_t        unused0;
37890         /* Pointer to the PBL, or PDL depending on number of levels */
37891         uint64_t        page_dir;
37892 } __rte_packed;
37893
37894 /* hwrm_tf_ctxt_mem_rgtr_output (size:128b/16B) */
37895 struct hwrm_tf_ctxt_mem_rgtr_output {
37896         /* The specific error status for the command. */
37897         uint16_t        error_code;
37898         /* The HWRM command request type. */
37899         uint16_t        req_type;
37900         /* The sequence ID from the original command. */
37901         uint16_t        seq_id;
37902         /* The length of the response data in number of bytes. */
37903         uint16_t        resp_len;
37904         /*
37905          * Id/Handle to the recently register context memory. This
37906          * handle is passed to the TF session.
37907          */
37908         uint16_t        ctx_id;
37909         /* unused. */
37910         uint8_t unused0[5];
37911         /*
37912          * This field is used in Output records to indicate that the
37913          * output is completely written to RAM. This field should be
37914          * read as '1' to indicate that the output has been
37915          * completely written.  When writing a command completion or
37916          * response to an internal processor, the order of writes has
37917          * to be such that this field is written last.
37918          */
37919         uint8_t valid;
37920 } __rte_packed;
37921
37922 /***************************
37923  * hwrm_tf_ctxt_mem_unrgtr *
37924  ***************************/
37925
37926
37927 /* hwrm_tf_ctxt_mem_unrgtr_input (size:192b/24B) */
37928 struct hwrm_tf_ctxt_mem_unrgtr_input {
37929         /* The HWRM command request type. */
37930         uint16_t        req_type;
37931         /*
37932          * The completion ring to send the completion event on. This should
37933          * be the NQ ID returned from the `nq_alloc` HWRM command.
37934          */
37935         uint16_t        cmpl_ring;
37936         /*
37937          * The sequence ID is used by the driver for tracking multiple
37938          * commands. This ID is treated as opaque data by the firmware and
37939          * the value is returned in the `hwrm_resp_hdr` upon completion.
37940          */
37941         uint16_t        seq_id;
37942         /*
37943          * The target ID of the command:
37944          * * 0x0-0xFFF8 - The function ID
37945          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37946          * * 0xFFFD - Reserved for user-space HWRM interface
37947          * * 0xFFFF - HWRM
37948          */
37949         uint16_t        target_id;
37950         /*
37951          * A physical address pointer pointing to a host buffer that the
37952          * command's response data will be written. This can be either a host
37953          * physical address (HPA) or a guest physical address (GPA) and must
37954          * point to a physically contiguous block of memory.
37955          */
37956         uint64_t        resp_addr;
37957         /*
37958          * Id/Handle to the recently register context memory. This
37959          * handle is passed to the TF session.
37960          */
37961         uint16_t        ctx_id;
37962         /* unused. */
37963         uint8_t unused0[6];
37964 } __rte_packed;
37965
37966 /* hwrm_tf_ctxt_mem_unrgtr_output (size:128b/16B) */
37967 struct hwrm_tf_ctxt_mem_unrgtr_output {
37968         /* The specific error status for the command. */
37969         uint16_t        error_code;
37970         /* The HWRM command request type. */
37971         uint16_t        req_type;
37972         /* The sequence ID from the original command. */
37973         uint16_t        seq_id;
37974         /* The length of the response data in number of bytes. */
37975         uint16_t        resp_len;
37976         /* unused. */
37977         uint8_t unused0[7];
37978         /*
37979          * This field is used in Output records to indicate that the
37980          * output is completely written to RAM. This field should be
37981          * read as '1' to indicate that the output has been
37982          * completely written.  When writing a command completion or
37983          * response to an internal processor, the order of writes has
37984          * to be such that this field is written last.
37985          */
37986         uint8_t valid;
37987 } __rte_packed;
37988
37989 /************************
37990  * hwrm_tf_ext_em_qcaps *
37991  ************************/
37992
37993
37994 /* hwrm_tf_ext_em_qcaps_input (size:192b/24B) */
37995 struct hwrm_tf_ext_em_qcaps_input {
37996         /* The HWRM command request type. */
37997         uint16_t        req_type;
37998         /*
37999          * The completion ring to send the completion event on. This should
38000          * be the NQ ID returned from the `nq_alloc` HWRM command.
38001          */
38002         uint16_t        cmpl_ring;
38003         /*
38004          * The sequence ID is used by the driver for tracking multiple
38005          * commands. This ID is treated as opaque data by the firmware and
38006          * the value is returned in the `hwrm_resp_hdr` upon completion.
38007          */
38008         uint16_t        seq_id;
38009         /*
38010          * The target ID of the command:
38011          * * 0x0-0xFFF8 - The function ID
38012          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38013          * * 0xFFFD - Reserved for user-space HWRM interface
38014          * * 0xFFFF - HWRM
38015          */
38016         uint16_t        target_id;
38017         /*
38018          * A physical address pointer pointing to a host buffer that the
38019          * command's response data will be written. This can be either a host
38020          * physical address (HPA) or a guest physical address (GPA) and must
38021          * point to a physically contiguous block of memory.
38022          */
38023         uint64_t        resp_addr;
38024         /* Control flags. */
38025         uint32_t        flags;
38026         /* Indicates the flow direction. */
38027         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR \
38028                 UINT32_C(0x1)
38029         /* If this bit set to 0, then it indicates rx flow. */
38030         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_RX \
38031                 UINT32_C(0x0)
38032         /* If this bit is set to 1, then it indicates that tx flow. */
38033         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX \
38034                 UINT32_C(0x1)
38035         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_LAST \
38036                 HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX
38037         /* When set to 1, all offloaded flows will be sent to EXT EM. */
38038         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
38039                 UINT32_C(0x2)
38040         /* unused. */
38041         uint32_t        unused0;
38042 } __rte_packed;
38043
38044 /* hwrm_tf_ext_em_qcaps_output (size:320b/40B) */
38045 struct hwrm_tf_ext_em_qcaps_output {
38046         /* The specific error status for the command. */
38047         uint16_t        error_code;
38048         /* The HWRM command request type. */
38049         uint16_t        req_type;
38050         /* The sequence ID from the original command. */
38051         uint16_t        seq_id;
38052         /* The length of the response data in number of bytes. */
38053         uint16_t        resp_len;
38054         uint32_t        flags;
38055         /*
38056          * When set to 1, indicates the the FW supports the Centralized
38057          * Memory Model. The concept designates one entity for the
38058          * memory allocation while all others ‘subscribe’ to it.
38059          */
38060         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
38061                 UINT32_C(0x1)
38062         /*
38063          * When set to 1, indicates the the FW supports the Detached
38064          * Centralized Memory Model. The memory is allocated and managed
38065          * as a separate entity. All PFs and VFs will be granted direct
38066          * or semi-direct access to the allocated memory while none of
38067          * which can interfere with the management of the memory.
38068          */
38069         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
38070                 UINT32_C(0x2)
38071         /* unused. */
38072         uint32_t        unused0;
38073         /* Support flags. */
38074         uint32_t        supported;
38075         /*
38076          * If set to 1, then EXT EM KEY0 table is supported using
38077          * crc32 hash.
38078          * If set to 0, EXT EM KEY0 table is not supported.
38079          */
38080         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
38081                 UINT32_C(0x1)
38082         /*
38083          * If set to 1, then EXT EM KEY1 table is supported using
38084          * lookup3 hash.
38085          * If set to 0, EXT EM KEY1 table is not supported.
38086          */
38087         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
38088                 UINT32_C(0x2)
38089         /*
38090          * If set to 1, then EXT EM External Record table is supported.
38091          * If set to 0, EXT EM External Record table is not
38092          * supported.  (This table includes action record, EFC
38093          * pointers, encap pointers)
38094          */
38095         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
38096                 UINT32_C(0x4)
38097         /*
38098          * If set to 1, then EXT EM External Flow Counters table is
38099          * supported.
38100          * If set to 0, EXT EM External Flow Counters table is not
38101          * supported.
38102          */
38103         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
38104                 UINT32_C(0x8)
38105         /*
38106          * If set to 1, then FID table used for implicit flow flush
38107          * is supported.
38108          * If set to 0, then FID table used for implicit flow flush
38109          * is not supported.
38110          */
38111         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
38112                 UINT32_C(0x10)
38113         /*
38114          * The maximum number of entries supported by EXT EM. When
38115          * configuring the host memory the number of numbers of
38116          * entries that can supported are -
38117          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M,
38118          *      128M entries.
38119          * Any value that are not these values, the FW will round
38120          * down to the closest support number of entries.
38121          */
38122         uint32_t        max_entries_supported;
38123         /*
38124          * The entry size in bytes of each entry in the EXT EM
38125          * KEY0/KEY1 tables.
38126          */
38127         uint16_t        key_entry_size;
38128         /*
38129          * The entry size in bytes of each entry in the EXT EM RECORD
38130          * tables.
38131          */
38132         uint16_t        record_entry_size;
38133         /* The entry size in bytes of each entry in the EXT EM EFC tables. */
38134         uint16_t        efc_entry_size;
38135         /* The FID size in bytes of each entry in the EXT EM FID tables. */
38136         uint16_t        fid_entry_size;
38137         /* unused. */
38138         uint8_t unused1[7];
38139         /*
38140          * This field is used in Output records to indicate that the
38141          * output is completely written to RAM. This field should be
38142          * read as '1' to indicate that the output has been
38143          * completely written.  When writing a command completion or
38144          * response to an internal processor, the order of writes has
38145          * to be such that this field is written last.
38146          */
38147         uint8_t valid;
38148 } __rte_packed;
38149
38150 /*********************
38151  * hwrm_tf_ext_em_op *
38152  *********************/
38153
38154
38155 /* hwrm_tf_ext_em_op_input (size:192b/24B) */
38156 struct hwrm_tf_ext_em_op_input {
38157         /* The HWRM command request type. */
38158         uint16_t        req_type;
38159         /*
38160          * The completion ring to send the completion event on. This should
38161          * be the NQ ID returned from the `nq_alloc` HWRM command.
38162          */
38163         uint16_t        cmpl_ring;
38164         /*
38165          * The sequence ID is used by the driver for tracking multiple
38166          * commands. This ID is treated as opaque data by the firmware and
38167          * the value is returned in the `hwrm_resp_hdr` upon completion.
38168          */
38169         uint16_t        seq_id;
38170         /*
38171          * The target ID of the command:
38172          * * 0x0-0xFFF8 - The function ID
38173          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38174          * * 0xFFFD - Reserved for user-space HWRM interface
38175          * * 0xFFFF - HWRM
38176          */
38177         uint16_t        target_id;
38178         /*
38179          * A physical address pointer pointing to a host buffer that the
38180          * command's response data will be written. This can be either a host
38181          * physical address (HPA) or a guest physical address (GPA) and must
38182          * point to a physically contiguous block of memory.
38183          */
38184         uint64_t        resp_addr;
38185         /* Control flags. */
38186         uint16_t        flags;
38187         /* Indicates the flow direction. */
38188         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR     UINT32_C(0x1)
38189         /* If this bit set to 0, then it indicates rx flow. */
38190         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38191         /* If this bit is set to 1, then it indicates that tx flow. */
38192         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38193         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_LAST \
38194                 HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX
38195         /* unused. */
38196         uint16_t        unused0;
38197         /* The number of EXT EM key table entries to be configured. */
38198         uint16_t        op;
38199         /* This value is reserved and should not be used. */
38200         #define HWRM_TF_EXT_EM_OP_INPUT_OP_RESERVED       UINT32_C(0x0)
38201         /*
38202          * To properly stop EXT EM and ensure there are no DMA's,
38203          * the caller must disable EXT EM for the given PF, using
38204          * this call. This will safely disable EXT EM and ensure
38205          * that all DMA'ed to the keys/records/efc have been
38206          * completed.
38207          */
38208         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_DISABLE UINT32_C(0x1)
38209         /*
38210          * Once the EXT EM host memory has been configured, EXT EM
38211          * options have been configured. Then the caller should
38212          * enable EXT EM for the given PF. Note once this call has
38213          * been made, then the EXT EM mechanism will be active and
38214          * DMA's will occur as packets are processed.
38215          */
38216         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_ENABLE  UINT32_C(0x2)
38217         /*
38218          * Clear EXT EM settings for the given PF so that the
38219          * register values are reset back to their initial state.
38220          */
38221         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP UINT32_C(0x3)
38222         #define HWRM_TF_EXT_EM_OP_INPUT_OP_LAST \
38223                 HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP
38224         /* unused. */
38225         uint16_t        unused1;
38226 } __rte_packed;
38227
38228 /* hwrm_tf_ext_em_op_output (size:128b/16B) */
38229 struct hwrm_tf_ext_em_op_output {
38230         /* The specific error status for the command. */
38231         uint16_t        error_code;
38232         /* The HWRM command request type. */
38233         uint16_t        req_type;
38234         /* The sequence ID from the original command. */
38235         uint16_t        seq_id;
38236         /* The length of the response data in number of bytes. */
38237         uint16_t        resp_len;
38238         /* unused. */
38239         uint8_t unused0[7];
38240         /*
38241          * This field is used in Output records to indicate that the
38242          * output is completely written to RAM. This field should be
38243          * read as '1' to indicate that the output has been
38244          * completely written.  When writing a command completion or
38245          * response to an internal processor, the order of writes has
38246          * to be such that this field is written last.
38247          */
38248         uint8_t valid;
38249 } __rte_packed;
38250
38251 /**********************
38252  * hwrm_tf_ext_em_cfg *
38253  **********************/
38254
38255
38256 /* hwrm_tf_ext_em_cfg_input (size:384b/48B) */
38257 struct hwrm_tf_ext_em_cfg_input {
38258         /* The HWRM command request type. */
38259         uint16_t        req_type;
38260         /*
38261          * The completion ring to send the completion event on. This should
38262          * be the NQ ID returned from the `nq_alloc` HWRM command.
38263          */
38264         uint16_t        cmpl_ring;
38265         /*
38266          * The sequence ID is used by the driver for tracking multiple
38267          * commands. This ID is treated as opaque data by the firmware and
38268          * the value is returned in the `hwrm_resp_hdr` upon completion.
38269          */
38270         uint16_t        seq_id;
38271         /*
38272          * The target ID of the command:
38273          * * 0x0-0xFFF8 - The function ID
38274          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38275          * * 0xFFFD - Reserved for user-space HWRM interface
38276          * * 0xFFFF - HWRM
38277          */
38278         uint16_t        target_id;
38279         /*
38280          * A physical address pointer pointing to a host buffer that the
38281          * command's response data will be written. This can be either a host
38282          * physical address (HPA) or a guest physical address (GPA) and must
38283          * point to a physically contiguous block of memory.
38284          */
38285         uint64_t        resp_addr;
38286         /* Control flags. */
38287         uint32_t        flags;
38288         /* Indicates the flow direction. */
38289         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR \
38290                 UINT32_C(0x1)
38291         /* If this bit set to 0, then it indicates rx flow. */
38292         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_RX \
38293                 UINT32_C(0x0)
38294         /* If this bit is set to 1, then it indicates that tx flow. */
38295         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX \
38296                 UINT32_C(0x1)
38297         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_LAST \
38298                 HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX
38299         /* When set to 1, all offloaded flows will be sent to EXT EM. */
38300         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
38301                 UINT32_C(0x2)
38302         /* When set to 1, secondary, 0 means primary. */
38303         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_SECONDARY_PF \
38304                 UINT32_C(0x4)
38305         /*
38306          * Group_id which used by Firmware to identify memory pools belonging
38307          * to certain group.
38308          */
38309         uint16_t        group_id;
38310         /*
38311          * Dynamically reconfigure EEM pending cache every 1/10th of second.
38312          * If set to 0 it will disable the EEM HW flush of the pending cache.
38313          */
38314         uint8_t flush_interval;
38315         /* unused. */
38316         uint8_t unused0;
38317         /*
38318          * Configured EXT EM with the given number of entries. All
38319          * the EXT EM tables KEY0, KEY1, RECORD, EFC all have the
38320          * same number of entries and all tables will be configured
38321          * using this value. Current minimum value is 32k. Current
38322          * maximum value is 128M.
38323          */
38324         uint32_t        num_entries;
38325         /* unused. */
38326         uint32_t        unused1;
38327         /* Configured EXT EM with the given context if for KEY0 table. */
38328         uint16_t        key0_ctx_id;
38329         /* Configured EXT EM with the given context if for KEY1 table. */
38330         uint16_t        key1_ctx_id;
38331         /* Configured EXT EM with the given context if for RECORD table. */
38332         uint16_t        record_ctx_id;
38333         /* Configured EXT EM with the given context if for EFC table. */
38334         uint16_t        efc_ctx_id;
38335         /* Configured EXT EM with the given context if for EFC table. */
38336         uint16_t        fid_ctx_id;
38337         /* unused. */
38338         uint16_t        unused2;
38339         /* unused. */
38340         uint32_t        unused3;
38341 } __rte_packed;
38342
38343 /* hwrm_tf_ext_em_cfg_output (size:128b/16B) */
38344 struct hwrm_tf_ext_em_cfg_output {
38345         /* The specific error status for the command. */
38346         uint16_t        error_code;
38347         /* The HWRM command request type. */
38348         uint16_t        req_type;
38349         /* The sequence ID from the original command. */
38350         uint16_t        seq_id;
38351         /* The length of the response data in number of bytes. */
38352         uint16_t        resp_len;
38353         /* unused. */
38354         uint8_t unused0[7];
38355         /*
38356          * This field is used in Output records to indicate that the
38357          * output is completely written to RAM. This field should be
38358          * read as '1' to indicate that the output has been
38359          * completely written.  When writing a command completion or
38360          * response to an internal processor, the order of writes has
38361          * to be such that this field is written last.
38362          */
38363         uint8_t valid;
38364 } __rte_packed;
38365
38366 /***********************
38367  * hwrm_tf_ext_em_qcfg *
38368  ***********************/
38369
38370
38371 /* hwrm_tf_ext_em_qcfg_input (size:192b/24B) */
38372 struct hwrm_tf_ext_em_qcfg_input {
38373         /* The HWRM command request type. */
38374         uint16_t        req_type;
38375         /*
38376          * The completion ring to send the completion event on. This should
38377          * be the NQ ID returned from the `nq_alloc` HWRM command.
38378          */
38379         uint16_t        cmpl_ring;
38380         /*
38381          * The sequence ID is used by the driver for tracking multiple
38382          * commands. This ID is treated as opaque data by the firmware and
38383          * the value is returned in the `hwrm_resp_hdr` upon completion.
38384          */
38385         uint16_t        seq_id;
38386         /*
38387          * The target ID of the command:
38388          * * 0x0-0xFFF8 - The function ID
38389          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38390          * * 0xFFFD - Reserved for user-space HWRM interface
38391          * * 0xFFFF - HWRM
38392          */
38393         uint16_t        target_id;
38394         /*
38395          * A physical address pointer pointing to a host buffer that the
38396          * command's response data will be written. This can be either a host
38397          * physical address (HPA) or a guest physical address (GPA) and must
38398          * point to a physically contiguous block of memory.
38399          */
38400         uint64_t        resp_addr;
38401         /* Control flags. */
38402         uint32_t        flags;
38403         /* Indicates the flow direction. */
38404         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR     UINT32_C(0x1)
38405         /* If this bit set to 0, then it indicates rx flow. */
38406         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38407         /* If this bit is set to 1, then it indicates that tx flow. */
38408         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38409         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_LAST \
38410                 HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX
38411         /* unused. */
38412         uint32_t        unused0;
38413 } __rte_packed;
38414
38415 /* hwrm_tf_ext_em_qcfg_output (size:256b/32B) */
38416 struct hwrm_tf_ext_em_qcfg_output {
38417         /* The specific error status for the command. */
38418         uint16_t        error_code;
38419         /* The HWRM command request type. */
38420         uint16_t        req_type;
38421         /* The sequence ID from the original command. */
38422         uint16_t        seq_id;
38423         /* The length of the response data in number of bytes. */
38424         uint16_t        resp_len;
38425         /* Control flags. */
38426         uint32_t        flags;
38427         /* Indicates the flow direction. */
38428         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR \
38429                 UINT32_C(0x1)
38430         /* If this bit set to 0, then it indicates rx flow. */
38431         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_RX \
38432                 UINT32_C(0x0)
38433         /* If this bit is set to 1, then it indicates that tx flow. */
38434         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX \
38435                 UINT32_C(0x1)
38436         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_LAST \
38437                 HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX
38438         /* When set to 1, all offloaded flows will be sent to EXT EM. */
38439         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
38440                 UINT32_C(0x2)
38441         /* The number of entries the FW has configured for EXT EM. */
38442         uint32_t        num_entries;
38443         /* Configured EXT EM with the given context if for KEY0 table. */
38444         uint16_t        key0_ctx_id;
38445         /* Configured EXT EM with the given context if for KEY1 table. */
38446         uint16_t        key1_ctx_id;
38447         /* Configured EXT EM with the given context if for RECORD table. */
38448         uint16_t        record_ctx_id;
38449         /* Configured EXT EM with the given context if for EFC table. */
38450         uint16_t        efc_ctx_id;
38451         /* Configured EXT EM with the given context if for EFC table. */
38452         uint16_t        fid_ctx_id;
38453         /* unused. */
38454         uint8_t unused0[5];
38455         /*
38456          * This field is used in Output records to indicate that the
38457          * output is completely written to RAM. This field should be
38458          * read as '1' to indicate that the output has been
38459          * completely written.  When writing a command completion or
38460          * response to an internal processor, the order of writes has
38461          * to be such that this field is written last.
38462          */
38463         uint8_t valid;
38464 } __rte_packed;
38465
38466 /*********************
38467  * hwrm_tf_em_insert *
38468  *********************/
38469
38470
38471 /* hwrm_tf_em_insert_input (size:832b/104B) */
38472 struct hwrm_tf_em_insert_input {
38473         /* The HWRM command request type. */
38474         uint16_t        req_type;
38475         /*
38476          * The completion ring to send the completion event on. This should
38477          * be the NQ ID returned from the `nq_alloc` HWRM command.
38478          */
38479         uint16_t        cmpl_ring;
38480         /*
38481          * The sequence ID is used by the driver for tracking multiple
38482          * commands. This ID is treated as opaque data by the firmware and
38483          * the value is returned in the `hwrm_resp_hdr` upon completion.
38484          */
38485         uint16_t        seq_id;
38486         /*
38487          * The target ID of the command:
38488          * * 0x0-0xFFF8 - The function ID
38489          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38490          * * 0xFFFD - Reserved for user-space HWRM interface
38491          * * 0xFFFF - HWRM
38492          */
38493         uint16_t        target_id;
38494         /*
38495          * A physical address pointer pointing to a host buffer that the
38496          * command's response data will be written. This can be either a host
38497          * physical address (HPA) or a guest physical address (GPA) and must
38498          * point to a physically contiguous block of memory.
38499          */
38500         uint64_t        resp_addr;
38501         /* Firmware Session Id. */
38502         uint32_t        fw_session_id;
38503         /* Control Flags. */
38504         uint16_t        flags;
38505         /* Indicates the flow direction. */
38506         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR     UINT32_C(0x1)
38507         /* If this bit set to 0, then it indicates rx flow. */
38508         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38509         /* If this bit is set to 1, then it indicates that tx flow. */
38510         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38511         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_LAST \
38512                 HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX
38513         /* Reported match strength. */
38514         uint16_t        strength;
38515         /* Index to action. */
38516         uint32_t        action_ptr;
38517         /* Index of EM record. */
38518         uint32_t        em_record_idx;
38519         /* EM Key value. */
38520         uint64_t        em_key[8];
38521         /* Number of bits in em_key. */
38522         uint16_t        em_key_bitlen;
38523         /* unused. */
38524         uint16_t        unused0[3];
38525 } __rte_packed;
38526
38527 /* hwrm_tf_em_insert_output (size:128b/16B) */
38528 struct hwrm_tf_em_insert_output {
38529         /* The specific error status for the command. */
38530         uint16_t        error_code;
38531         /* The HWRM command request type. */
38532         uint16_t        req_type;
38533         /* The sequence ID from the original command. */
38534         uint16_t        seq_id;
38535         /* The length of the response data in number of bytes. */
38536         uint16_t        resp_len;
38537         /* EM record pointer index. */
38538         uint16_t        rptr_index;
38539         /* EM record offset 0~3. */
38540         uint8_t rptr_entry;
38541         /* Number of word entries consumed by the key. */
38542         uint8_t num_of_entries;
38543         /* unused. */
38544         uint32_t        unused0;
38545 } __rte_packed;
38546
38547 /*********************
38548  * hwrm_tf_em_delete *
38549  *********************/
38550
38551
38552 /* hwrm_tf_em_delete_input (size:832b/104B) */
38553 struct hwrm_tf_em_delete_input {
38554         /* The HWRM command request type. */
38555         uint16_t        req_type;
38556         /*
38557          * The completion ring to send the completion event on. This should
38558          * be the NQ ID returned from the `nq_alloc` HWRM command.
38559          */
38560         uint16_t        cmpl_ring;
38561         /*
38562          * The sequence ID is used by the driver for tracking multiple
38563          * commands. This ID is treated as opaque data by the firmware and
38564          * the value is returned in the `hwrm_resp_hdr` upon completion.
38565          */
38566         uint16_t        seq_id;
38567         /*
38568          * The target ID of the command:
38569          * * 0x0-0xFFF8 - The function ID
38570          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38571          * * 0xFFFD - Reserved for user-space HWRM interface
38572          * * 0xFFFF - HWRM
38573          */
38574         uint16_t        target_id;
38575         /*
38576          * A physical address pointer pointing to a host buffer that the
38577          * command's response data will be written. This can be either a host
38578          * physical address (HPA) or a guest physical address (GPA) and must
38579          * point to a physically contiguous block of memory.
38580          */
38581         uint64_t        resp_addr;
38582         /* Session Id. */
38583         uint32_t        fw_session_id;
38584         /* Control flags. */
38585         uint16_t        flags;
38586         /* Indicates the flow direction. */
38587         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR     UINT32_C(0x1)
38588         /* If this bit set to 0, then it indicates rx flow. */
38589         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38590         /* If this bit is set to 1, then it indicates that tx flow. */
38591         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38592         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_LAST \
38593                 HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX
38594         /* Unused0 */
38595         uint16_t        unused0;
38596         /* EM internal flow hanndle. */
38597         uint64_t        flow_handle;
38598         /* EM Key value */
38599         uint64_t        em_key[8];
38600         /* Number of bits in em_key. */
38601         uint16_t        em_key_bitlen;
38602         /* unused. */
38603         uint16_t        unused1[3];
38604 } __rte_packed;
38605
38606 /* hwrm_tf_em_delete_output (size:128b/16B) */
38607 struct hwrm_tf_em_delete_output {
38608         /* The specific error status for the command. */
38609         uint16_t        error_code;
38610         /* The HWRM command request type. */
38611         uint16_t        req_type;
38612         /* The sequence ID from the original command. */
38613         uint16_t        seq_id;
38614         /* The length of the response data in number of bytes. */
38615         uint16_t        resp_len;
38616         /* Original stack allocation index. */
38617         uint16_t        em_index;
38618         /* unused. */
38619         uint16_t        unused0[3];
38620 } __rte_packed;
38621
38622 /********************
38623  * hwrm_tf_tcam_set *
38624  ********************/
38625
38626
38627 /* hwrm_tf_tcam_set_input (size:1024b/128B) */
38628 struct hwrm_tf_tcam_set_input {
38629         /* The HWRM command request type. */
38630         uint16_t        req_type;
38631         /*
38632          * The completion ring to send the completion event on. This should
38633          * be the NQ ID returned from the `nq_alloc` HWRM command.
38634          */
38635         uint16_t        cmpl_ring;
38636         /*
38637          * The sequence ID is used by the driver for tracking multiple
38638          * commands. This ID is treated as opaque data by the firmware and
38639          * the value is returned in the `hwrm_resp_hdr` upon completion.
38640          */
38641         uint16_t        seq_id;
38642         /*
38643          * The target ID of the command:
38644          * * 0x0-0xFFF8 - The function ID
38645          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38646          * * 0xFFFD - Reserved for user-space HWRM interface
38647          * * 0xFFFF - HWRM
38648          */
38649         uint16_t        target_id;
38650         /*
38651          * A physical address pointer pointing to a host buffer that the
38652          * command's response data will be written. This can be either a host
38653          * physical address (HPA) or a guest physical address (GPA) and must
38654          * point to a physically contiguous block of memory.
38655          */
38656         uint64_t        resp_addr;
38657         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
38658         uint32_t        fw_session_id;
38659         /* Control flags. */
38660         uint32_t        flags;
38661         /* Indicates the flow direction. */
38662         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
38663         /* If this bit set to 0, then it indicates rx flow. */
38664         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38665         /* If this bit is set to 1, then it indicates that tx flow. */
38666         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38667         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_LAST \
38668                 HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX
38669         /*
38670          * Indicate device data is being sent via DMA, the device
38671          * data is packing does not change.
38672          */
38673         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA     UINT32_C(0x2)
38674         /*
38675          * TCAM type of the resource, defined globally in the
38676          * hwrm_tf_resc_type enum.
38677          */
38678         uint32_t        type;
38679         /* Index of TCAM entry. */
38680         uint16_t        idx;
38681         /* Number of bytes in the TCAM key. */
38682         uint8_t key_size;
38683         /* Number of bytes in the TCAM result. */
38684         uint8_t result_size;
38685         /*
38686          * Offset from which the mask bytes start in the device data
38687          * array, key offset is always 0.
38688          */
38689         uint8_t mask_offset;
38690         /* Offset from which the result bytes start in the device data array. */
38691         uint8_t result_offset;
38692         /* unused. */
38693         uint8_t unused0[6];
38694         /*
38695          * TCAM key located at offset 0, mask located at mask_offsec
38696          * and result at result_offsec for the device.
38697          */
38698         uint8_t dev_data[88];
38699 } __rte_packed;
38700
38701 /* hwrm_tf_tcam_set_output (size:128b/16B) */
38702 struct hwrm_tf_tcam_set_output {
38703         /* The specific error status for the command. */
38704         uint16_t        error_code;
38705         /* The HWRM command request type. */
38706         uint16_t        req_type;
38707         /* The sequence ID from the original command. */
38708         uint16_t        seq_id;
38709         /* The length of the response data in number of bytes. */
38710         uint16_t        resp_len;
38711         /* unused. */
38712         uint8_t unused0[7];
38713         /*
38714          * This field is used in Output records to indicate that the
38715          * output is completely written to RAM. This field should be
38716          * read as '1' to indicate that the output has been
38717          * completely written.  When writing a command completion or
38718          * response to an internal processor, the order of writes has
38719          * to be such that this field is written last.
38720          */
38721         uint8_t valid;
38722 } __rte_packed;
38723
38724 /********************
38725  * hwrm_tf_tcam_get *
38726  ********************/
38727
38728
38729 /* hwrm_tf_tcam_get_input (size:256b/32B) */
38730 struct hwrm_tf_tcam_get_input {
38731         /* The HWRM command request type. */
38732         uint16_t        req_type;
38733         /*
38734          * The completion ring to send the completion event on. This should
38735          * be the NQ ID returned from the `nq_alloc` HWRM command.
38736          */
38737         uint16_t        cmpl_ring;
38738         /*
38739          * The sequence ID is used by the driver for tracking multiple
38740          * commands. This ID is treated as opaque data by the firmware and
38741          * the value is returned in the `hwrm_resp_hdr` upon completion.
38742          */
38743         uint16_t        seq_id;
38744         /*
38745          * The target ID of the command:
38746          * * 0x0-0xFFF8 - The function ID
38747          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38748          * * 0xFFFD - Reserved for user-space HWRM interface
38749          * * 0xFFFF - HWRM
38750          */
38751         uint16_t        target_id;
38752         /*
38753          * A physical address pointer pointing to a host buffer that the
38754          * command's response data will be written. This can be either a host
38755          * physical address (HPA) or a guest physical address (GPA) and must
38756          * point to a physically contiguous block of memory.
38757          */
38758         uint64_t        resp_addr;
38759         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
38760         uint32_t        fw_session_id;
38761         /* Control flags. */
38762         uint32_t        flags;
38763         /* Indicates the flow direction. */
38764         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
38765         /* If this bit set to 0, then it indicates rx flow. */
38766         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38767         /* If this bit is set to 1, then it indicates that tx flow. */
38768         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38769         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_LAST \
38770                 HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX
38771         /*
38772          * TCAM type of the resource, defined globally in the
38773          * hwrm_tf_resc_type enum.
38774          */
38775         uint32_t        type;
38776         /* Index of a TCAM entry. */
38777         uint16_t        idx;
38778         /* unused. */
38779         uint16_t        unused0;
38780 } __rte_packed;
38781
38782 /* hwrm_tf_tcam_get_output (size:2368b/296B) */
38783 struct hwrm_tf_tcam_get_output {
38784         /* The specific error status for the command. */
38785         uint16_t        error_code;
38786         /* The HWRM command request type. */
38787         uint16_t        req_type;
38788         /* The sequence ID from the original command. */
38789         uint16_t        seq_id;
38790         /* The length of the response data in number of bytes. */
38791         uint16_t        resp_len;
38792         /* Number of bytes in the TCAM key. */
38793         uint8_t key_size;
38794         /* Number of bytes in the TCAM entry. */
38795         uint8_t result_size;
38796         /* Offset from which the mask bytes start in the device data array. */
38797         uint8_t mask_offset;
38798         /* Offset from which the result bytes start in the device data array. */
38799         uint8_t result_offset;
38800         /* unused. */
38801         uint8_t unused0[4];
38802         /*
38803          * TCAM key located at offset 0, mask located at mask_offsec
38804          * and result at result_offsec for the device.
38805          */
38806         uint8_t dev_data[272];
38807         /* unused. */
38808         uint8_t unused1[7];
38809         /*
38810          * This field is used in Output records to indicate that the
38811          * output is completely written to RAM. This field should be
38812          * read as '1' to indicate that the output has been
38813          * completely written.  When writing a command completion or
38814          * response to an internal processor, the order of writes has
38815          * to be such that this field is written last.
38816          */
38817         uint8_t valid;
38818 } __rte_packed;
38819
38820 /*********************
38821  * hwrm_tf_tcam_move *
38822  *********************/
38823
38824
38825 /* hwrm_tf_tcam_move_input (size:1024b/128B) */
38826 struct hwrm_tf_tcam_move_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         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
38856         uint32_t        fw_session_id;
38857         /* Control flags. */
38858         uint32_t        flags;
38859         /* Indicates the flow direction. */
38860         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR     UINT32_C(0x1)
38861         /* If this bit set to 0, then it indicates rx flow. */
38862         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38863         /* If this bit is set to 1, then it indicates that tx flow. */
38864         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38865         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_LAST \
38866                 HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX
38867         /*
38868          * TCAM type of the resource, defined globally in the
38869          * hwrm_tf_resc_type enum.
38870          */
38871         uint32_t        type;
38872         /* Number of TCAM index pairs to be swapped for the device. */
38873         uint16_t        count;
38874         /* unused. */
38875         uint16_t        unused0;
38876         /* TCAM index pairs to be swapped for the device. */
38877         uint16_t        idx_pairs[48];
38878 } __rte_packed;
38879
38880 /* hwrm_tf_tcam_move_output (size:128b/16B) */
38881 struct hwrm_tf_tcam_move_output {
38882         /* The specific error status for the command. */
38883         uint16_t        error_code;
38884         /* The HWRM command request type. */
38885         uint16_t        req_type;
38886         /* The sequence ID from the original command. */
38887         uint16_t        seq_id;
38888         /* The length of the response data in number of bytes. */
38889         uint16_t        resp_len;
38890         /* unused. */
38891         uint8_t unused0[7];
38892         /*
38893          * This field is used in Output records to indicate that the
38894          * output is completely written to RAM. This field should be
38895          * read as '1' to indicate that the output has been
38896          * completely written.  When writing a command completion or
38897          * response to an internal processor, the order of writes has
38898          * to be such that this field is written last.
38899          */
38900         uint8_t valid;
38901 } __rte_packed;
38902
38903 /*********************
38904  * hwrm_tf_tcam_free *
38905  *********************/
38906
38907
38908 /* hwrm_tf_tcam_free_input (size:1024b/128B) */
38909 struct hwrm_tf_tcam_free_input {
38910         /* The HWRM command request type. */
38911         uint16_t        req_type;
38912         /*
38913          * The completion ring to send the completion event on. This should
38914          * be the NQ ID returned from the `nq_alloc` HWRM command.
38915          */
38916         uint16_t        cmpl_ring;
38917         /*
38918          * The sequence ID is used by the driver for tracking multiple
38919          * commands. This ID is treated as opaque data by the firmware and
38920          * the value is returned in the `hwrm_resp_hdr` upon completion.
38921          */
38922         uint16_t        seq_id;
38923         /*
38924          * The target ID of the command:
38925          * * 0x0-0xFFF8 - The function ID
38926          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38927          * * 0xFFFD - Reserved for user-space HWRM interface
38928          * * 0xFFFF - HWRM
38929          */
38930         uint16_t        target_id;
38931         /*
38932          * A physical address pointer pointing to a host buffer that the
38933          * command's response data will be written. This can be either a host
38934          * physical address (HPA) or a guest physical address (GPA) and must
38935          * point to a physically contiguous block of memory.
38936          */
38937         uint64_t        resp_addr;
38938         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
38939         uint32_t        fw_session_id;
38940         /* Control flags. */
38941         uint32_t        flags;
38942         /* Indicates the flow direction. */
38943         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR     UINT32_C(0x1)
38944         /* If this bit set to 0, then it indicates rx flow. */
38945         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
38946         /* If this bit is set to 1, then it indicates that tx flow. */
38947         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
38948         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_LAST \
38949                 HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX
38950         /*
38951          * TCAM type of the resource, defined globally in the
38952          * hwrm_tf_resc_type enum.
38953          */
38954         uint32_t        type;
38955         /* Number of TCAM index to be deleted for the device. */
38956         uint16_t        count;
38957         /* unused. */
38958         uint16_t        unused0;
38959         /* TCAM index list to be deleted for the device. */
38960         uint16_t        idx_list[48];
38961 } __rte_packed;
38962
38963 /* hwrm_tf_tcam_free_output (size:128b/16B) */
38964 struct hwrm_tf_tcam_free_output {
38965         /* The specific error status for the command. */
38966         uint16_t        error_code;
38967         /* The HWRM command request type. */
38968         uint16_t        req_type;
38969         /* The sequence ID from the original command. */
38970         uint16_t        seq_id;
38971         /* The length of the response data in number of bytes. */
38972         uint16_t        resp_len;
38973         /* unused. */
38974         uint8_t unused0[7];
38975         /*
38976          * This field is used in Output records to indicate that the
38977          * output is completely written to RAM. This field should be
38978          * read as '1' to indicate that the output has been
38979          * completely written.  When writing a command completion or
38980          * response to an internal processor, the order of writes has
38981          * to be such that this field is written last.
38982          */
38983         uint8_t valid;
38984 } __rte_packed;
38985
38986 /**************************
38987  * hwrm_tf_global_cfg_set *
38988  **************************/
38989
38990
38991 /* hwrm_tf_global_cfg_set_input (size:448b/56B) */
38992 struct hwrm_tf_global_cfg_set_input {
38993         /* The HWRM command request type. */
38994         uint16_t        req_type;
38995         /*
38996          * The completion ring to send the completion event on. This should
38997          * be the NQ ID returned from the `nq_alloc` HWRM command.
38998          */
38999         uint16_t        cmpl_ring;
39000         /*
39001          * The sequence ID is used by the driver for tracking multiple
39002          * commands. This ID is treated as opaque data by the firmware and
39003          * the value is returned in the `hwrm_resp_hdr` upon completion.
39004          */
39005         uint16_t        seq_id;
39006         /*
39007          * The target ID of the command:
39008          * * 0x0-0xFFF8 - The function ID
39009          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39010          * * 0xFFFD - Reserved for user-space HWRM interface
39011          * * 0xFFFF - HWRM
39012          */
39013         uint16_t        target_id;
39014         /*
39015          * A physical address pointer pointing to a host buffer that the
39016          * command's response data will be written. This can be either a host
39017          * physical address (HPA) or a guest physical address (GPA) and must
39018          * point to a physically contiguous block of memory.
39019          */
39020         uint64_t        resp_addr;
39021         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
39022         uint32_t        fw_session_id;
39023         /* Control flags. */
39024         uint32_t        flags;
39025         /* Indicates the flow direction. */
39026         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
39027         /* If this bit set to 0, then it indicates rx flow. */
39028         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
39029         /* If this bit is set to 1, then it indicates that tx flow. */
39030         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
39031         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_LAST \
39032                 HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX
39033         /* Global Cfg type */
39034         uint32_t        type;
39035         /* Offset of the type */
39036         uint32_t        offset;
39037         /* Size of the data to set in bytes */
39038         uint16_t        size;
39039         /* unused. */
39040         uint8_t unused0[6];
39041         /* Data to set */
39042         uint8_t data[8];
39043         /* Mask of data to set, 0 indicates no mask */
39044         uint8_t mask[8];
39045 } __rte_packed;
39046
39047 /* hwrm_tf_global_cfg_set_output (size:128b/16B) */
39048 struct hwrm_tf_global_cfg_set_output {
39049         /* The specific error status for the command. */
39050         uint16_t        error_code;
39051         /* The HWRM command request type. */
39052         uint16_t        req_type;
39053         /* The sequence ID from the original command. */
39054         uint16_t        seq_id;
39055         /* The length of the response data in number of bytes. */
39056         uint16_t        resp_len;
39057         /* unused. */
39058         uint8_t unused0[7];
39059         /*
39060          * This field is used in Output records to indicate that the
39061          * output is completely written to RAM. This field should be
39062          * read as '1' to indicate that the output has been
39063          * completely written.  When writing a command completion or
39064          * response to an internal processor, the order of writes has
39065          * to be such that this field is written last.
39066          */
39067         uint8_t valid;
39068 } __rte_packed;
39069
39070 /**************************
39071  * hwrm_tf_global_cfg_get *
39072  **************************/
39073
39074
39075 /* hwrm_tf_global_cfg_get_input (size:320b/40B) */
39076 struct hwrm_tf_global_cfg_get_input {
39077         /* The HWRM command request type. */
39078         uint16_t        req_type;
39079         /*
39080          * The completion ring to send the completion event on. This should
39081          * be the NQ ID returned from the `nq_alloc` HWRM command.
39082          */
39083         uint16_t        cmpl_ring;
39084         /*
39085          * The sequence ID is used by the driver for tracking multiple
39086          * commands. This ID is treated as opaque data by the firmware and
39087          * the value is returned in the `hwrm_resp_hdr` upon completion.
39088          */
39089         uint16_t        seq_id;
39090         /*
39091          * The target ID of the command:
39092          * * 0x0-0xFFF8 - The function ID
39093          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39094          * * 0xFFFD - Reserved for user-space HWRM interface
39095          * * 0xFFFF - HWRM
39096          */
39097         uint16_t        target_id;
39098         /*
39099          * A physical address pointer pointing to a host buffer that the
39100          * command's response data will be written. This can be either a host
39101          * physical address (HPA) or a guest physical address (GPA) and must
39102          * point to a physically contiguous block of memory.
39103          */
39104         uint64_t        resp_addr;
39105         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
39106         uint32_t        fw_session_id;
39107         /* Control flags. */
39108         uint32_t        flags;
39109         /* Indicates the flow direction. */
39110         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
39111         /* If this bit set to 0, then it indicates rx flow. */
39112         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
39113         /* If this bit is set to 1, then it indicates that tx flow. */
39114         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
39115         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_LAST \
39116                 HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX
39117         /* Global Cfg type */
39118         uint32_t        type;
39119         /* Offset of the type */
39120         uint32_t        offset;
39121         /* Size of the data to set in bytes */
39122         uint16_t        size;
39123         /* unused. */
39124         uint8_t unused0[6];
39125 } __rte_packed;
39126
39127 /* hwrm_tf_global_cfg_get_output (size:256b/32B) */
39128 struct hwrm_tf_global_cfg_get_output {
39129         /* The specific error status for the command. */
39130         uint16_t        error_code;
39131         /* The HWRM command request type. */
39132         uint16_t        req_type;
39133         /* The sequence ID from the original command. */
39134         uint16_t        seq_id;
39135         /* The length of the response data in number of bytes. */
39136         uint16_t        resp_len;
39137         /* Size of the data read in bytes */
39138         uint16_t        size;
39139         /* unused. */
39140         uint8_t unused0[6];
39141         /* Data to set */
39142         uint8_t data[16];
39143 } __rte_packed;
39144
39145 /**********************
39146  * hwrm_tf_if_tbl_get *
39147  **********************/
39148
39149
39150 /* hwrm_tf_if_tbl_get_input (size:256b/32B) */
39151 struct hwrm_tf_if_tbl_get_input {
39152         /* The HWRM command request type. */
39153         uint16_t        req_type;
39154         /*
39155          * The completion ring to send the completion event on. This should
39156          * be the NQ ID returned from the `nq_alloc` HWRM command.
39157          */
39158         uint16_t        cmpl_ring;
39159         /*
39160          * The sequence ID is used by the driver for tracking multiple
39161          * commands. This ID is treated as opaque data by the firmware and
39162          * the value is returned in the `hwrm_resp_hdr` upon completion.
39163          */
39164         uint16_t        seq_id;
39165         /*
39166          * The target ID of the command:
39167          * * 0x0-0xFFF8 - The function ID
39168          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39169          * * 0xFFFD - Reserved for user-space HWRM interface
39170          * * 0xFFFF - HWRM
39171          */
39172         uint16_t        target_id;
39173         /*
39174          * A physical address pointer pointing to a host buffer that the
39175          * command's response data will be written. This can be either a host
39176          * physical address (HPA) or a guest physical address (GPA) and must
39177          * point to a physically contiguous block of memory.
39178          */
39179         uint64_t        resp_addr;
39180         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
39181         uint32_t        fw_session_id;
39182         /* Control flags. */
39183         uint16_t        flags;
39184         /* Indicates the flow direction. */
39185         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
39186         /* If this bit set to 0, then it indicates rx flow. */
39187         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
39188         /* If this bit is set to 1, then it indicates that tx flow. */
39189         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
39190         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_LAST \
39191                 HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX
39192         /* Size of the data to set. */
39193         uint16_t        size;
39194         /*
39195          * Type of the resource, defined globally in the
39196          * hwrm_tf_resc_type enum.
39197          */
39198         uint32_t        type;
39199         /* Index of the type to retrieve. */
39200         uint32_t        index;
39201 } __rte_packed;
39202
39203 /* hwrm_tf_if_tbl_get_output (size:256b/32B) */
39204 struct hwrm_tf_if_tbl_get_output {
39205         /* The specific error status for the command. */
39206         uint16_t        error_code;
39207         /* The HWRM command request type. */
39208         uint16_t        req_type;
39209         /* The sequence ID from the original command. */
39210         uint16_t        seq_id;
39211         /* The length of the response data in number of bytes. */
39212         uint16_t        resp_len;
39213         /* Response code. */
39214         uint32_t        resp_code;
39215         /* Response size. */
39216         uint16_t        size;
39217         /* unused */
39218         uint16_t        unused0;
39219         /* Response data. */
39220         uint8_t data[8];
39221         /* unused */
39222         uint8_t unused1[7];
39223         /*
39224          * This field is used in Output records to indicate that the output
39225          * is completely written to RAM. This field should be read as '1'
39226          * to indicate that the output has been completely written.
39227          * When writing a command completion or response to an internal
39228          * processor, the order of writes has to be such that this field
39229          * is written last.
39230          */
39231         uint8_t valid;
39232 } __rte_packed;
39233
39234 /***************************
39235  * hwrm_tf_if_tbl_type_set *
39236  ***************************/
39237
39238
39239 /* hwrm_tf_if_tbl_set_input (size:384b/48B) */
39240 struct hwrm_tf_if_tbl_set_input {
39241         /* The HWRM command request type. */
39242         uint16_t        req_type;
39243         /*
39244          * The completion ring to send the completion event on. This should
39245          * be the NQ ID returned from the `nq_alloc` HWRM command.
39246          */
39247         uint16_t        cmpl_ring;
39248         /*
39249          * The sequence ID is used by the driver for tracking multiple
39250          * commands. This ID is treated as opaque data by the firmware and
39251          * the value is returned in the `hwrm_resp_hdr` upon completion.
39252          */
39253         uint16_t        seq_id;
39254         /*
39255          * The target ID of the command:
39256          * * 0x0-0xFFF8 - The function ID
39257          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39258          * * 0xFFFD - Reserved for user-space HWRM interface
39259          * * 0xFFFF - HWRM
39260          */
39261         uint16_t        target_id;
39262         /*
39263          * A physical address pointer pointing to a host buffer that the
39264          * command's response data will be written. This can be either a host
39265          * physical address (HPA) or a guest physical address (GPA) and must
39266          * point to a physically contiguous block of memory.
39267          */
39268         uint64_t        resp_addr;
39269         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
39270         uint32_t        fw_session_id;
39271         /* Control flags. */
39272         uint16_t        flags;
39273         /* Indicates the flow direction. */
39274         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
39275         /* If this bit set to 0, then it indicates rx flow. */
39276         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
39277         /* If this bit is set to 1, then it indicates that tx flow. */
39278         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
39279         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_LAST \
39280                 HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX
39281         /* unused. */
39282         uint8_t unused0[2];
39283         /*
39284          * Type of the resource, defined globally in the
39285          * hwrm_tf_resc_type enum.
39286          */
39287         uint32_t        type;
39288         /* Index of the type to set. */
39289         uint32_t        index;
39290         /* Size of the data to set. */
39291         uint16_t        size;
39292         /* unused */
39293         uint8_t unused1[6];
39294         /* Data to be set. */
39295         uint8_t data[8];
39296 } __rte_packed;
39297
39298 /* hwrm_tf_if_tbl_set_output (size:128b/16B) */
39299 struct hwrm_tf_if_tbl_set_output {
39300         /* The specific error status for the command. */
39301         uint16_t        error_code;
39302         /* The HWRM command request type. */
39303         uint16_t        req_type;
39304         /* The sequence ID from the original command. */
39305         uint16_t        seq_id;
39306         /* The length of the response data in number of bytes. */
39307         uint16_t        resp_len;
39308         /* unused. */
39309         uint8_t unused0[7];
39310         /*
39311          * This field is used in Output records to indicate that the output
39312          * is completely written to RAM. This field should be read as '1'
39313          * to indicate that the output has been completely written.
39314          * When writing a command completion or response to an internal
39315          * processor, the order of writes has to be such that this field
39316          * is written last.
39317          */
39318         uint8_t valid;
39319 } __rte_packed;
39320
39321 /******************************
39322  * hwrm_tunnel_dst_port_query *
39323  ******************************/
39324
39325
39326 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
39327 struct hwrm_tunnel_dst_port_query_input {
39328         /* The HWRM command request type. */
39329         uint16_t        req_type;
39330         /*
39331          * The completion ring to send the completion event on. This should
39332          * be the NQ ID returned from the `nq_alloc` HWRM command.
39333          */
39334         uint16_t        cmpl_ring;
39335         /*
39336          * The sequence ID is used by the driver for tracking multiple
39337          * commands. This ID is treated as opaque data by the firmware and
39338          * the value is returned in the `hwrm_resp_hdr` upon completion.
39339          */
39340         uint16_t        seq_id;
39341         /*
39342          * The target ID of the command:
39343          * * 0x0-0xFFF8 - The function ID
39344          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39345          * * 0xFFFD - Reserved for user-space HWRM interface
39346          * * 0xFFFF - HWRM
39347          */
39348         uint16_t        target_id;
39349         /*
39350          * A physical address pointer pointing to a host buffer that the
39351          * command's response data will be written. This can be either a host
39352          * physical address (HPA) or a guest physical address (GPA) and must
39353          * point to a physically contiguous block of memory.
39354          */
39355         uint64_t        resp_addr;
39356         /* Tunnel Type. */
39357         uint8_t tunnel_type;
39358         /* Virtual eXtensible Local Area Network (VXLAN) */
39359         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
39360                 UINT32_C(0x1)
39361         /* Generic Network Virtualization Encapsulation (Geneve) */
39362         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
39363                 UINT32_C(0x5)
39364         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
39365         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
39366                 UINT32_C(0x9)
39367         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
39368         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
39369                 UINT32_C(0xa)
39370         /* Use fixed layer 2 ether type of 0xFFFF */
39371         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
39372                 UINT32_C(0xb)
39373         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
39374         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
39375                 UINT32_C(0xc)
39376         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
39377                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
39378         uint8_t unused_0[7];
39379 } __rte_packed;
39380
39381 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
39382 struct hwrm_tunnel_dst_port_query_output {
39383         /* The specific error status for the command. */
39384         uint16_t        error_code;
39385         /* The HWRM command request type. */
39386         uint16_t        req_type;
39387         /* The sequence ID from the original command. */
39388         uint16_t        seq_id;
39389         /* The length of the response data in number of bytes. */
39390         uint16_t        resp_len;
39391         /*
39392          * This field represents the identifier of L4 destination port
39393          * used for the given tunnel type. This field is valid for
39394          * specific tunnel types that use layer 4 (e.g. UDP)
39395          * transports for tunneling.
39396          */
39397         uint16_t        tunnel_dst_port_id;
39398         /*
39399          * This field represents the value of L4 destination port
39400          * identified by tunnel_dst_port_id. This field is valid for
39401          * specific tunnel types that use layer 4 (e.g. UDP)
39402          * transports for tunneling.
39403          * This field is in network byte order.
39404          *
39405          * A value of 0 means that the destination port is not
39406          * configured.
39407          */
39408         uint16_t        tunnel_dst_port_val;
39409         uint8_t unused_0[3];
39410         /*
39411          * This field is used in Output records to indicate that the output
39412          * is completely written to RAM.  This field should be read as '1'
39413          * to indicate that the output has been completely written.
39414          * When writing a command completion or response to an internal processor,
39415          * the order of writes has to be such that this field is written last.
39416          */
39417         uint8_t valid;
39418 } __rte_packed;
39419
39420 /******************************
39421  * hwrm_tunnel_dst_port_alloc *
39422  ******************************/
39423
39424
39425 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
39426 struct hwrm_tunnel_dst_port_alloc_input {
39427         /* The HWRM command request type. */
39428         uint16_t        req_type;
39429         /*
39430          * The completion ring to send the completion event on. This should
39431          * be the NQ ID returned from the `nq_alloc` HWRM command.
39432          */
39433         uint16_t        cmpl_ring;
39434         /*
39435          * The sequence ID is used by the driver for tracking multiple
39436          * commands. This ID is treated as opaque data by the firmware and
39437          * the value is returned in the `hwrm_resp_hdr` upon completion.
39438          */
39439         uint16_t        seq_id;
39440         /*
39441          * The target ID of the command:
39442          * * 0x0-0xFFF8 - The function ID
39443          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39444          * * 0xFFFD - Reserved for user-space HWRM interface
39445          * * 0xFFFF - HWRM
39446          */
39447         uint16_t        target_id;
39448         /*
39449          * A physical address pointer pointing to a host buffer that the
39450          * command's response data will be written. This can be either a host
39451          * physical address (HPA) or a guest physical address (GPA) and must
39452          * point to a physically contiguous block of memory.
39453          */
39454         uint64_t        resp_addr;
39455         /* Tunnel Type. */
39456         uint8_t tunnel_type;
39457         /* Virtual eXtensible Local Area Network (VXLAN) */
39458         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
39459                 UINT32_C(0x1)
39460         /* Generic Network Virtualization Encapsulation (Geneve) */
39461         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
39462                 UINT32_C(0x5)
39463         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
39464         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
39465                 UINT32_C(0x9)
39466         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
39467         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
39468                 UINT32_C(0xa)
39469         /* Use fixed layer 2 ether type of 0xFFFF */
39470         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
39471                 UINT32_C(0xb)
39472         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
39473         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
39474                 UINT32_C(0xc)
39475         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
39476                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
39477         uint8_t unused_0;
39478         /*
39479          * This field represents the value of L4 destination port used
39480          * for the given tunnel type. This field is valid for
39481          * specific tunnel types that use layer 4 (e.g. UDP)
39482          * transports for tunneling.
39483          *
39484          * This field is in network byte order.
39485          *
39486          * A value of 0 shall fail the command.
39487          */
39488         uint16_t        tunnel_dst_port_val;
39489         uint8_t unused_1[4];
39490 } __rte_packed;
39491
39492 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
39493 struct hwrm_tunnel_dst_port_alloc_output {
39494         /* The specific error status for the command. */
39495         uint16_t        error_code;
39496         /* The HWRM command request type. */
39497         uint16_t        req_type;
39498         /* The sequence ID from the original command. */
39499         uint16_t        seq_id;
39500         /* The length of the response data in number of bytes. */
39501         uint16_t        resp_len;
39502         /*
39503          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
39504          * types that has l4 destination port parameters.
39505          */
39506         uint16_t        tunnel_dst_port_id;
39507         uint8_t unused_0[5];
39508         /*
39509          * This field is used in Output records to indicate that the output
39510          * is completely written to RAM.  This field should be read as '1'
39511          * to indicate that the output has been completely written.
39512          * When writing a command completion or response to an internal processor,
39513          * the order of writes has to be such that this field is written last.
39514          */
39515         uint8_t valid;
39516 } __rte_packed;
39517
39518 /*****************************
39519  * hwrm_tunnel_dst_port_free *
39520  *****************************/
39521
39522
39523 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
39524 struct hwrm_tunnel_dst_port_free_input {
39525         /* The HWRM command request type. */
39526         uint16_t        req_type;
39527         /*
39528          * The completion ring to send the completion event on. This should
39529          * be the NQ ID returned from the `nq_alloc` HWRM command.
39530          */
39531         uint16_t        cmpl_ring;
39532         /*
39533          * The sequence ID is used by the driver for tracking multiple
39534          * commands. This ID is treated as opaque data by the firmware and
39535          * the value is returned in the `hwrm_resp_hdr` upon completion.
39536          */
39537         uint16_t        seq_id;
39538         /*
39539          * The target ID of the command:
39540          * * 0x0-0xFFF8 - The function ID
39541          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39542          * * 0xFFFD - Reserved for user-space HWRM interface
39543          * * 0xFFFF - HWRM
39544          */
39545         uint16_t        target_id;
39546         /*
39547          * A physical address pointer pointing to a host buffer that the
39548          * command's response data will be written. This can be either a host
39549          * physical address (HPA) or a guest physical address (GPA) and must
39550          * point to a physically contiguous block of memory.
39551          */
39552         uint64_t        resp_addr;
39553         /* Tunnel Type. */
39554         uint8_t tunnel_type;
39555         /* Virtual eXtensible Local Area Network (VXLAN) */
39556         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
39557                 UINT32_C(0x1)
39558         /* Generic Network Virtualization Encapsulation (Geneve) */
39559         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
39560                 UINT32_C(0x5)
39561         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
39562         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
39563                 UINT32_C(0x9)
39564         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
39565         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
39566                 UINT32_C(0xa)
39567         /* Use fixed layer 2 ether type of 0xFFFF */
39568         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
39569                 UINT32_C(0xb)
39570         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
39571         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
39572                 UINT32_C(0xc)
39573         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
39574                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
39575         uint8_t unused_0;
39576         /*
39577          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
39578          * types that has l4 destination port parameters.
39579          */
39580         uint16_t        tunnel_dst_port_id;
39581         uint8_t unused_1[4];
39582 } __rte_packed;
39583
39584 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
39585 struct hwrm_tunnel_dst_port_free_output {
39586         /* The specific error status for the command. */
39587         uint16_t        error_code;
39588         /* The HWRM command request type. */
39589         uint16_t        req_type;
39590         /* The sequence ID from the original command. */
39591         uint16_t        seq_id;
39592         /* The length of the response data in number of bytes. */
39593         uint16_t        resp_len;
39594         uint8_t unused_1[7];
39595         /*
39596          * This field is used in Output records to indicate that the output
39597          * is completely written to RAM.  This field should be read as '1'
39598          * to indicate that the output has been completely written.
39599          * When writing a command completion or response to an internal processor,
39600          * the order of writes has to be such that this field is written last.
39601          */
39602         uint8_t valid;
39603 } __rte_packed;
39604
39605 /* Periodic statistics context DMA to host. */
39606 /* ctx_hw_stats (size:1280b/160B) */
39607 struct ctx_hw_stats {
39608         /* Number of received unicast packets */
39609         uint64_t        rx_ucast_pkts;
39610         /* Number of received multicast packets */
39611         uint64_t        rx_mcast_pkts;
39612         /* Number of received broadcast packets */
39613         uint64_t        rx_bcast_pkts;
39614         /* Number of discarded packets on receive path */
39615         uint64_t        rx_discard_pkts;
39616         /* Number of packets on receive path with error */
39617         uint64_t        rx_error_pkts;
39618         /* Number of received bytes for unicast traffic */
39619         uint64_t        rx_ucast_bytes;
39620         /* Number of received bytes for multicast traffic */
39621         uint64_t        rx_mcast_bytes;
39622         /* Number of received bytes for broadcast traffic */
39623         uint64_t        rx_bcast_bytes;
39624         /* Number of transmitted unicast packets */
39625         uint64_t        tx_ucast_pkts;
39626         /* Number of transmitted multicast packets */
39627         uint64_t        tx_mcast_pkts;
39628         /* Number of transmitted broadcast packets */
39629         uint64_t        tx_bcast_pkts;
39630         /* Number of packets on transmit path with error */
39631         uint64_t        tx_error_pkts;
39632         /* Number of discarded packets on transmit path */
39633         uint64_t        tx_discard_pkts;
39634         /* Number of transmitted bytes for unicast traffic */
39635         uint64_t        tx_ucast_bytes;
39636         /* Number of transmitted bytes for multicast traffic */
39637         uint64_t        tx_mcast_bytes;
39638         /* Number of transmitted bytes for broadcast traffic */
39639         uint64_t        tx_bcast_bytes;
39640         /* Number of TPA packets */
39641         uint64_t        tpa_pkts;
39642         /* Number of TPA bytes */
39643         uint64_t        tpa_bytes;
39644         /* Number of TPA events */
39645         uint64_t        tpa_events;
39646         /* Number of TPA aborts */
39647         uint64_t        tpa_aborts;
39648 } __rte_packed;
39649
39650 /*
39651  * Extended periodic statistics context DMA to host. On cards that
39652  * support TPA v2, additional TPA related stats exist and can be retrieved
39653  * by DMA of ctx_hw_stats_ext, rather than legacy ctx_hw_stats structure.
39654  */
39655 /* ctx_hw_stats_ext (size:1344b/168B) */
39656 struct ctx_hw_stats_ext {
39657         /* Number of received unicast packets */
39658         uint64_t        rx_ucast_pkts;
39659         /* Number of received multicast packets */
39660         uint64_t        rx_mcast_pkts;
39661         /* Number of received broadcast packets */
39662         uint64_t        rx_bcast_pkts;
39663         /* Number of discarded packets on receive path */
39664         uint64_t        rx_discard_pkts;
39665         /* Number of packets on receive path with error */
39666         uint64_t        rx_error_pkts;
39667         /* Number of received bytes for unicast traffic */
39668         uint64_t        rx_ucast_bytes;
39669         /* Number of received bytes for multicast traffic */
39670         uint64_t        rx_mcast_bytes;
39671         /* Number of received bytes for broadcast traffic */
39672         uint64_t        rx_bcast_bytes;
39673         /* Number of transmitted unicast packets */
39674         uint64_t        tx_ucast_pkts;
39675         /* Number of transmitted multicast packets */
39676         uint64_t        tx_mcast_pkts;
39677         /* Number of transmitted broadcast packets */
39678         uint64_t        tx_bcast_pkts;
39679         /* Number of packets on transmit path with error */
39680         uint64_t        tx_error_pkts;
39681         /* Number of discarded packets on transmit path */
39682         uint64_t        tx_discard_pkts;
39683         /* Number of transmitted bytes for unicast traffic */
39684         uint64_t        tx_ucast_bytes;
39685         /* Number of transmitted bytes for multicast traffic */
39686         uint64_t        tx_mcast_bytes;
39687         /* Number of transmitted bytes for broadcast traffic */
39688         uint64_t        tx_bcast_bytes;
39689         /* Number of TPA eligible packets */
39690         uint64_t        rx_tpa_eligible_pkt;
39691         /* Number of TPA eligible bytes */
39692         uint64_t        rx_tpa_eligible_bytes;
39693         /* Number of TPA packets */
39694         uint64_t        rx_tpa_pkt;
39695         /* Number of TPA bytes */
39696         uint64_t        rx_tpa_bytes;
39697         /* Number of TPA errors */
39698         uint64_t        rx_tpa_errors;
39699 } __rte_packed;
39700
39701 /* Periodic Engine statistics context DMA to host. */
39702 /* ctx_eng_stats (size:512b/64B) */
39703 struct ctx_eng_stats {
39704         /*
39705          * Count of data bytes into the Engine.
39706          * This includes any user supplied prefix,
39707          * but does not include any predefined
39708          * prefix data.
39709          */
39710         uint64_t        eng_bytes_in;
39711         /* Count of data bytes out of the Engine. */
39712         uint64_t        eng_bytes_out;
39713         /*
39714          * Count, in 4-byte (dword) units, of bytes
39715          * that are input as auxiliary data.
39716          * This includes the aux_cmd data.
39717          */
39718         uint64_t        aux_bytes_in;
39719         /*
39720          * Count, in 4-byte (dword) units, of bytes
39721          * that are output as auxiliary data.
39722          * This count is the buffer space for aux_data
39723          * output provided in the RQE, not the actual
39724          * aux_data written
39725          */
39726         uint64_t        aux_bytes_out;
39727         /* Count of number of commands executed. */
39728         uint64_t        commands;
39729         /*
39730          * Count of number of error commands.
39731          * These are the commands with a
39732          * non-zero status value.
39733          */
39734         uint64_t        error_commands;
39735         /*
39736          * Compression/Encryption Engine usage,
39737          * the unit is count of clock cycles
39738          */
39739         uint64_t        cce_engine_usage;
39740         /*
39741          * De-Compression/De-cryption Engine usage,
39742          * the unit is count of clock cycles
39743          */
39744         uint64_t        cdd_engine_usage;
39745 } __rte_packed;
39746
39747 /***********************
39748  * hwrm_stat_ctx_alloc *
39749  ***********************/
39750
39751
39752 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
39753 struct hwrm_stat_ctx_alloc_input {
39754         /* The HWRM command request type. */
39755         uint16_t        req_type;
39756         /*
39757          * The completion ring to send the completion event on. This should
39758          * be the NQ ID returned from the `nq_alloc` HWRM command.
39759          */
39760         uint16_t        cmpl_ring;
39761         /*
39762          * The sequence ID is used by the driver for tracking multiple
39763          * commands. This ID is treated as opaque data by the firmware and
39764          * the value is returned in the `hwrm_resp_hdr` upon completion.
39765          */
39766         uint16_t        seq_id;
39767         /*
39768          * The target ID of the command:
39769          * * 0x0-0xFFF8 - The function ID
39770          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39771          * * 0xFFFD - Reserved for user-space HWRM interface
39772          * * 0xFFFF - HWRM
39773          */
39774         uint16_t        target_id;
39775         /*
39776          * A physical address pointer pointing to a host buffer that the
39777          * command's response data will be written. This can be either a host
39778          * physical address (HPA) or a guest physical address (GPA) and must
39779          * point to a physically contiguous block of memory.
39780          */
39781         uint64_t        resp_addr;
39782         /*
39783          * This is the address for statistic block.
39784          * > For new versions of the chip, this address should be 128B
39785          * > aligned.
39786          */
39787         uint64_t        stats_dma_addr;
39788         /*
39789          * The statistic block update period in ms.
39790          * e.g. 250ms, 500ms, 750ms, 1000ms.
39791          * If update_period_ms is 0, then the stats update
39792          * shall be never done and the DMA address shall not be used.
39793          * In this case, the stat block can only be read by
39794          * hwrm_stat_ctx_query command.
39795          * On Ethernet/L2 based devices:
39796          *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
39797          *       ctx_hw_stats_ext is used for DMA,
39798          *   else
39799          *       ctx_hw_stats is used for DMA.
39800          */
39801         uint32_t        update_period_ms;
39802         /*
39803          * This field is used to specify statistics context specific
39804          * configuration flags.
39805          */
39806         uint8_t stat_ctx_flags;
39807         /*
39808          * When this bit is set to '1', the statistics context shall be
39809          * allocated for RoCE traffic only. In this case, traffic other
39810          * than offloaded RoCE traffic shall not be included in this
39811          * statistic context.
39812          * When this bit is set to '0', the statistics context shall be
39813          * used for network traffic or engine traffic.
39814          */
39815         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
39816         uint8_t unused_0;
39817         /*
39818          * This is the size of the structure (ctx_hw_stats or
39819          * ctx_hw_stats_ext) that the driver has allocated to be used
39820          * for the periodic DMA updates.
39821          */
39822         uint16_t        stats_dma_length;
39823 } __rte_packed;
39824
39825 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
39826 struct hwrm_stat_ctx_alloc_output {
39827         /* The specific error status for the command. */
39828         uint16_t        error_code;
39829         /* The HWRM command request type. */
39830         uint16_t        req_type;
39831         /* The sequence ID from the original command. */
39832         uint16_t        seq_id;
39833         /* The length of the response data in number of bytes. */
39834         uint16_t        resp_len;
39835         /* This is the statistics context ID value. */
39836         uint32_t        stat_ctx_id;
39837         uint8_t unused_0[3];
39838         /*
39839          * This field is used in Output records to indicate that the output
39840          * is completely written to RAM.  This field should be read as '1'
39841          * to indicate that the output has been completely written.
39842          * When writing a command completion or response to an internal processor,
39843          * the order of writes has to be such that this field is written last.
39844          */
39845         uint8_t valid;
39846 } __rte_packed;
39847
39848 /**********************
39849  * hwrm_stat_ctx_free *
39850  **********************/
39851
39852
39853 /* hwrm_stat_ctx_free_input (size:192b/24B) */
39854 struct hwrm_stat_ctx_free_input {
39855         /* The HWRM command request type. */
39856         uint16_t        req_type;
39857         /*
39858          * The completion ring to send the completion event on. This should
39859          * be the NQ ID returned from the `nq_alloc` HWRM command.
39860          */
39861         uint16_t        cmpl_ring;
39862         /*
39863          * The sequence ID is used by the driver for tracking multiple
39864          * commands. This ID is treated as opaque data by the firmware and
39865          * the value is returned in the `hwrm_resp_hdr` upon completion.
39866          */
39867         uint16_t        seq_id;
39868         /*
39869          * The target ID of the command:
39870          * * 0x0-0xFFF8 - The function ID
39871          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39872          * * 0xFFFD - Reserved for user-space HWRM interface
39873          * * 0xFFFF - HWRM
39874          */
39875         uint16_t        target_id;
39876         /*
39877          * A physical address pointer pointing to a host buffer that the
39878          * command's response data will be written. This can be either a host
39879          * physical address (HPA) or a guest physical address (GPA) and must
39880          * point to a physically contiguous block of memory.
39881          */
39882         uint64_t        resp_addr;
39883         /* ID of the statistics context that is being queried. */
39884         uint32_t        stat_ctx_id;
39885         uint8_t unused_0[4];
39886 } __rte_packed;
39887
39888 /* hwrm_stat_ctx_free_output (size:128b/16B) */
39889 struct hwrm_stat_ctx_free_output {
39890         /* The specific error status for the command. */
39891         uint16_t        error_code;
39892         /* The HWRM command request type. */
39893         uint16_t        req_type;
39894         /* The sequence ID from the original command. */
39895         uint16_t        seq_id;
39896         /* The length of the response data in number of bytes. */
39897         uint16_t        resp_len;
39898         /* This is the statistics context ID value. */
39899         uint32_t        stat_ctx_id;
39900         uint8_t unused_0[3];
39901         /*
39902          * This field is used in Output records to indicate that the output
39903          * is completely written to RAM.  This field should be read as '1'
39904          * to indicate that the output has been completely written.
39905          * When writing a command completion or response to an internal processor,
39906          * the order of writes has to be such that this field is written last.
39907          */
39908         uint8_t valid;
39909 } __rte_packed;
39910
39911 /***********************
39912  * hwrm_stat_ctx_query *
39913  ***********************/
39914
39915
39916 /* hwrm_stat_ctx_query_input (size:192b/24B) */
39917 struct hwrm_stat_ctx_query_input {
39918         /* The HWRM command request type. */
39919         uint16_t        req_type;
39920         /*
39921          * The completion ring to send the completion event on. This should
39922          * be the NQ ID returned from the `nq_alloc` HWRM command.
39923          */
39924         uint16_t        cmpl_ring;
39925         /*
39926          * The sequence ID is used by the driver for tracking multiple
39927          * commands. This ID is treated as opaque data by the firmware and
39928          * the value is returned in the `hwrm_resp_hdr` upon completion.
39929          */
39930         uint16_t        seq_id;
39931         /*
39932          * The target ID of the command:
39933          * * 0x0-0xFFF8 - The function ID
39934          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39935          * * 0xFFFD - Reserved for user-space HWRM interface
39936          * * 0xFFFF - HWRM
39937          */
39938         uint16_t        target_id;
39939         /*
39940          * A physical address pointer pointing to a host buffer that the
39941          * command's response data will be written. This can be either a host
39942          * physical address (HPA) or a guest physical address (GPA) and must
39943          * point to a physically contiguous block of memory.
39944          */
39945         uint64_t        resp_addr;
39946         /* ID of the statistics context that is being queried. */
39947         uint32_t        stat_ctx_id;
39948         uint8_t flags;
39949         /*
39950          * This bit is set to 1 when request is for a counter mask,
39951          * representing the width of each of the stats counters, rather
39952          * than counters themselves.
39953          */
39954         #define HWRM_STAT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK     UINT32_C(0x1)
39955         uint8_t unused_0[3];
39956 } __rte_packed;
39957
39958 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
39959 struct hwrm_stat_ctx_query_output {
39960         /* The specific error status for the command. */
39961         uint16_t        error_code;
39962         /* The HWRM command request type. */
39963         uint16_t        req_type;
39964         /* The sequence ID from the original command. */
39965         uint16_t        seq_id;
39966         /* The length of the response data in number of bytes. */
39967         uint16_t        resp_len;
39968         /* Number of transmitted unicast packets */
39969         uint64_t        tx_ucast_pkts;
39970         /* Number of transmitted multicast packets */
39971         uint64_t        tx_mcast_pkts;
39972         /* Number of transmitted broadcast packets */
39973         uint64_t        tx_bcast_pkts;
39974         /* Number of transmitted packets with error */
39975         uint64_t        tx_err_pkts;
39976         /* Number of dropped packets on transmit path */
39977         uint64_t        tx_drop_pkts;
39978         /* Number of transmitted bytes for unicast traffic */
39979         uint64_t        tx_ucast_bytes;
39980         /* Number of transmitted bytes for multicast traffic */
39981         uint64_t        tx_mcast_bytes;
39982         /* Number of transmitted bytes for broadcast traffic */
39983         uint64_t        tx_bcast_bytes;
39984         /* Number of received unicast packets */
39985         uint64_t        rx_ucast_pkts;
39986         /* Number of received multicast packets */
39987         uint64_t        rx_mcast_pkts;
39988         /* Number of received broadcast packets */
39989         uint64_t        rx_bcast_pkts;
39990         /* Number of received packets with error */
39991         uint64_t        rx_err_pkts;
39992         /* Number of dropped packets on receive path */
39993         uint64_t        rx_drop_pkts;
39994         /* Number of received bytes for unicast traffic */
39995         uint64_t        rx_ucast_bytes;
39996         /* Number of received bytes for multicast traffic */
39997         uint64_t        rx_mcast_bytes;
39998         /* Number of received bytes for broadcast traffic */
39999         uint64_t        rx_bcast_bytes;
40000         /* Number of aggregated unicast packets */
40001         uint64_t        rx_agg_pkts;
40002         /* Number of aggregated unicast bytes */
40003         uint64_t        rx_agg_bytes;
40004         /* Number of aggregation events */
40005         uint64_t        rx_agg_events;
40006         /* Number of aborted aggregations */
40007         uint64_t        rx_agg_aborts;
40008         uint8_t unused_0[7];
40009         /*
40010          * This field is used in Output records to indicate that the output
40011          * is completely written to RAM.  This field should be read as '1'
40012          * to indicate that the output has been completely written.
40013          * When writing a command completion or response to an internal processor,
40014          * the order of writes has to be such that this field is written last.
40015          */
40016         uint8_t valid;
40017 } __rte_packed;
40018
40019 /***************************
40020  * hwrm_stat_ext_ctx_query *
40021  ***************************/
40022
40023
40024 /* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
40025 struct hwrm_stat_ext_ctx_query_input {
40026         /* The HWRM command request type. */
40027         uint16_t        req_type;
40028         /*
40029          * The completion ring to send the completion event on. This should
40030          * be the NQ ID returned from the `nq_alloc` HWRM command.
40031          */
40032         uint16_t        cmpl_ring;
40033         /*
40034          * The sequence ID is used by the driver for tracking multiple
40035          * commands. This ID is treated as opaque data by the firmware and
40036          * the value is returned in the `hwrm_resp_hdr` upon completion.
40037          */
40038         uint16_t        seq_id;
40039         /*
40040          * The target ID of the command:
40041          * * 0x0-0xFFF8 - The function ID
40042          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40043          * * 0xFFFD - Reserved for user-space HWRM interface
40044          * * 0xFFFF - HWRM
40045          */
40046         uint16_t        target_id;
40047         /*
40048          * A physical address pointer pointing to a host buffer that the
40049          * command's response data will be written. This can be either a host
40050          * physical address (HPA) or a guest physical address (GPA) and must
40051          * point to a physically contiguous block of memory.
40052          */
40053         uint64_t        resp_addr;
40054         /* ID of the extended statistics context that is being queried. */
40055         uint32_t        stat_ctx_id;
40056         uint8_t flags;
40057         /*
40058          * This bit is set to 1 when request is for a counter mask,
40059          * representing the width of each of the stats counters, rather
40060          * than counters themselves.
40061          */
40062         #define HWRM_STAT_EXT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK \
40063                 UINT32_C(0x1)
40064         uint8_t unused_0[3];
40065 } __rte_packed;
40066
40067 /* hwrm_stat_ext_ctx_query_output (size:1472b/184B) */
40068 struct hwrm_stat_ext_ctx_query_output {
40069         /* The specific error status for the command. */
40070         uint16_t        error_code;
40071         /* The HWRM command request type. */
40072         uint16_t        req_type;
40073         /* The sequence ID from the original command. */
40074         uint16_t        seq_id;
40075         /* The length of the response data in number of bytes. */
40076         uint16_t        resp_len;
40077         /* Number of received unicast packets */
40078         uint64_t        rx_ucast_pkts;
40079         /* Number of received multicast packets */
40080         uint64_t        rx_mcast_pkts;
40081         /* Number of received broadcast packets */
40082         uint64_t        rx_bcast_pkts;
40083         /* Number of discarded packets on receive path */
40084         uint64_t        rx_discard_pkts;
40085         /* Number of packets on receive path with error */
40086         uint64_t        rx_error_pkts;
40087         /* Number of received bytes for unicast traffic */
40088         uint64_t        rx_ucast_bytes;
40089         /* Number of received bytes for multicast traffic */
40090         uint64_t        rx_mcast_bytes;
40091         /* Number of received bytes for broadcast traffic */
40092         uint64_t        rx_bcast_bytes;
40093         /* Number of transmitted unicast packets */
40094         uint64_t        tx_ucast_pkts;
40095         /* Number of transmitted multicast packets */
40096         uint64_t        tx_mcast_pkts;
40097         /* Number of transmitted broadcast packets */
40098         uint64_t        tx_bcast_pkts;
40099         /* Number of packets on transmit path with error */
40100         uint64_t        tx_error_pkts;
40101         /* Number of discarded packets on transmit path */
40102         uint64_t        tx_discard_pkts;
40103         /* Number of transmitted bytes for unicast traffic */
40104         uint64_t        tx_ucast_bytes;
40105         /* Number of transmitted bytes for multicast traffic */
40106         uint64_t        tx_mcast_bytes;
40107         /* Number of transmitted bytes for broadcast traffic */
40108         uint64_t        tx_bcast_bytes;
40109         /* Number of TPA eligible packets */
40110         uint64_t        rx_tpa_eligible_pkt;
40111         /* Number of TPA eligible bytes */
40112         uint64_t        rx_tpa_eligible_bytes;
40113         /* Number of TPA packets */
40114         uint64_t        rx_tpa_pkt;
40115         /* Number of TPA bytes */
40116         uint64_t        rx_tpa_bytes;
40117         /* Number of TPA errors */
40118         uint64_t        rx_tpa_errors;
40119         uint8_t unused_0[7];
40120         /*
40121          * This field is used in Output records to indicate that the output
40122          * is completely written to RAM.  This field should be read as '1'
40123          * to indicate that the output has been completely written.
40124          * When writing a command completion or response to an internal processor,
40125          * the order of writes has to be such that this field is written last.
40126          */
40127         uint8_t valid;
40128 } __rte_packed;
40129
40130 /***************************
40131  * hwrm_stat_ctx_eng_query *
40132  ***************************/
40133
40134
40135 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
40136 struct hwrm_stat_ctx_eng_query_input {
40137         /* The HWRM command request type. */
40138         uint16_t        req_type;
40139         /*
40140          * The completion ring to send the completion event on. This should
40141          * be the NQ ID returned from the `nq_alloc` HWRM command.
40142          */
40143         uint16_t        cmpl_ring;
40144         /*
40145          * The sequence ID is used by the driver for tracking multiple
40146          * commands. This ID is treated as opaque data by the firmware and
40147          * the value is returned in the `hwrm_resp_hdr` upon completion.
40148          */
40149         uint16_t        seq_id;
40150         /*
40151          * The target ID of the command:
40152          * * 0x0-0xFFF8 - The function ID
40153          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40154          * * 0xFFFD - Reserved for user-space HWRM interface
40155          * * 0xFFFF - HWRM
40156          */
40157         uint16_t        target_id;
40158         /*
40159          * A physical address pointer pointing to a host buffer that the
40160          * command's response data will be written. This can be either a host
40161          * physical address (HPA) or a guest physical address (GPA) and must
40162          * point to a physically contiguous block of memory.
40163          */
40164         uint64_t        resp_addr;
40165         /* ID of the statistics context that is being queried. */
40166         uint32_t        stat_ctx_id;
40167         uint8_t unused_0[4];
40168 } __rte_packed;
40169
40170 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
40171 struct hwrm_stat_ctx_eng_query_output {
40172         /* The specific error status for the command. */
40173         uint16_t        error_code;
40174         /* The HWRM command request type. */
40175         uint16_t        req_type;
40176         /* The sequence ID from the original command. */
40177         uint16_t        seq_id;
40178         /* The length of the response data in number of bytes. */
40179         uint16_t        resp_len;
40180         /*
40181          * Count of data bytes into the Engine.
40182          * This includes any user supplied prefix,
40183          * but does not include any predefined
40184          * prefix data.
40185          */
40186         uint64_t        eng_bytes_in;
40187         /* Count of data bytes out of the Engine. */
40188         uint64_t        eng_bytes_out;
40189         /*
40190          * Count, in 4-byte (dword) units, of bytes
40191          * that are input as auxiliary data.
40192          * This includes the aux_cmd data.
40193          */
40194         uint64_t        aux_bytes_in;
40195         /*
40196          * Count, in 4-byte (dword) units, of bytes
40197          * that are output as auxiliary data.
40198          * This count is the buffer space for aux_data
40199          * output provided in the RQE, not the actual
40200          * aux_data written
40201          */
40202         uint64_t        aux_bytes_out;
40203         /* Count of number of commands executed. */
40204         uint64_t        commands;
40205         /*
40206          * Count of number of error commands.
40207          * These are the commands with a
40208          * non-zero status value.
40209          */
40210         uint64_t        error_commands;
40211         /*
40212          * Compression/Encryption Engine usage,
40213          * the unit is count of clock cycles
40214          */
40215         uint64_t        cce_engine_usage;
40216         /*
40217          * De-Compression/De-cryption Engine usage,
40218          * the unit is count of clock cycles
40219          */
40220         uint64_t        cdd_engine_usage;
40221         uint8_t unused_0[7];
40222         /*
40223          * This field is used in Output records to indicate that the output
40224          * is completely written to RAM.  This field should be read as '1'
40225          * to indicate that the output has been completely written.
40226          * When writing a command completion or response to an internal processor,
40227          * the order of writes has to be such that this field is written last.
40228          */
40229         uint8_t valid;
40230 } __rte_packed;
40231
40232 /***************************
40233  * hwrm_stat_ctx_clr_stats *
40234  ***************************/
40235
40236
40237 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
40238 struct hwrm_stat_ctx_clr_stats_input {
40239         /* The HWRM command request type. */
40240         uint16_t        req_type;
40241         /*
40242          * The completion ring to send the completion event on. This should
40243          * be the NQ ID returned from the `nq_alloc` HWRM command.
40244          */
40245         uint16_t        cmpl_ring;
40246         /*
40247          * The sequence ID is used by the driver for tracking multiple
40248          * commands. This ID is treated as opaque data by the firmware and
40249          * the value is returned in the `hwrm_resp_hdr` upon completion.
40250          */
40251         uint16_t        seq_id;
40252         /*
40253          * The target ID of the command:
40254          * * 0x0-0xFFF8 - The function ID
40255          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40256          * * 0xFFFD - Reserved for user-space HWRM interface
40257          * * 0xFFFF - HWRM
40258          */
40259         uint16_t        target_id;
40260         /*
40261          * A physical address pointer pointing to a host buffer that the
40262          * command's response data will be written. This can be either a host
40263          * physical address (HPA) or a guest physical address (GPA) and must
40264          * point to a physically contiguous block of memory.
40265          */
40266         uint64_t        resp_addr;
40267         /* ID of the statistics context that is being queried. */
40268         uint32_t        stat_ctx_id;
40269         uint8_t unused_0[4];
40270 } __rte_packed;
40271
40272 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
40273 struct hwrm_stat_ctx_clr_stats_output {
40274         /* The specific error status for the command. */
40275         uint16_t        error_code;
40276         /* The HWRM command request type. */
40277         uint16_t        req_type;
40278         /* The sequence ID from the original command. */
40279         uint16_t        seq_id;
40280         /* The length of the response data in number of bytes. */
40281         uint16_t        resp_len;
40282         uint8_t unused_0[7];
40283         /*
40284          * This field is used in Output records to indicate that the output
40285          * is completely written to RAM.  This field should be read as '1'
40286          * to indicate that the output has been completely written.
40287          * When writing a command completion or response to an internal processor,
40288          * the order of writes has to be such that this field is written last.
40289          */
40290         uint8_t valid;
40291 } __rte_packed;
40292
40293 /********************
40294  * hwrm_pcie_qstats *
40295  ********************/
40296
40297
40298 /* hwrm_pcie_qstats_input (size:256b/32B) */
40299 struct hwrm_pcie_qstats_input {
40300         /* The HWRM command request type. */
40301         uint16_t        req_type;
40302         /*
40303          * The completion ring to send the completion event on. This should
40304          * be the NQ ID returned from the `nq_alloc` HWRM command.
40305          */
40306         uint16_t        cmpl_ring;
40307         /*
40308          * The sequence ID is used by the driver for tracking multiple
40309          * commands. This ID is treated as opaque data by the firmware and
40310          * the value is returned in the `hwrm_resp_hdr` upon completion.
40311          */
40312         uint16_t        seq_id;
40313         /*
40314          * The target ID of the command:
40315          * * 0x0-0xFFF8 - The function ID
40316          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40317          * * 0xFFFD - Reserved for user-space HWRM interface
40318          * * 0xFFFF - HWRM
40319          */
40320         uint16_t        target_id;
40321         /*
40322          * A physical address pointer pointing to a host buffer that the
40323          * command's response data will be written. This can be either a host
40324          * physical address (HPA) or a guest physical address (GPA) and must
40325          * point to a physically contiguous block of memory.
40326          */
40327         uint64_t        resp_addr;
40328         /*
40329          * The size of PCIe statistics block in bytes.
40330          * Firmware will DMA the PCIe statistics to
40331          * the host with this field size in the response.
40332          */
40333         uint16_t        pcie_stat_size;
40334         uint8_t unused_0[6];
40335         /*
40336          * This is the host address where
40337          * PCIe statistics will be stored
40338          */
40339         uint64_t        pcie_stat_host_addr;
40340 } __rte_packed;
40341
40342 /* hwrm_pcie_qstats_output (size:128b/16B) */
40343 struct hwrm_pcie_qstats_output {
40344         /* The specific error status for the command. */
40345         uint16_t        error_code;
40346         /* The HWRM command request type. */
40347         uint16_t        req_type;
40348         /* The sequence ID from the original command. */
40349         uint16_t        seq_id;
40350         /* The length of the response data in number of bytes. */
40351         uint16_t        resp_len;
40352         /* The size of PCIe statistics block in bytes. */
40353         uint16_t        pcie_stat_size;
40354         uint8_t unused_0[5];
40355         /*
40356          * This field is used in Output records to indicate that the output
40357          * is completely written to RAM.  This field should be read as '1'
40358          * to indicate that the output has been completely written.
40359          * When writing a command completion or response to an internal processor,
40360          * the order of writes has to be such that this field is written last.
40361          */
40362         uint8_t valid;
40363 } __rte_packed;
40364
40365 /* PCIe Statistics Formats */
40366 /* pcie_ctx_hw_stats (size:768b/96B) */
40367 struct pcie_ctx_hw_stats {
40368         /* Number of physical layer receiver errors */
40369         uint64_t        pcie_pl_signal_integrity;
40370         /* Number of DLLP CRC errors detected by Data Link Layer */
40371         uint64_t        pcie_dl_signal_integrity;
40372         /*
40373          * Number of TLP LCRC and sequence number errors detected
40374          * by Data Link Layer
40375          */
40376         uint64_t        pcie_tl_signal_integrity;
40377         /* Number of times LTSSM entered Recovery state */
40378         uint64_t        pcie_link_integrity;
40379         /* Report number of TLP bits that have been transmitted in Mbps */
40380         uint64_t        pcie_tx_traffic_rate;
40381         /* Report number of TLP bits that have been received in Mbps */
40382         uint64_t        pcie_rx_traffic_rate;
40383         /* Number of DLLP bytes that have been transmitted */
40384         uint64_t        pcie_tx_dllp_statistics;
40385         /* Number of DLLP bytes that have been received */
40386         uint64_t        pcie_rx_dllp_statistics;
40387         /*
40388          * Number of times spent in each phase of gen3
40389          * equalization
40390          */
40391         uint64_t        pcie_equalization_time;
40392         /* Records the last 16 transitions of the LTSSM */
40393         uint32_t        pcie_ltssm_histogram[4];
40394         /*
40395          * Record the last 8 reasons on why LTSSM transitioned
40396          * to Recovery
40397          */
40398         uint64_t        pcie_recovery_histogram;
40399 } __rte_packed;
40400
40401 /**********************
40402  * hwrm_exec_fwd_resp *
40403  **********************/
40404
40405
40406 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
40407 struct hwrm_exec_fwd_resp_input {
40408         /* The HWRM command request type. */
40409         uint16_t        req_type;
40410         /*
40411          * The completion ring to send the completion event on. This should
40412          * be the NQ ID returned from the `nq_alloc` HWRM command.
40413          */
40414         uint16_t        cmpl_ring;
40415         /*
40416          * The sequence ID is used by the driver for tracking multiple
40417          * commands. This ID is treated as opaque data by the firmware and
40418          * the value is returned in the `hwrm_resp_hdr` upon completion.
40419          */
40420         uint16_t        seq_id;
40421         /*
40422          * The target ID of the command:
40423          * * 0x0-0xFFF8 - The function ID
40424          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40425          * * 0xFFFD - Reserved for user-space HWRM interface
40426          * * 0xFFFF - HWRM
40427          */
40428         uint16_t        target_id;
40429         /*
40430          * A physical address pointer pointing to a host buffer that the
40431          * command's response data will be written. This can be either a host
40432          * physical address (HPA) or a guest physical address (GPA) and must
40433          * point to a physically contiguous block of memory.
40434          */
40435         uint64_t        resp_addr;
40436         /*
40437          * This is an encapsulated request. This request should
40438          * be executed by the HWRM and the response should be
40439          * provided in the response buffer inside the encapsulated
40440          * request.
40441          */
40442         uint32_t        encap_request[26];
40443         /*
40444          * This value indicates the target id of the response to
40445          * the encapsulated request.
40446          * 0x0 - 0xFFF8 - Used for function ids
40447          * 0xFFF8 - 0xFFFE - Reserved for internal processors
40448          * 0xFFFF - HWRM
40449          */
40450         uint16_t        encap_resp_target_id;
40451         uint8_t unused_0[6];
40452 } __rte_packed;
40453
40454 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
40455 struct hwrm_exec_fwd_resp_output {
40456         /* The specific error status for the command. */
40457         uint16_t        error_code;
40458         /* The HWRM command request type. */
40459         uint16_t        req_type;
40460         /* The sequence ID from the original command. */
40461         uint16_t        seq_id;
40462         /* The length of the response data in number of bytes. */
40463         uint16_t        resp_len;
40464         uint8_t unused_0[7];
40465         /*
40466          * This field is used in Output records to indicate that the output
40467          * is completely written to RAM.  This field should be read as '1'
40468          * to indicate that the output has been completely written.
40469          * When writing a command completion or response to an internal processor,
40470          * the order of writes has to be such that this field is written last.
40471          */
40472         uint8_t valid;
40473 } __rte_packed;
40474
40475 /************************
40476  * hwrm_reject_fwd_resp *
40477  ************************/
40478
40479
40480 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
40481 struct hwrm_reject_fwd_resp_input {
40482         /* The HWRM command request type. */
40483         uint16_t        req_type;
40484         /*
40485          * The completion ring to send the completion event on. This should
40486          * be the NQ ID returned from the `nq_alloc` HWRM command.
40487          */
40488         uint16_t        cmpl_ring;
40489         /*
40490          * The sequence ID is used by the driver for tracking multiple
40491          * commands. This ID is treated as opaque data by the firmware and
40492          * the value is returned in the `hwrm_resp_hdr` upon completion.
40493          */
40494         uint16_t        seq_id;
40495         /*
40496          * The target ID of the command:
40497          * * 0x0-0xFFF8 - The function ID
40498          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40499          * * 0xFFFD - Reserved for user-space HWRM interface
40500          * * 0xFFFF - HWRM
40501          */
40502         uint16_t        target_id;
40503         /*
40504          * A physical address pointer pointing to a host buffer that the
40505          * command's response data will be written. This can be either a host
40506          * physical address (HPA) or a guest physical address (GPA) and must
40507          * point to a physically contiguous block of memory.
40508          */
40509         uint64_t        resp_addr;
40510         /*
40511          * This is an encapsulated request. This request should
40512          * be rejected by the HWRM and the error response should be
40513          * provided in the response buffer inside the encapsulated
40514          * request.
40515          */
40516         uint32_t        encap_request[26];
40517         /*
40518          * This value indicates the target id of the response to
40519          * the encapsulated request.
40520          * 0x0 - 0xFFF8 - Used for function ids
40521          * 0xFFF8 - 0xFFFE - Reserved for internal processors
40522          * 0xFFFF - HWRM
40523          */
40524         uint16_t        encap_resp_target_id;
40525         uint8_t unused_0[6];
40526 } __rte_packed;
40527
40528 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
40529 struct hwrm_reject_fwd_resp_output {
40530         /* The specific error status for the command. */
40531         uint16_t        error_code;
40532         /* The HWRM command request type. */
40533         uint16_t        req_type;
40534         /* The sequence ID from the original command. */
40535         uint16_t        seq_id;
40536         /* The length of the response data in number of bytes. */
40537         uint16_t        resp_len;
40538         uint8_t unused_0[7];
40539         /*
40540          * This field is used in Output records to indicate that the output
40541          * is completely written to RAM.  This field should be read as '1'
40542          * to indicate that the output has been completely written.
40543          * When writing a command completion or response to an internal processor,
40544          * the order of writes has to be such that this field is written last.
40545          */
40546         uint8_t valid;
40547 } __rte_packed;
40548
40549 /*****************
40550  * hwrm_fwd_resp *
40551  *****************/
40552
40553
40554 /* hwrm_fwd_resp_input (size:1024b/128B) */
40555 struct hwrm_fwd_resp_input {
40556         /* The HWRM command request type. */
40557         uint16_t        req_type;
40558         /*
40559          * The completion ring to send the completion event on. This should
40560          * be the NQ ID returned from the `nq_alloc` HWRM command.
40561          */
40562         uint16_t        cmpl_ring;
40563         /*
40564          * The sequence ID is used by the driver for tracking multiple
40565          * commands. This ID is treated as opaque data by the firmware and
40566          * the value is returned in the `hwrm_resp_hdr` upon completion.
40567          */
40568         uint16_t        seq_id;
40569         /*
40570          * The target ID of the command:
40571          * * 0x0-0xFFF8 - The function ID
40572          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40573          * * 0xFFFD - Reserved for user-space HWRM interface
40574          * * 0xFFFF - HWRM
40575          */
40576         uint16_t        target_id;
40577         /*
40578          * A physical address pointer pointing to a host buffer that the
40579          * command's response data will be written. This can be either a host
40580          * physical address (HPA) or a guest physical address (GPA) and must
40581          * point to a physically contiguous block of memory.
40582          */
40583         uint64_t        resp_addr;
40584         /*
40585          * This value indicates the target id of the encapsulated
40586          * response.
40587          * 0x0 - 0xFFF8 - Used for function ids
40588          * 0xFFF8 - 0xFFFE - Reserved for internal processors
40589          * 0xFFFF - HWRM
40590          */
40591         uint16_t        encap_resp_target_id;
40592         /*
40593          * This value indicates the completion ring the encapsulated
40594          * response will be optionally completed on.  If the value is
40595          * -1, then no CR completion shall be generated for the
40596          * encapsulated response. Any other value must be a
40597          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
40598          * is provided, then a CR completion shall be generated for
40599          * the encapsulated response.
40600          */
40601         uint16_t        encap_resp_cmpl_ring;
40602         /* This field indicates the length of encapsulated response. */
40603         uint16_t        encap_resp_len;
40604         uint8_t unused_0;
40605         uint8_t unused_1;
40606         /*
40607          * This is the host address where the encapsulated response
40608          * will be written.
40609          * This area must be 16B aligned and must be cleared to zero
40610          * before the original request is made.
40611          */
40612         uint64_t        encap_resp_addr;
40613         /* This is an encapsulated response. */
40614         uint32_t        encap_resp[24];
40615 } __rte_packed;
40616
40617 /* hwrm_fwd_resp_output (size:128b/16B) */
40618 struct hwrm_fwd_resp_output {
40619         /* The specific error status for the command. */
40620         uint16_t        error_code;
40621         /* The HWRM command request type. */
40622         uint16_t        req_type;
40623         /* The sequence ID from the original command. */
40624         uint16_t        seq_id;
40625         /* The length of the response data in number of bytes. */
40626         uint16_t        resp_len;
40627         uint8_t unused_0[7];
40628         /*
40629          * This field is used in Output records to indicate that the output
40630          * is completely written to RAM.  This field should be read as '1'
40631          * to indicate that the output has been completely written.
40632          * When writing a command completion or response to an internal processor,
40633          * the order of writes has to be such that this field is written last.
40634          */
40635         uint8_t valid;
40636 } __rte_packed;
40637
40638 /*****************************
40639  * hwrm_fwd_async_event_cmpl *
40640  *****************************/
40641
40642
40643 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
40644 struct hwrm_fwd_async_event_cmpl_input {
40645         /* The HWRM command request type. */
40646         uint16_t        req_type;
40647         /*
40648          * The completion ring to send the completion event on. This should
40649          * be the NQ ID returned from the `nq_alloc` HWRM command.
40650          */
40651         uint16_t        cmpl_ring;
40652         /*
40653          * The sequence ID is used by the driver for tracking multiple
40654          * commands. This ID is treated as opaque data by the firmware and
40655          * the value is returned in the `hwrm_resp_hdr` upon completion.
40656          */
40657         uint16_t        seq_id;
40658         /*
40659          * The target ID of the command:
40660          * * 0x0-0xFFF8 - The function ID
40661          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40662          * * 0xFFFD - Reserved for user-space HWRM interface
40663          * * 0xFFFF - HWRM
40664          */
40665         uint16_t        target_id;
40666         /*
40667          * A physical address pointer pointing to a host buffer that the
40668          * command's response data will be written. This can be either a host
40669          * physical address (HPA) or a guest physical address (GPA) and must
40670          * point to a physically contiguous block of memory.
40671          */
40672         uint64_t        resp_addr;
40673         /*
40674          * This value indicates the target id of the encapsulated
40675          * asynchronous event.
40676          * 0x0 - 0xFFF8 - Used for function ids
40677          * 0xFFF8 - 0xFFFE - Reserved for internal processors
40678          * 0xFFFF - Broadcast to all children VFs (only applicable when
40679          * a PF is the requester)
40680          */
40681         uint16_t        encap_async_event_target_id;
40682         uint8_t unused_0[6];
40683         /* This is an encapsulated asynchronous event completion. */
40684         uint32_t        encap_async_event_cmpl[4];
40685 } __rte_packed;
40686
40687 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
40688 struct hwrm_fwd_async_event_cmpl_output {
40689         /* The specific error status for the command. */
40690         uint16_t        error_code;
40691         /* The HWRM command request type. */
40692         uint16_t        req_type;
40693         /* The sequence ID from the original command. */
40694         uint16_t        seq_id;
40695         /* The length of the response data in number of bytes. */
40696         uint16_t        resp_len;
40697         uint8_t unused_0[7];
40698         /*
40699          * This field is used in Output records to indicate that the output
40700          * is completely written to RAM.  This field should be read as '1'
40701          * to indicate that the output has been completely written.
40702          * When writing a command completion or response to an internal processor,
40703          * the order of writes has to be such that this field is written last.
40704          */
40705         uint8_t valid;
40706 } __rte_packed;
40707
40708 /**************************
40709  * hwrm_nvm_raw_write_blk *
40710  **************************/
40711
40712
40713 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
40714 struct hwrm_nvm_raw_write_blk_input {
40715         /* The HWRM command request type. */
40716         uint16_t        req_type;
40717         /*
40718          * The completion ring to send the completion event on. This should
40719          * be the NQ ID returned from the `nq_alloc` HWRM command.
40720          */
40721         uint16_t        cmpl_ring;
40722         /*
40723          * The sequence ID is used by the driver for tracking multiple
40724          * commands. This ID is treated as opaque data by the firmware and
40725          * the value is returned in the `hwrm_resp_hdr` upon completion.
40726          */
40727         uint16_t        seq_id;
40728         /*
40729          * The target ID of the command:
40730          * * 0x0-0xFFF8 - The function ID
40731          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40732          * * 0xFFFD - Reserved for user-space HWRM interface
40733          * * 0xFFFF - HWRM
40734          */
40735         uint16_t        target_id;
40736         /*
40737          * A physical address pointer pointing to a host buffer that the
40738          * command's response data will be written. This can be either a host
40739          * physical address (HPA) or a guest physical address (GPA) and must
40740          * point to a physically contiguous block of memory.
40741          */
40742         uint64_t        resp_addr;
40743         /*
40744          * 64-bit Host Source Address.
40745          * This is the location of the source data to be written.
40746          */
40747         uint64_t        host_src_addr;
40748         /*
40749          * 32-bit Destination Address.
40750          * This is the NVRAM byte-offset where the source data will be written to.
40751          */
40752         uint32_t        dest_addr;
40753         /* Length of data to be written, in bytes. */
40754         uint32_t        len;
40755 } __rte_packed;
40756
40757 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
40758 struct hwrm_nvm_raw_write_blk_output {
40759         /* The specific error status for the command. */
40760         uint16_t        error_code;
40761         /* The HWRM command request type. */
40762         uint16_t        req_type;
40763         /* The sequence ID from the original command. */
40764         uint16_t        seq_id;
40765         /* The length of the response data in number of bytes. */
40766         uint16_t        resp_len;
40767         uint8_t unused_0[7];
40768         /*
40769          * This field is used in Output records to indicate that the output
40770          * is completely written to RAM.  This field should be read as '1'
40771          * to indicate that the output has been completely written.
40772          * When writing a command completion or response to an internal processor,
40773          * the order of writes has to be such that this field is written last.
40774          */
40775         uint8_t valid;
40776 } __rte_packed;
40777
40778 /*****************
40779  * hwrm_nvm_read *
40780  *****************/
40781
40782
40783 /* hwrm_nvm_read_input (size:320b/40B) */
40784 struct hwrm_nvm_read_input {
40785         /* The HWRM command request type. */
40786         uint16_t        req_type;
40787         /*
40788          * The completion ring to send the completion event on. This should
40789          * be the NQ ID returned from the `nq_alloc` HWRM command.
40790          */
40791         uint16_t        cmpl_ring;
40792         /*
40793          * The sequence ID is used by the driver for tracking multiple
40794          * commands. This ID is treated as opaque data by the firmware and
40795          * the value is returned in the `hwrm_resp_hdr` upon completion.
40796          */
40797         uint16_t        seq_id;
40798         /*
40799          * The target ID of the command:
40800          * * 0x0-0xFFF8 - The function ID
40801          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40802          * * 0xFFFD - Reserved for user-space HWRM interface
40803          * * 0xFFFF - HWRM
40804          */
40805         uint16_t        target_id;
40806         /*
40807          * A physical address pointer pointing to a host buffer that the
40808          * command's response data will be written. This can be either a host
40809          * physical address (HPA) or a guest physical address (GPA) and must
40810          * point to a physically contiguous block of memory.
40811          */
40812         uint64_t        resp_addr;
40813         /*
40814          * 64-bit Host Destination Address.
40815          * This is the host address where the data will be written to.
40816          */
40817         uint64_t        host_dest_addr;
40818         /* The 0-based index of the directory entry. */
40819         uint16_t        dir_idx;
40820         uint8_t unused_0[2];
40821         /* The NVRAM byte-offset to read from. */
40822         uint32_t        offset;
40823         /* The length of the data to be read, in bytes. */
40824         uint32_t        len;
40825         uint8_t unused_1[4];
40826 } __rte_packed;
40827
40828 /* hwrm_nvm_read_output (size:128b/16B) */
40829 struct hwrm_nvm_read_output {
40830         /* The specific error status for the command. */
40831         uint16_t        error_code;
40832         /* The HWRM command request type. */
40833         uint16_t        req_type;
40834         /* The sequence ID from the original command. */
40835         uint16_t        seq_id;
40836         /* The length of the response data in number of bytes. */
40837         uint16_t        resp_len;
40838         uint8_t unused_0[7];
40839         /*
40840          * This field is used in Output records to indicate that the output
40841          * is completely written to RAM.  This field should be read as '1'
40842          * to indicate that the output has been completely written.
40843          * When writing a command completion or response to an internal processor,
40844          * the order of writes has to be such that this field is written last.
40845          */
40846         uint8_t valid;
40847 } __rte_packed;
40848
40849 /*********************
40850  * hwrm_nvm_raw_dump *
40851  *********************/
40852
40853
40854 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
40855 struct hwrm_nvm_raw_dump_input {
40856         /* The HWRM command request type. */
40857         uint16_t        req_type;
40858         /*
40859          * The completion ring to send the completion event on. This should
40860          * be the NQ ID returned from the `nq_alloc` HWRM command.
40861          */
40862         uint16_t        cmpl_ring;
40863         /*
40864          * The sequence ID is used by the driver for tracking multiple
40865          * commands. This ID is treated as opaque data by the firmware and
40866          * the value is returned in the `hwrm_resp_hdr` upon completion.
40867          */
40868         uint16_t        seq_id;
40869         /*
40870          * The target ID of the command:
40871          * * 0x0-0xFFF8 - The function ID
40872          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40873          * * 0xFFFD - Reserved for user-space HWRM interface
40874          * * 0xFFFF - HWRM
40875          */
40876         uint16_t        target_id;
40877         /*
40878          * A physical address pointer pointing to a host buffer that the
40879          * command's response data will be written. This can be either a host
40880          * physical address (HPA) or a guest physical address (GPA) and must
40881          * point to a physically contiguous block of memory.
40882          */
40883         uint64_t        resp_addr;
40884         /*
40885          * 64-bit Host Destination Address.
40886          * This is the host address where the data will be written to.
40887          */
40888         uint64_t        host_dest_addr;
40889         /* 32-bit NVRAM byte-offset to read from. */
40890         uint32_t        offset;
40891         /* Total length of NVRAM contents to be read, in bytes. */
40892         uint32_t        len;
40893 } __rte_packed;
40894
40895 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
40896 struct hwrm_nvm_raw_dump_output {
40897         /* The specific error status for the command. */
40898         uint16_t        error_code;
40899         /* The HWRM command request type. */
40900         uint16_t        req_type;
40901         /* The sequence ID from the original command. */
40902         uint16_t        seq_id;
40903         /* The length of the response data in number of bytes. */
40904         uint16_t        resp_len;
40905         uint8_t unused_0[7];
40906         /*
40907          * This field is used in Output records to indicate that the output
40908          * is completely written to RAM.  This field should be read as '1'
40909          * to indicate that the output has been completely written.
40910          * When writing a command completion or response to an internal processor,
40911          * the order of writes has to be such that this field is written last.
40912          */
40913         uint8_t valid;
40914 } __rte_packed;
40915
40916 /****************************
40917  * hwrm_nvm_get_dir_entries *
40918  ****************************/
40919
40920
40921 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
40922 struct hwrm_nvm_get_dir_entries_input {
40923         /* The HWRM command request type. */
40924         uint16_t        req_type;
40925         /*
40926          * The completion ring to send the completion event on. This should
40927          * be the NQ ID returned from the `nq_alloc` HWRM command.
40928          */
40929         uint16_t        cmpl_ring;
40930         /*
40931          * The sequence ID is used by the driver for tracking multiple
40932          * commands. This ID is treated as opaque data by the firmware and
40933          * the value is returned in the `hwrm_resp_hdr` upon completion.
40934          */
40935         uint16_t        seq_id;
40936         /*
40937          * The target ID of the command:
40938          * * 0x0-0xFFF8 - The function ID
40939          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40940          * * 0xFFFD - Reserved for user-space HWRM interface
40941          * * 0xFFFF - HWRM
40942          */
40943         uint16_t        target_id;
40944         /*
40945          * A physical address pointer pointing to a host buffer that the
40946          * command's response data will be written. This can be either a host
40947          * physical address (HPA) or a guest physical address (GPA) and must
40948          * point to a physically contiguous block of memory.
40949          */
40950         uint64_t        resp_addr;
40951         /*
40952          * 64-bit Host Destination Address.
40953          * This is the host address where the directory will be written.
40954          */
40955         uint64_t        host_dest_addr;
40956 } __rte_packed;
40957
40958 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
40959 struct hwrm_nvm_get_dir_entries_output {
40960         /* The specific error status for the command. */
40961         uint16_t        error_code;
40962         /* The HWRM command request type. */
40963         uint16_t        req_type;
40964         /* The sequence ID from the original command. */
40965         uint16_t        seq_id;
40966         /* The length of the response data in number of bytes. */
40967         uint16_t        resp_len;
40968         uint8_t unused_0[7];
40969         /*
40970          * This field is used in Output records to indicate that the output
40971          * is completely written to RAM.  This field should be read as '1'
40972          * to indicate that the output has been completely written.
40973          * When writing a command completion or response to an internal processor,
40974          * the order of writes has to be such that this field is written last.
40975          */
40976         uint8_t valid;
40977 } __rte_packed;
40978
40979 /*************************
40980  * hwrm_nvm_get_dir_info *
40981  *************************/
40982
40983
40984 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
40985 struct hwrm_nvm_get_dir_info_input {
40986         /* The HWRM command request type. */
40987         uint16_t        req_type;
40988         /*
40989          * The completion ring to send the completion event on. This should
40990          * be the NQ ID returned from the `nq_alloc` HWRM command.
40991          */
40992         uint16_t        cmpl_ring;
40993         /*
40994          * The sequence ID is used by the driver for tracking multiple
40995          * commands. This ID is treated as opaque data by the firmware and
40996          * the value is returned in the `hwrm_resp_hdr` upon completion.
40997          */
40998         uint16_t        seq_id;
40999         /*
41000          * The target ID of the command:
41001          * * 0x0-0xFFF8 - The function ID
41002          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41003          * * 0xFFFD - Reserved for user-space HWRM interface
41004          * * 0xFFFF - HWRM
41005          */
41006         uint16_t        target_id;
41007         /*
41008          * A physical address pointer pointing to a host buffer that the
41009          * command's response data will be written. This can be either a host
41010          * physical address (HPA) or a guest physical address (GPA) and must
41011          * point to a physically contiguous block of memory.
41012          */
41013         uint64_t        resp_addr;
41014 } __rte_packed;
41015
41016 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
41017 struct hwrm_nvm_get_dir_info_output {
41018         /* The specific error status for the command. */
41019         uint16_t        error_code;
41020         /* The HWRM command request type. */
41021         uint16_t        req_type;
41022         /* The sequence ID from the original command. */
41023         uint16_t        seq_id;
41024         /* The length of the response data in number of bytes. */
41025         uint16_t        resp_len;
41026         /* Number of directory entries in the directory. */
41027         uint32_t        entries;
41028         /* Size of each directory entry, in bytes. */
41029         uint32_t        entry_length;
41030         uint8_t unused_0[7];
41031         /*
41032          * This field is used in Output records to indicate that the output
41033          * is completely written to RAM.  This field should be read as '1'
41034          * to indicate that the output has been completely written.
41035          * When writing a command completion or response to an internal processor,
41036          * the order of writes has to be such that this field is written last.
41037          */
41038         uint8_t valid;
41039 } __rte_packed;
41040
41041 /******************
41042  * hwrm_nvm_write *
41043  ******************/
41044
41045
41046 /* hwrm_nvm_write_input (size:384b/48B) */
41047 struct hwrm_nvm_write_input {
41048         /* The HWRM command request type. */
41049         uint16_t        req_type;
41050         /*
41051          * The completion ring to send the completion event on. This should
41052          * be the NQ ID returned from the `nq_alloc` HWRM command.
41053          */
41054         uint16_t        cmpl_ring;
41055         /*
41056          * The sequence ID is used by the driver for tracking multiple
41057          * commands. This ID is treated as opaque data by the firmware and
41058          * the value is returned in the `hwrm_resp_hdr` upon completion.
41059          */
41060         uint16_t        seq_id;
41061         /*
41062          * The target ID of the command:
41063          * * 0x0-0xFFF8 - The function ID
41064          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41065          * * 0xFFFD - Reserved for user-space HWRM interface
41066          * * 0xFFFF - HWRM
41067          */
41068         uint16_t        target_id;
41069         /*
41070          * A physical address pointer pointing to a host buffer that the
41071          * command's response data will be written. This can be either a host
41072          * physical address (HPA) or a guest physical address (GPA) and must
41073          * point to a physically contiguous block of memory.
41074          */
41075         uint64_t        resp_addr;
41076         /*
41077          * 64-bit Host Source Address.
41078          * This is where the source data is.
41079          */
41080         uint64_t        host_src_addr;
41081         /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
41082         uint16_t        dir_type;
41083         /*
41084          * Directory ordinal.
41085          * The 0-based instance of the combined Directory Entry Type and Extension.
41086          */
41087         uint16_t        dir_ordinal;
41088         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
41089         uint16_t        dir_ext;
41090         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
41091         uint16_t        dir_attr;
41092         /*
41093          * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
41094          * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
41095          */
41096         uint32_t        dir_data_length;
41097         /* Option. */
41098         uint16_t        option;
41099         uint16_t        flags;
41100         /*
41101          * When this bit is '1', the original active image
41102          * will not be removed. TBD: what purpose is this?
41103          */
41104         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
41105                 UINT32_C(0x1)
41106         /*
41107          * The requested length of the allocated NVM for the item, in bytes. This value may be greater than or equal to the specified data length (dir_data_length).
41108          * If this value is less than the specified data length, it will be ignored.
41109          * The response will contain the actual allocated item length, which may be greater than the requested item length.
41110          * The purpose for allocating more than the required number of bytes for an item's data is to pre-allocate extra storage (padding) to accommodate
41111          * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
41112          */
41113         uint32_t        dir_item_length;
41114         uint32_t        unused_0;
41115 } __rte_packed;
41116
41117 /* hwrm_nvm_write_output (size:128b/16B) */
41118 struct hwrm_nvm_write_output {
41119         /* The specific error status for the command. */
41120         uint16_t        error_code;
41121         /* The HWRM command request type. */
41122         uint16_t        req_type;
41123         /* The sequence ID from the original command. */
41124         uint16_t        seq_id;
41125         /* The length of the response data in number of bytes. */
41126         uint16_t        resp_len;
41127         /*
41128          * Length of the allocated NVM for the item, in bytes. The value may be greater than or equal to the specified data length or the requested item length.
41129          * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
41130          */
41131         uint32_t        dir_item_length;
41132         /* The directory index of the created or modified item. */
41133         uint16_t        dir_idx;
41134         uint8_t unused_0;
41135         /*
41136          * This field is used in Output records to indicate that the output
41137          * is completely written to RAM.  This field should be read as '1'
41138          * to indicate that the output has been completely written.
41139          * When writing a command completion or response to an internal processor,
41140          * the order of writes has to be such that this field is written last.
41141          */
41142         uint8_t valid;
41143 } __rte_packed;
41144
41145 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
41146 struct hwrm_nvm_write_cmd_err {
41147         /*
41148          * command specific error codes that goes to
41149          * the cmd_err field in Common HWRM Error Response.
41150          */
41151         uint8_t code;
41152         /* Unknown error */
41153         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
41154         /* Unable to complete operation due to fragmentation */
41155         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
41156         /* nvm is completely full. */
41157         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
41158         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
41159                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
41160         uint8_t unused_0[7];
41161 } __rte_packed;
41162
41163 /*******************
41164  * hwrm_nvm_modify *
41165  *******************/
41166
41167
41168 /* hwrm_nvm_modify_input (size:320b/40B) */
41169 struct hwrm_nvm_modify_input {
41170         /* The HWRM command request type. */
41171         uint16_t        req_type;
41172         /*
41173          * The completion ring to send the completion event on. This should
41174          * be the NQ ID returned from the `nq_alloc` HWRM command.
41175          */
41176         uint16_t        cmpl_ring;
41177         /*
41178          * The sequence ID is used by the driver for tracking multiple
41179          * commands. This ID is treated as opaque data by the firmware and
41180          * the value is returned in the `hwrm_resp_hdr` upon completion.
41181          */
41182         uint16_t        seq_id;
41183         /*
41184          * The target ID of the command:
41185          * * 0x0-0xFFF8 - The function ID
41186          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41187          * * 0xFFFD - Reserved for user-space HWRM interface
41188          * * 0xFFFF - HWRM
41189          */
41190         uint16_t        target_id;
41191         /*
41192          * A physical address pointer pointing to a host buffer that the
41193          * command's response data will be written. This can be either a host
41194          * physical address (HPA) or a guest physical address (GPA) and must
41195          * point to a physically contiguous block of memory.
41196          */
41197         uint64_t        resp_addr;
41198         /*
41199          * 64-bit Host Source Address.
41200          * This is where the modified data is.
41201          */
41202         uint64_t        host_src_addr;
41203         /* 16-bit directory entry index. */
41204         uint16_t        dir_idx;
41205         uint16_t        flags;
41206         /*
41207          * This flag indicates the sender wants to modify a continuous NVRAM
41208          * area using a batch of this HWRM requests. The offset of a request
41209          * must be continuous to the end of previous request's. Firmware does
41210          * not update the directory entry until receiving the last request,
41211          * which is indicated by the batch_last flag.
41212          * This flag is set usually when a sender does not have a block of
41213          * memory that is big enough to hold the entire NVRAM data for send
41214          * at one time.
41215          */
41216         #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_MODE     UINT32_C(0x1)
41217         /*
41218          * This flag can be used only when the batch_mode flag is set.
41219          * It indicates this request is the last of batch requests.
41220          */
41221         #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_LAST     UINT32_C(0x2)
41222         /* 32-bit NVRAM byte-offset to modify content from. */
41223         uint32_t        offset;
41224         /*
41225          * Length of data to be modified, in bytes. The length shall
41226          * be non-zero.
41227          */
41228         uint32_t        len;
41229         uint8_t unused_1[4];
41230 } __rte_packed;
41231
41232 /* hwrm_nvm_modify_output (size:128b/16B) */
41233 struct hwrm_nvm_modify_output {
41234         /* The specific error status for the command. */
41235         uint16_t        error_code;
41236         /* The HWRM command request type. */
41237         uint16_t        req_type;
41238         /* The sequence ID from the original command. */
41239         uint16_t        seq_id;
41240         /* The length of the response data in number of bytes. */
41241         uint16_t        resp_len;
41242         uint8_t unused_0[7];
41243         /*
41244          * This field is used in Output records to indicate that the output
41245          * is completely written to RAM.  This field should be read as '1'
41246          * to indicate that the output has been completely written.
41247          * When writing a command completion or response to an internal processor,
41248          * the order of writes has to be such that this field is written last.
41249          */
41250         uint8_t valid;
41251 } __rte_packed;
41252
41253 /***************************
41254  * hwrm_nvm_find_dir_entry *
41255  ***************************/
41256
41257
41258 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
41259 struct hwrm_nvm_find_dir_entry_input {
41260         /* The HWRM command request type. */
41261         uint16_t        req_type;
41262         /*
41263          * The completion ring to send the completion event on. This should
41264          * be the NQ ID returned from the `nq_alloc` HWRM command.
41265          */
41266         uint16_t        cmpl_ring;
41267         /*
41268          * The sequence ID is used by the driver for tracking multiple
41269          * commands. This ID is treated as opaque data by the firmware and
41270          * the value is returned in the `hwrm_resp_hdr` upon completion.
41271          */
41272         uint16_t        seq_id;
41273         /*
41274          * The target ID of the command:
41275          * * 0x0-0xFFF8 - The function ID
41276          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41277          * * 0xFFFD - Reserved for user-space HWRM interface
41278          * * 0xFFFF - HWRM
41279          */
41280         uint16_t        target_id;
41281         /*
41282          * A physical address pointer pointing to a host buffer that the
41283          * command's response data will be written. This can be either a host
41284          * physical address (HPA) or a guest physical address (GPA) and must
41285          * point to a physically contiguous block of memory.
41286          */
41287         uint64_t        resp_addr;
41288         uint32_t        enables;
41289         /*
41290          * This bit must be '1' for the dir_idx_valid field to be
41291          * configured.
41292          */
41293         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
41294                 UINT32_C(0x1)
41295         /* Directory Entry Index */
41296         uint16_t        dir_idx;
41297         /* Directory Entry (Image) Type */
41298         uint16_t        dir_type;
41299         /*
41300          * Directory ordinal.
41301          * The instance of this Directory Type
41302          */
41303         uint16_t        dir_ordinal;
41304         /* The Directory Entry Extension flags. */
41305         uint16_t        dir_ext;
41306         /* This value indicates the search option using dir_ordinal. */
41307         uint8_t opt_ordinal;
41308         /* This value indicates the search option using dir_ordinal. */
41309         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
41310         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
41311         /* Equal to specified ordinal value. */
41312         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
41313         /* Greater than or equal to specified ordinal value */
41314         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
41315         /* Greater than specified ordinal value */
41316         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
41317         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
41318                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
41319         uint8_t unused_0[3];
41320 } __rte_packed;
41321
41322 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
41323 struct hwrm_nvm_find_dir_entry_output {
41324         /* The specific error status for the command. */
41325         uint16_t        error_code;
41326         /* The HWRM command request type. */
41327         uint16_t        req_type;
41328         /* The sequence ID from the original command. */
41329         uint16_t        seq_id;
41330         /* The length of the response data in number of bytes. */
41331         uint16_t        resp_len;
41332         /* Allocated NVRAM for this directory entry, in bytes. */
41333         uint32_t        dir_item_length;
41334         /* Size of the stored data for this directory entry, in bytes. */
41335         uint32_t        dir_data_length;
41336         /*
41337          * Firmware version.
41338          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
41339          */
41340         uint32_t        fw_ver;
41341         /* Directory ordinal. */
41342         uint16_t        dir_ordinal;
41343         /* Directory Entry Index */
41344         uint16_t        dir_idx;
41345         uint8_t unused_0[7];
41346         /*
41347          * This field is used in Output records to indicate that the output
41348          * is completely written to RAM.  This field should be read as '1'
41349          * to indicate that the output has been completely written.
41350          * When writing a command completion or response to an internal processor,
41351          * the order of writes has to be such that this field is written last.
41352          */
41353         uint8_t valid;
41354 } __rte_packed;
41355
41356 /****************************
41357  * hwrm_nvm_erase_dir_entry *
41358  ****************************/
41359
41360
41361 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
41362 struct hwrm_nvm_erase_dir_entry_input {
41363         /* The HWRM command request type. */
41364         uint16_t        req_type;
41365         /*
41366          * The completion ring to send the completion event on. This should
41367          * be the NQ ID returned from the `nq_alloc` HWRM command.
41368          */
41369         uint16_t        cmpl_ring;
41370         /*
41371          * The sequence ID is used by the driver for tracking multiple
41372          * commands. This ID is treated as opaque data by the firmware and
41373          * the value is returned in the `hwrm_resp_hdr` upon completion.
41374          */
41375         uint16_t        seq_id;
41376         /*
41377          * The target ID of the command:
41378          * * 0x0-0xFFF8 - The function ID
41379          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41380          * * 0xFFFD - Reserved for user-space HWRM interface
41381          * * 0xFFFF - HWRM
41382          */
41383         uint16_t        target_id;
41384         /*
41385          * A physical address pointer pointing to a host buffer that the
41386          * command's response data will be written. This can be either a host
41387          * physical address (HPA) or a guest physical address (GPA) and must
41388          * point to a physically contiguous block of memory.
41389          */
41390         uint64_t        resp_addr;
41391         /* Directory Entry Index */
41392         uint16_t        dir_idx;
41393         uint8_t unused_0[6];
41394 } __rte_packed;
41395
41396 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
41397 struct hwrm_nvm_erase_dir_entry_output {
41398         /* The specific error status for the command. */
41399         uint16_t        error_code;
41400         /* The HWRM command request type. */
41401         uint16_t        req_type;
41402         /* The sequence ID from the original command. */
41403         uint16_t        seq_id;
41404         /* The length of the response data in number of bytes. */
41405         uint16_t        resp_len;
41406         uint8_t unused_0[7];
41407         /*
41408          * This field is used in Output records to indicate that the output
41409          * is completely written to RAM.  This field should be read as '1'
41410          * to indicate that the output has been completely written.
41411          * When writing a command completion or response to an internal processor,
41412          * the order of writes has to be such that this field is written last.
41413          */
41414         uint8_t valid;
41415 } __rte_packed;
41416
41417 /*************************
41418  * hwrm_nvm_get_dev_info *
41419  *************************/
41420
41421
41422 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
41423 struct hwrm_nvm_get_dev_info_input {
41424         /* The HWRM command request type. */
41425         uint16_t        req_type;
41426         /*
41427          * The completion ring to send the completion event on. This should
41428          * be the NQ ID returned from the `nq_alloc` HWRM command.
41429          */
41430         uint16_t        cmpl_ring;
41431         /*
41432          * The sequence ID is used by the driver for tracking multiple
41433          * commands. This ID is treated as opaque data by the firmware and
41434          * the value is returned in the `hwrm_resp_hdr` upon completion.
41435          */
41436         uint16_t        seq_id;
41437         /*
41438          * The target ID of the command:
41439          * * 0x0-0xFFF8 - The function ID
41440          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41441          * * 0xFFFD - Reserved for user-space HWRM interface
41442          * * 0xFFFF - HWRM
41443          */
41444         uint16_t        target_id;
41445         /*
41446          * A physical address pointer pointing to a host buffer that the
41447          * command's response data will be written. This can be either a host
41448          * physical address (HPA) or a guest physical address (GPA) and must
41449          * point to a physically contiguous block of memory.
41450          */
41451         uint64_t        resp_addr;
41452 } __rte_packed;
41453
41454 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */
41455 struct hwrm_nvm_get_dev_info_output {
41456         /* The specific error status for the command. */
41457         uint16_t        error_code;
41458         /* The HWRM command request type. */
41459         uint16_t        req_type;
41460         /* The sequence ID from the original command. */
41461         uint16_t        seq_id;
41462         /* The length of the response data in number of bytes. */
41463         uint16_t        resp_len;
41464         /* Manufacturer ID. */
41465         uint16_t        manufacturer_id;
41466         /* Device ID. */
41467         uint16_t        device_id;
41468         /* Sector size of the NVRAM device. */
41469         uint32_t        sector_size;
41470         /* Total size, in bytes of the NVRAM device. */
41471         uint32_t        nvram_size;
41472         uint32_t        reserved_size;
41473         /* Available size that can be used, in bytes.  Available size is the NVRAM size take away the used size and reserved size. */
41474         uint32_t        available_size;
41475         /* This field represents the major version of NVM cfg */
41476         uint8_t nvm_cfg_ver_maj;
41477         /* This field represents the minor version of NVM cfg */
41478         uint8_t nvm_cfg_ver_min;
41479         /* This field represents the update version of NVM cfg */
41480         uint8_t nvm_cfg_ver_upd;
41481         /*
41482          * This field is used in Output records to indicate that the output
41483          * is completely written to RAM.  This field should be read as '1'
41484          * to indicate that the output has been completely written.
41485          * When writing a command completion or response to an internal processor,
41486          * the order of writes has to be such that this field is written last.
41487          */
41488         uint8_t valid;
41489 } __rte_packed;
41490
41491 /**************************
41492  * hwrm_nvm_mod_dir_entry *
41493  **************************/
41494
41495
41496 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
41497 struct hwrm_nvm_mod_dir_entry_input {
41498         /* The HWRM command request type. */
41499         uint16_t        req_type;
41500         /*
41501          * The completion ring to send the completion event on. This should
41502          * be the NQ ID returned from the `nq_alloc` HWRM command.
41503          */
41504         uint16_t        cmpl_ring;
41505         /*
41506          * The sequence ID is used by the driver for tracking multiple
41507          * commands. This ID is treated as opaque data by the firmware and
41508          * the value is returned in the `hwrm_resp_hdr` upon completion.
41509          */
41510         uint16_t        seq_id;
41511         /*
41512          * The target ID of the command:
41513          * * 0x0-0xFFF8 - The function ID
41514          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41515          * * 0xFFFD - Reserved for user-space HWRM interface
41516          * * 0xFFFF - HWRM
41517          */
41518         uint16_t        target_id;
41519         /*
41520          * A physical address pointer pointing to a host buffer that the
41521          * command's response data will be written. This can be either a host
41522          * physical address (HPA) or a guest physical address (GPA) and must
41523          * point to a physically contiguous block of memory.
41524          */
41525         uint64_t        resp_addr;
41526         uint32_t        enables;
41527         /*
41528          * This bit must be '1' for the checksum field to be
41529          * configured.
41530          */
41531         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
41532         /* Directory Entry Index */
41533         uint16_t        dir_idx;
41534         /*
41535          * Directory ordinal.
41536          * The (0-based) instance of this Directory Type.
41537          */
41538         uint16_t        dir_ordinal;
41539         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */
41540         uint16_t        dir_ext;
41541         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
41542         uint16_t        dir_attr;
41543         /*
41544          * If valid, then this field updates the checksum
41545          * value of the content in the directory entry.
41546          */
41547         uint32_t        checksum;
41548 } __rte_packed;
41549
41550 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
41551 struct hwrm_nvm_mod_dir_entry_output {
41552         /* The specific error status for the command. */
41553         uint16_t        error_code;
41554         /* The HWRM command request type. */
41555         uint16_t        req_type;
41556         /* The sequence ID from the original command. */
41557         uint16_t        seq_id;
41558         /* The length of the response data in number of bytes. */
41559         uint16_t        resp_len;
41560         uint8_t unused_0[7];
41561         /*
41562          * This field is used in Output records to indicate that the output
41563          * is completely written to RAM.  This field should be read as '1'
41564          * to indicate that the output has been completely written.
41565          * When writing a command completion or response to an internal processor,
41566          * the order of writes has to be such that this field is written last.
41567          */
41568         uint8_t valid;
41569 } __rte_packed;
41570
41571 /**************************
41572  * hwrm_nvm_verify_update *
41573  **************************/
41574
41575
41576 /* hwrm_nvm_verify_update_input (size:192b/24B) */
41577 struct hwrm_nvm_verify_update_input {
41578         /* The HWRM command request type. */
41579         uint16_t        req_type;
41580         /*
41581          * The completion ring to send the completion event on. This should
41582          * be the NQ ID returned from the `nq_alloc` HWRM command.
41583          */
41584         uint16_t        cmpl_ring;
41585         /*
41586          * The sequence ID is used by the driver for tracking multiple
41587          * commands. This ID is treated as opaque data by the firmware and
41588          * the value is returned in the `hwrm_resp_hdr` upon completion.
41589          */
41590         uint16_t        seq_id;
41591         /*
41592          * The target ID of the command:
41593          * * 0x0-0xFFF8 - The function ID
41594          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41595          * * 0xFFFD - Reserved for user-space HWRM interface
41596          * * 0xFFFF - HWRM
41597          */
41598         uint16_t        target_id;
41599         /*
41600          * A physical address pointer pointing to a host buffer that the
41601          * command's response data will be written. This can be either a host
41602          * physical address (HPA) or a guest physical address (GPA) and must
41603          * point to a physically contiguous block of memory.
41604          */
41605         uint64_t        resp_addr;
41606         /* Directory Entry Type, to be verified. */
41607         uint16_t        dir_type;
41608         /*
41609          * Directory ordinal.
41610          * The instance of the Directory Type to be verified.
41611          */
41612         uint16_t        dir_ordinal;
41613         /*
41614          * The Directory Entry Extension flags.
41615          * The "UPDATE" extension flag must be set in this value.
41616          * A corresponding directory entry with the same type and ordinal values but *without*
41617          * the "UPDATE" extension flag must also exist. The other flags of the extension must
41618          * be identical between the active and update entries.
41619          */
41620         uint16_t        dir_ext;
41621         uint8_t unused_0[2];
41622 } __rte_packed;
41623
41624 /* hwrm_nvm_verify_update_output (size:128b/16B) */
41625 struct hwrm_nvm_verify_update_output {
41626         /* The specific error status for the command. */
41627         uint16_t        error_code;
41628         /* The HWRM command request type. */
41629         uint16_t        req_type;
41630         /* The sequence ID from the original command. */
41631         uint16_t        seq_id;
41632         /* The length of the response data in number of bytes. */
41633         uint16_t        resp_len;
41634         uint8_t unused_0[7];
41635         /*
41636          * This field is used in Output records to indicate that the output
41637          * is completely written to RAM.  This field should be read as '1'
41638          * to indicate that the output has been completely written.
41639          * When writing a command completion or response to an internal processor,
41640          * the order of writes has to be such that this field is written last.
41641          */
41642         uint8_t valid;
41643 } __rte_packed;
41644
41645 /***************************
41646  * hwrm_nvm_install_update *
41647  ***************************/
41648
41649
41650 /* hwrm_nvm_install_update_input (size:192b/24B) */
41651 struct hwrm_nvm_install_update_input {
41652         /* The HWRM command request type. */
41653         uint16_t        req_type;
41654         /*
41655          * The completion ring to send the completion event on. This should
41656          * be the NQ ID returned from the `nq_alloc` HWRM command.
41657          */
41658         uint16_t        cmpl_ring;
41659         /*
41660          * The sequence ID is used by the driver for tracking multiple
41661          * commands. This ID is treated as opaque data by the firmware and
41662          * the value is returned in the `hwrm_resp_hdr` upon completion.
41663          */
41664         uint16_t        seq_id;
41665         /*
41666          * The target ID of the command:
41667          * * 0x0-0xFFF8 - The function ID
41668          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41669          * * 0xFFFD - Reserved for user-space HWRM interface
41670          * * 0xFFFF - HWRM
41671          */
41672         uint16_t        target_id;
41673         /*
41674          * A physical address pointer pointing to a host buffer that the
41675          * command's response data will be written. This can be either a host
41676          * physical address (HPA) or a guest physical address (GPA) and must
41677          * point to a physically contiguous block of memory.
41678          */
41679         uint64_t        resp_addr;
41680         /*
41681          * Installation type. If the value 3 through 0xffff is used,
41682          * only packaged items with that type value will be installed and
41683          * conditional installation directives for those packaged items
41684          * will be over-ridden (i.e. 'create' or 'replace' will be treated
41685          * as 'install').
41686          */
41687         uint32_t        install_type;
41688         /*
41689          * Perform a normal package installation. Conditional installation
41690          * directives (e.g. 'create' and 'replace') of packaged items
41691          * will be followed.
41692          */
41693         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
41694         /*
41695          * Install all packaged items regardless of installation directive
41696          * (i.e. treat all packaged items as though they have an installation
41697          * directive of 'install').
41698          */
41699         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
41700                 UINT32_C(0xffffffff)
41701         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
41702                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
41703         uint16_t        flags;
41704         /* If set to 1, then securely erase all unused locations in persistent storage. */
41705         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
41706                 UINT32_C(0x1)
41707         /*
41708          * If set to 1, then unspecified images, images not in the package file, will be safely deleted.
41709          * When combined with erase_unused_space then unspecified images will be securely erased.
41710          */
41711         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
41712                 UINT32_C(0x2)
41713         /*
41714          * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
41715          * Allow additional time for this command to complete if this bit is set to 1.
41716          */
41717         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
41718                 UINT32_C(0x4)
41719         /*
41720          * If set to 1, FW will verify the package in the "UPDATE" NVM item
41721          * without installing it. This flag is for FW internal use only.
41722          * Users should not set this flag. The request will otherwise fail.
41723          */
41724         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_VERIFY_ONLY \
41725                 UINT32_C(0x8)
41726         uint8_t unused_0[2];
41727 } __rte_packed;
41728
41729 /* hwrm_nvm_install_update_output (size:192b/24B) */
41730 struct hwrm_nvm_install_update_output {
41731         /* The specific error status for the command. */
41732         uint16_t        error_code;
41733         /* The HWRM command request type. */
41734         uint16_t        req_type;
41735         /* The sequence ID from the original command. */
41736         uint16_t        seq_id;
41737         /* The length of the response data in number of bytes. */
41738         uint16_t        resp_len;
41739         /*
41740          * Bit-mask of successfully installed items.
41741          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
41742          * A value of 0 indicates that no items were successfully installed.
41743          */
41744         uint64_t        installed_items;
41745         /* result is 8 b */
41746         uint8_t result;
41747         /* There was no problem with the package installation. */
41748         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
41749         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
41750                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
41751         /* problem_item is 8 b */
41752         uint8_t problem_item;
41753         /* There was no problem with any packaged items. */
41754         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
41755                 UINT32_C(0x0)
41756         /* There was a problem with the NVM package itself. */
41757         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
41758                 UINT32_C(0xff)
41759         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
41760                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
41761         /* reset_required is 8 b */
41762         uint8_t reset_required;
41763         /*
41764          * No reset is required for installed/updated firmware or
41765          * microcode to take effect.
41766          */
41767         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
41768                 UINT32_C(0x0)
41769         /*
41770          * A PCIe reset (e.g. system reboot) is
41771          * required for newly installed/updated firmware or
41772          * microcode to take effect.
41773          */
41774         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
41775                 UINT32_C(0x1)
41776         /*
41777          * A controller power reset (e.g. system power-cycle) is
41778          * required for newly installed/updated firmware or
41779          * microcode to take effect. Some newly installed/updated
41780          * firmware or microcode may still take effect upon the
41781          * next PCIe reset.
41782          */
41783         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
41784                 UINT32_C(0x2)
41785         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
41786                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
41787         uint8_t unused_0[4];
41788         /*
41789          * This field is used in Output records to indicate that the output
41790          * is completely written to RAM.  This field should be read as '1'
41791          * to indicate that the output has been completely written.
41792          * When writing a command completion or response to an internal processor,
41793          * the order of writes has to be such that this field is written last.
41794          */
41795         uint8_t valid;
41796 } __rte_packed;
41797
41798 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
41799 struct hwrm_nvm_install_update_cmd_err {
41800         /*
41801          * command specific error codes that goes to
41802          * the cmd_err field in Common HWRM Error Response.
41803          */
41804         uint8_t code;
41805         /* Unknown error */
41806         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
41807         /* Unable to complete operation due to fragmentation */
41808         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
41809         /* nvm is completely full. */
41810         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
41811         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
41812                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
41813         uint8_t unused_0[7];
41814 } __rte_packed;
41815
41816 /******************
41817  * hwrm_nvm_flush *
41818  ******************/
41819
41820
41821 /* hwrm_nvm_flush_input (size:128b/16B) */
41822 struct hwrm_nvm_flush_input {
41823         /* The HWRM command request type. */
41824         uint16_t        req_type;
41825         /*
41826          * The completion ring to send the completion event on. This should
41827          * be the NQ ID returned from the `nq_alloc` HWRM command.
41828          */
41829         uint16_t        cmpl_ring;
41830         /*
41831          * The sequence ID is used by the driver for tracking multiple
41832          * commands. This ID is treated as opaque data by the firmware and
41833          * the value is returned in the `hwrm_resp_hdr` upon completion.
41834          */
41835         uint16_t        seq_id;
41836         /*
41837          * The target ID of the command:
41838          * * 0x0-0xFFF8 - The function ID
41839          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41840          * * 0xFFFD - Reserved for user-space HWRM interface
41841          * * 0xFFFF - HWRM
41842          */
41843         uint16_t        target_id;
41844         /*
41845          * A physical address pointer pointing to a host buffer that the
41846          * command's response data will be written. This can be either a host
41847          * physical address (HPA) or a guest physical address (GPA) and must
41848          * point to a physically contiguous block of memory.
41849          */
41850         uint64_t        resp_addr;
41851 } __rte_packed;
41852
41853 /* hwrm_nvm_flush_output (size:128b/16B) */
41854 struct hwrm_nvm_flush_output {
41855         /* The specific error status for the command. */
41856         uint16_t        error_code;
41857         /* The HWRM command request type. */
41858         uint16_t        req_type;
41859         /* The sequence ID from the original command. */
41860         uint16_t        seq_id;
41861         /* The length of the response data in number of bytes. */
41862         uint16_t        resp_len;
41863         uint8_t unused_0[7];
41864         /*
41865          * This field is used in Output records to indicate that the output
41866          * is completely written to RAM.  This field should be read as '1'
41867          * to indicate that the output has been completely written.
41868          * When writing a command completion or response to an internal processor,
41869          * the order of writes has to be such that this field is written last.
41870          */
41871         uint8_t valid;
41872 } __rte_packed;
41873
41874 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
41875 struct hwrm_nvm_flush_cmd_err {
41876         /*
41877          * command specific error codes that goes to
41878          * the cmd_err field in Common HWRM Error Response.
41879          */
41880         uint8_t code;
41881         /* Unknown error */
41882         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
41883         /* flush could not be performed */
41884         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
41885         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
41886                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
41887         uint8_t unused_0[7];
41888 } __rte_packed;
41889
41890 /*************************
41891  * hwrm_nvm_get_variable *
41892  *************************/
41893
41894
41895 /* hwrm_nvm_get_variable_input (size:320b/40B) */
41896 struct hwrm_nvm_get_variable_input {
41897         /* The HWRM command request type. */
41898         uint16_t        req_type;
41899         /*
41900          * The completion ring to send the completion event on. This should
41901          * be the NQ ID returned from the `nq_alloc` HWRM command.
41902          */
41903         uint16_t        cmpl_ring;
41904         /*
41905          * The sequence ID is used by the driver for tracking multiple
41906          * commands. This ID is treated as opaque data by the firmware and
41907          * the value is returned in the `hwrm_resp_hdr` upon completion.
41908          */
41909         uint16_t        seq_id;
41910         /*
41911          * The target ID of the command:
41912          * * 0x0-0xFFF8 - The function ID
41913          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41914          * * 0xFFFD - Reserved for user-space HWRM interface
41915          * * 0xFFFF - HWRM
41916          */
41917         uint16_t        target_id;
41918         /*
41919          * A physical address pointer pointing to a host buffer that the
41920          * command's response data will be written. This can be either a host
41921          * physical address (HPA) or a guest physical address (GPA) and must
41922          * point to a physically contiguous block of memory.
41923          */
41924         uint64_t        resp_addr;
41925         /*
41926          * This is the host address where
41927          * nvm variable will be stored
41928          */
41929         uint64_t        dest_data_addr;
41930         /* size of data in bits */
41931         uint16_t        data_len;
41932         /* nvm cfg option number */
41933         uint16_t        option_num;
41934         /* reserved. */
41935         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
41936         /* reserved. */
41937         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
41938                 UINT32_C(0xffff)
41939         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
41940                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
41941         /*
41942          * Number of dimensions for this nvm configuration variable.
41943          * This value indicates how many of the indexN values to use.
41944          * A value of 0 means that none of the indexN values are valid.
41945          * A value of 1 requires at index0 is valued, a value of 2
41946          * requires that index0 and index1 are valid, and so forth
41947          */
41948         uint16_t        dimensions;
41949         /* index for the 1st dimensions */
41950         uint16_t        index_0;
41951         /* index for the 2nd dimensions */
41952         uint16_t        index_1;
41953         /* index for the 3rd dimensions */
41954         uint16_t        index_2;
41955         /* index for the 4th dimensions */
41956         uint16_t        index_3;
41957         uint8_t flags;
41958         /*
41959          * When this bit is set to 1, the factory default value will be returned,
41960          * 0 returns the operational value.
41961          */
41962         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
41963                 UINT32_C(0x1)
41964         uint8_t unused_0;
41965 } __rte_packed;
41966
41967 /* hwrm_nvm_get_variable_output (size:128b/16B) */
41968 struct hwrm_nvm_get_variable_output {
41969         /* The specific error status for the command. */
41970         uint16_t        error_code;
41971         /* The HWRM command request type. */
41972         uint16_t        req_type;
41973         /* The sequence ID from the original command. */
41974         uint16_t        seq_id;
41975         /* The length of the response data in number of bytes. */
41976         uint16_t        resp_len;
41977         /* size of data of the actual variable retrieved in bits */
41978         uint16_t        data_len;
41979         /*
41980          * option_num is the option number for the data retrieved.  It is possible in the
41981          * future that the option number returned would be different than requested.  This
41982          * condition could occur if an option is deprecated and a new option id is defined
41983          * with similar characteristics, but has a slightly different definition.  This
41984          * also makes it convenient for the caller to identify the variable result with
41985          * the option id from the response.
41986          */
41987         uint16_t        option_num;
41988         /* reserved. */
41989         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
41990         /* reserved. */
41991         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
41992                 UINT32_C(0xffff)
41993         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
41994                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
41995         uint8_t unused_0[3];
41996         /*
41997          * This field is used in Output records to indicate that the output
41998          * is completely written to RAM.  This field should be read as '1'
41999          * to indicate that the output has been completely written.
42000          * When writing a command completion or response to an internal processor,
42001          * the order of writes has to be such that this field is written last.
42002          */
42003         uint8_t valid;
42004 } __rte_packed;
42005
42006 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
42007 struct hwrm_nvm_get_variable_cmd_err {
42008         /*
42009          * command specific error codes that goes to
42010          * the cmd_err field in Common HWRM Error Response.
42011          */
42012         uint8_t code;
42013         /* Unknown error */
42014         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
42015         /* variable does not exist */
42016         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
42017         /* configuration is corrupted and the variable cannot be saved */
42018         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
42019         /* length specified is too small */
42020         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
42021         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
42022                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
42023         uint8_t unused_0[7];
42024 } __rte_packed;
42025
42026 /*************************
42027  * hwrm_nvm_set_variable *
42028  *************************/
42029
42030
42031 /* hwrm_nvm_set_variable_input (size:320b/40B) */
42032 struct hwrm_nvm_set_variable_input {
42033         /* The HWRM command request type. */
42034         uint16_t        req_type;
42035         /*
42036          * The completion ring to send the completion event on. This should
42037          * be the NQ ID returned from the `nq_alloc` HWRM command.
42038          */
42039         uint16_t        cmpl_ring;
42040         /*
42041          * The sequence ID is used by the driver for tracking multiple
42042          * commands. This ID is treated as opaque data by the firmware and
42043          * the value is returned in the `hwrm_resp_hdr` upon completion.
42044          */
42045         uint16_t        seq_id;
42046         /*
42047          * The target ID of the command:
42048          * * 0x0-0xFFF8 - The function ID
42049          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42050          * * 0xFFFD - Reserved for user-space HWRM interface
42051          * * 0xFFFF - HWRM
42052          */
42053         uint16_t        target_id;
42054         /*
42055          * A physical address pointer pointing to a host buffer that the
42056          * command's response data will be written. This can be either a host
42057          * physical address (HPA) or a guest physical address (GPA) and must
42058          * point to a physically contiguous block of memory.
42059          */
42060         uint64_t        resp_addr;
42061         /*
42062          * This is the host address where
42063          * nvm variable will be copied from
42064          */
42065         uint64_t        src_data_addr;
42066         /* size of data in bits */
42067         uint16_t        data_len;
42068         /* nvm cfg option number */
42069         uint16_t        option_num;
42070         /* reserved. */
42071         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
42072         /* reserved. */
42073         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
42074                 UINT32_C(0xffff)
42075         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
42076                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
42077         /*
42078          * Number of dimensions for this nvm configuration variable.
42079          * This value indicates how many of the indexN values to use.
42080          * A value of 0 means that none of the indexN values are valid.
42081          * A value of 1 requires at index0 is valued, a value of 2
42082          * requires that index0 and index1 are valid, and so forth
42083          */
42084         uint16_t        dimensions;
42085         /* index for the 1st dimensions */
42086         uint16_t        index_0;
42087         /* index for the 2nd dimensions */
42088         uint16_t        index_1;
42089         /* index for the 3rd dimensions */
42090         uint16_t        index_2;
42091         /* index for the 4th dimensions */
42092         uint16_t        index_3;
42093         uint8_t flags;
42094         /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */
42095         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
42096                 UINT32_C(0x1)
42097         /* encryption method */
42098         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
42099                 UINT32_C(0xe)
42100         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
42101         /* No encryption. */
42102         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
42103                 (UINT32_C(0x0) << 1)
42104         /* one-way encryption. */
42105         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
42106                 (UINT32_C(0x1) << 1)
42107         /* symmetric AES256 encryption. */
42108         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
42109                 (UINT32_C(0x2) << 1)
42110         /* SHA1 digest appended to plaintext contents, for authentication */
42111         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
42112                 (UINT32_C(0x3) << 1)
42113         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
42114                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
42115         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK \
42116                 UINT32_C(0x70)
42117         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT         4
42118         /* When this bit is 1, update the factory default region */
42119         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
42120                 UINT32_C(0x80)
42121         uint8_t unused_0;
42122 } __rte_packed;
42123
42124 /* hwrm_nvm_set_variable_output (size:128b/16B) */
42125 struct hwrm_nvm_set_variable_output {
42126         /* The specific error status for the command. */
42127         uint16_t        error_code;
42128         /* The HWRM command request type. */
42129         uint16_t        req_type;
42130         /* The sequence ID from the original command. */
42131         uint16_t        seq_id;
42132         /* The length of the response data in number of bytes. */
42133         uint16_t        resp_len;
42134         uint8_t unused_0[7];
42135         /*
42136          * This field is used in Output records to indicate that the output
42137          * is completely written to RAM.  This field should be read as '1'
42138          * to indicate that the output has been completely written.
42139          * When writing a command completion or response to an internal processor,
42140          * the order of writes has to be such that this field is written last.
42141          */
42142         uint8_t valid;
42143 } __rte_packed;
42144
42145 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
42146 struct hwrm_nvm_set_variable_cmd_err {
42147         /*
42148          * command specific error codes that goes to
42149          * the cmd_err field in Common HWRM Error Response.
42150          */
42151         uint8_t code;
42152         /* Unknown error */
42153         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
42154         /* variable does not exist */
42155         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
42156         /* configuration is corrupted and the variable cannot be saved */
42157         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
42158         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
42159                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
42160         uint8_t unused_0[7];
42161 } __rte_packed;
42162
42163 /****************************
42164  * hwrm_nvm_validate_option *
42165  ****************************/
42166
42167
42168 /* hwrm_nvm_validate_option_input (size:320b/40B) */
42169 struct hwrm_nvm_validate_option_input {
42170         /* The HWRM command request type. */
42171         uint16_t        req_type;
42172         /*
42173          * The completion ring to send the completion event on. This should
42174          * be the NQ ID returned from the `nq_alloc` HWRM command.
42175          */
42176         uint16_t        cmpl_ring;
42177         /*
42178          * The sequence ID is used by the driver for tracking multiple
42179          * commands. This ID is treated as opaque data by the firmware and
42180          * the value is returned in the `hwrm_resp_hdr` upon completion.
42181          */
42182         uint16_t        seq_id;
42183         /*
42184          * The target ID of the command:
42185          * * 0x0-0xFFF8 - The function ID
42186          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42187          * * 0xFFFD - Reserved for user-space HWRM interface
42188          * * 0xFFFF - HWRM
42189          */
42190         uint16_t        target_id;
42191         /*
42192          * A physical address pointer pointing to a host buffer that the
42193          * command's response data will be written. This can be either a host
42194          * physical address (HPA) or a guest physical address (GPA) and must
42195          * point to a physically contiguous block of memory.
42196          */
42197         uint64_t        resp_addr;
42198         /*
42199          * This is the host address where
42200          * nvm variable will be copied from
42201          */
42202         uint64_t        src_data_addr;
42203         /* size of data in bits */
42204         uint16_t        data_len;
42205         /* nvm cfg option number */
42206         uint16_t        option_num;
42207         /* reserved. */
42208         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
42209                 UINT32_C(0x0)
42210         /* reserved. */
42211         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
42212                 UINT32_C(0xffff)
42213         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
42214                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
42215         /*
42216          * Number of dimensions for this nvm configuration variable.
42217          * This value indicates how many of the indexN values to use.
42218          * A value of 0 means that none of the indexN values are valid.
42219          * A value of 1 requires at index0 is valued, a value of 2
42220          * requires that index0 and index1 are valid, and so forth
42221          */
42222         uint16_t        dimensions;
42223         /* index for the 1st dimensions */
42224         uint16_t        index_0;
42225         /* index for the 2nd dimensions */
42226         uint16_t        index_1;
42227         /* index for the 3rd dimensions */
42228         uint16_t        index_2;
42229         /* index for the 4th dimensions */
42230         uint16_t        index_3;
42231         uint8_t unused_0[2];
42232 } __rte_packed;
42233
42234 /* hwrm_nvm_validate_option_output (size:128b/16B) */
42235 struct hwrm_nvm_validate_option_output {
42236         /* The specific error status for the command. */
42237         uint16_t        error_code;
42238         /* The HWRM command request type. */
42239         uint16_t        req_type;
42240         /* The sequence ID from the original command. */
42241         uint16_t        seq_id;
42242         /* The length of the response data in number of bytes. */
42243         uint16_t        resp_len;
42244         uint8_t result;
42245         /* indicates that the value provided for the option is not matching with the saved data. */
42246         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
42247         /* indicates that the value provided for the option is matching the saved data. */
42248         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
42249         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
42250                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
42251         uint8_t unused_0[6];
42252         /*
42253          * This field is used in Output records to indicate that the output
42254          * is completely written to RAM.  This field should be read as '1'
42255          * to indicate that the output has been completely written.
42256          * When writing a command completion or response to an internal processor,
42257          * the order of writes has to be such that this field is written last.
42258          */
42259         uint8_t valid;
42260 } __rte_packed;
42261
42262 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
42263 struct hwrm_nvm_validate_option_cmd_err {
42264         /*
42265          * command specific error codes that goes to
42266          * the cmd_err field in Common HWRM Error Response.
42267          */
42268         uint8_t code;
42269         /* Unknown error */
42270         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
42271         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
42272                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
42273         uint8_t unused_0[7];
42274 } __rte_packed;
42275
42276 /****************
42277  * hwrm_oem_cmd *
42278  ****************/
42279
42280
42281 /* hwrm_oem_cmd_input (size:1024b/128B) */
42282 struct hwrm_oem_cmd_input {
42283         /* The HWRM command request type. */
42284         uint16_t        req_type;
42285         /*
42286          * The completion ring to send the completion event on. This should
42287          * be the NQ ID returned from the `nq_alloc` HWRM command.
42288          */
42289         uint16_t        cmpl_ring;
42290         /*
42291          * The sequence ID is used by the driver for tracking multiple
42292          * commands. This ID is treated as opaque data by the firmware and
42293          * the value is returned in the `hwrm_resp_hdr` upon completion.
42294          */
42295         uint16_t        seq_id;
42296         /*
42297          * The target ID of the command:
42298          * * 0x0-0xFFF8 - The function ID
42299          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42300          * * 0xFFFD - Reserved for user-space HWRM interface
42301          * * 0xFFFF - HWRM
42302          */
42303         uint16_t        target_id;
42304         /*
42305          * A physical address pointer pointing to a host buffer that the
42306          * command's response data will be written. This can be either a host
42307          * physical address (HPA) or a guest physical address (GPA) and must
42308          * point to a physically contiguous block of memory.
42309          */
42310         uint64_t        resp_addr;
42311         uint32_t        IANA;
42312         uint32_t        unused_0;
42313         /* This field contains the vendor specific command data. */
42314         uint32_t        oem_data[26];
42315 } __rte_packed;
42316
42317 /* hwrm_oem_cmd_output (size:768b/96B) */
42318 struct hwrm_oem_cmd_output {
42319         /* The specific error status for the command. */
42320         uint16_t        error_code;
42321         /* The HWRM command request type. */
42322         uint16_t        req_type;
42323         /* The sequence ID from the original command. */
42324         uint16_t        seq_id;
42325         /* The length of the response data in number of bytes. */
42326         uint16_t        resp_len;
42327         uint32_t        IANA;
42328         uint32_t        unused_0;
42329         /* This field contains the vendor specific response data. */
42330         uint32_t        oem_data[18];
42331         uint8_t unused_1[7];
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 processor,
42337          * the order of writes has to be such that this field is written last.
42338          */
42339         uint8_t valid;
42340 } __rte_packed;
42341
42342 /*****************
42343  * hwrm_fw_reset *
42344  ******************/
42345
42346
42347 /* hwrm_fw_reset_input (size:192b/24B) */
42348 struct hwrm_fw_reset_input {
42349         /* The HWRM command request type. */
42350         uint16_t        req_type;
42351         /*
42352          * The completion ring to send the completion event on. This should
42353          * be the NQ ID returned from the `nq_alloc` HWRM command.
42354          */
42355         uint16_t        cmpl_ring;
42356         /*
42357          * The sequence ID is used by the driver for tracking multiple
42358          * commands. This ID is treated as opaque data by the firmware and
42359          * the value is returned in the `hwrm_resp_hdr` upon completion.
42360          */
42361         uint16_t        seq_id;
42362         /*
42363          * The target ID of the command:
42364          * * 0x0-0xFFF8 - The function ID
42365          * * 0xFFF8-0xFFFE - Reserved for internal processors
42366          * * 0xFFFF - HWRM
42367          */
42368         uint16_t        target_id;
42369         /*
42370          * A physical address pointer pointing to a host buffer that the
42371          * command's response data will be written. This can be either a host
42372          * physical address (HPA) or a guest physical address (GPA) and must
42373          * point to a physically contiguous block of memory.
42374          */
42375         uint64_t        resp_addr;
42376         /* Type of embedded processor. */
42377         uint8_t embedded_proc_type;
42378         /* Boot Processor */
42379         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT \
42380                 UINT32_C(0x0)
42381         /* Management Processor */
42382         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT \
42383                 UINT32_C(0x1)
42384         /* Network control processor */
42385         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL \
42386                 UINT32_C(0x2)
42387         /* RoCE control processor */
42388         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE \
42389                 UINT32_C(0x3)
42390         /*
42391          * Host (in multi-host environment): This is only valid if requester is IPC.
42392          * Reinit host hardware resources and PCIe.
42393          */
42394         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
42395                 UINT32_C(0x4)
42396         /* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
42397         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
42398                 UINT32_C(0x5)
42399         /* Reset all blocks of the chip (including all processors) */
42400         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP \
42401                 UINT32_C(0x6)
42402         /*
42403          * Host (in multi-host environment): This is only valid if requester is IPC.
42404          * Reinit host hardware resources.
42405          */
42406         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT \
42407                 UINT32_C(0x7)
42408         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST \
42409                 HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT
42410         /* Type of self reset. */
42411         uint8_t selfrst_status;
42412         /* No Self Reset */
42413         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE \
42414                 UINT32_C(0x0)
42415         /* Self Reset as soon as possible to do so safely */
42416         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP \
42417                 UINT32_C(0x1)
42418         /* Self Reset on PCIe Reset */
42419         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST \
42420                 UINT32_C(0x2)
42421         /* Self Reset immediately after notification to all clients. */
42422         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
42423                 UINT32_C(0x3)
42424         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST \
42425                 HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
42426         /*
42427          * Indicate which host is being reset. 0 means first host.
42428          * Only valid when embedded_proc_type is host in multihost
42429          * environment
42430          */
42431         uint8_t host_idx;
42432         uint8_t flags;
42433         /*
42434          * When this bit is '1', then the core firmware initiates
42435          * the reset only after graceful shut down of all registered instances.
42436          * If not, the device will continue with the existing firmware.
42437          */
42438         #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
42439         uint8_t unused_0[4];
42440 } __rte_packed;
42441
42442 /* hwrm_fw_reset_output (size:128b/16B) */
42443 struct hwrm_fw_reset_output {
42444         /* The specific error status for the command. */
42445         uint16_t        error_code;
42446         /* The HWRM command request type. */
42447         uint16_t        req_type;
42448         /* The sequence ID from the original command. */
42449         uint16_t        seq_id;
42450         /* The length of the response data in number of bytes. */
42451         uint16_t        resp_len;
42452         /* Type of self reset. */
42453         uint8_t selfrst_status;
42454         /* No Self Reset */
42455         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE \
42456                 UINT32_C(0x0)
42457         /* Self Reset as soon as possible to do so safely */
42458         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP \
42459                 UINT32_C(0x1)
42460         /* Self Reset on PCIe Reset */
42461         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST \
42462                 UINT32_C(0x2)
42463         /* Self Reset immediately after notification to all clients. */
42464         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
42465                 UINT32_C(0x3)
42466         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST \
42467                 HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
42468         uint8_t unused_0[6];
42469         /*
42470          * This field is used in Output records to indicate that the output
42471          * is completely written to RAM.  This field should be read as '1'
42472          * to indicate that the output has been completely written.
42473          * When writing a command completion or response to an internal processor,
42474          * the order of writes has to be such that this field is written last.
42475          */
42476         uint8_t valid;
42477 } __rte_packed;
42478
42479 /**********************
42480  * hwrm_port_ts_query *
42481  ***********************/
42482
42483
42484 /* hwrm_port_ts_query_input (size:192b/24B) */
42485 struct hwrm_port_ts_query_input {
42486         /* The HWRM command request type. */
42487         uint16_t        req_type;
42488         /*
42489          * The completion ring to send the completion event on. This should
42490          * be the NQ ID returned from the `nq_alloc` HWRM command.
42491          */
42492         uint16_t        cmpl_ring;
42493         /*
42494          * The sequence ID is used by the driver for tracking multiple
42495          * commands. This ID is treated as opaque data by the firmware and
42496          * the value is returned in the `hwrm_resp_hdr` upon completion.
42497          */
42498         uint16_t        seq_id;
42499         /*
42500          * The target ID of the command:
42501          * * 0x0-0xFFF8 - The function ID
42502          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42503          * * 0xFFFD - Reserved for user-space HWRM interface
42504          * * 0xFFFF - HWRM
42505          */
42506         uint16_t        target_id;
42507         /*
42508          * A physical address pointer pointing to a host buffer that the
42509          * command's response data will be written. This can be either a host
42510          * physical address (HPA) or a guest physical address (GPA) and must
42511          * point to a physically contiguous block of memory.
42512          */
42513         uint64_t        resp_addr;
42514         uint32_t        flags;
42515         /*
42516          * Enumeration denoting the RX, TX type of the resource.
42517          * This enumeration is used for resources that are similar for both
42518          * TX and RX paths of the chip.
42519          */
42520         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH             0x1UL
42521         /* tx path */
42522         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX          0x0UL
42523         /* rx path */
42524         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX          0x1UL
42525         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST        \
42526                 HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
42527         /*
42528          * If set, the response includes the current value of the free
42529          * running timer.
42530          */
42531         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_CURRENT_TIME     0x2UL
42532         /* Port ID of port that is being queried. */
42533         uint16_t        port_id;
42534         uint8_t         unused_0[2];
42535 } __rte_packed;
42536
42537 /* hwrm_port_ts_query_output (size:192b/24B) */
42538 struct hwrm_port_ts_query_output {
42539         /* The specific error status for the command. */
42540         uint16_t        error_code;
42541         /* The HWRM command request type. */
42542         uint16_t        req_type;
42543         /* The sequence ID from the original command. */
42544         uint16_t        seq_id;
42545         /* The length of the response data in number of bytes. */
42546         uint16_t        resp_len;
42547         /*
42548          * Timestamp value of PTP message captured, or current value of
42549          * free running timer.
42550          */
42551         uint32_t        ptp_msg_ts[2];
42552         /* Sequence ID of the PTP message captured. */
42553         uint16_t        ptp_msg_seqid;
42554         uint8_t         unused_0[5];
42555         /*
42556          * This field is used in Output records to indicate that the output
42557          * is completely written to RAM.  This field should be read as '1'
42558          * to indicate that the output has been completely written.
42559          * When writing a command completion or response to an internal processor,
42560          * the order of writes has to be such that this field is written last.
42561          */
42562         uint8_t         valid;
42563 } __rte_packed;
42564
42565 /*
42566  * This structure is fixed at the beginning of the ChiMP SRAM (GRC
42567  * offset: 0x31001F0). Host software is expected to read from this
42568  * location for a defined signature. If it exists, the software can
42569  * assume the presence of this structure and the validity of the
42570  * FW_STATUS location in the next field.
42571  */
42572 /* hcomm_status (size:64b/8B) */
42573 struct hcomm_status {
42574         uint32_t        sig_ver;
42575         /*
42576          * This field defines the version of the structure. The latest
42577          * version value is 1.
42578          */
42579         #define HCOMM_STATUS_VER_MASK           UINT32_C(0xff)
42580         #define HCOMM_STATUS_VER_SFT            0
42581         #define HCOMM_STATUS_VER_LATEST         UINT32_C(0x1)
42582         #define HCOMM_STATUS_VER_LAST           HCOMM_STATUS_VER_LATEST
42583         /*
42584          * This field is to store the signature value to indicate the
42585          * presence of the structure.
42586          */
42587         #define HCOMM_STATUS_SIGNATURE_MASK     UINT32_C(0xffffff00)
42588         #define HCOMM_STATUS_SIGNATURE_SFT      8
42589         #define HCOMM_STATUS_SIGNATURE_VAL      (UINT32_C(0x484353) << 8)
42590         #define HCOMM_STATUS_SIGNATURE_LAST     HCOMM_STATUS_SIGNATURE_VAL
42591         uint32_t        fw_status_loc;
42592         #define HCOMM_STATUS_TRUE_ADDR_SPACE_MASK       UINT32_C(0x3)
42593         #define HCOMM_STATUS_TRUE_ADDR_SPACE_SFT        0
42594         /* PCIE configuration space */
42595         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
42596         /* GRC space */
42597         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_GRC       UINT32_C(0x1)
42598         /* BAR0 space */
42599         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR0      UINT32_C(0x2)
42600         /* BAR1 space */
42601         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1      UINT32_C(0x3)
42602         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_LAST      \
42603                 HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1
42604         /*
42605          * This offset where the fw_status register is located. The value
42606          * is generally 4-byte aligned.
42607          */
42608         #define HCOMM_STATUS_TRUE_OFFSET_MASK           UINT32_C(0xfffffffc)
42609         #define HCOMM_STATUS_TRUE_OFFSET_SFT            2
42610 } __rte_packed;
42611 /* This is the GRC offset where the hcomm_status struct resides. */
42612 #define HCOMM_STATUS_STRUCT_LOC         0x31001F0UL
42613
42614 /**************************
42615  * hwrm_cfa_counter_qcaps *
42616  **************************/
42617
42618
42619 /* hwrm_cfa_counter_qcaps_input (size:128b/16B) */
42620 struct hwrm_cfa_counter_qcaps_input {
42621         /* The HWRM command request type. */
42622         uint16_t        req_type;
42623         /*
42624          * The completion ring to send the completion event on. This should
42625          * be the NQ ID returned from the `nq_alloc` HWRM command.
42626          */
42627         uint16_t        cmpl_ring;
42628         /*
42629          * The sequence ID is used by the driver for tracking multiple
42630          * commands. This ID is treated as opaque data by the firmware and
42631          * the value is returned in the `hwrm_resp_hdr` upon completion.
42632          */
42633         uint16_t        seq_id;
42634         /*
42635          * The target ID of the command:
42636          * * 0x0-0xFFF8 - The function ID
42637          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42638          * * 0xFFFD - Reserved for user-space HWRM interface
42639          * * 0xFFFF - HWRM
42640          */
42641         uint16_t        target_id;
42642         /*
42643          * A physical address pointer pointing to a host buffer that the
42644          * command's response data will be written. This can be either a host
42645          * physical address (HPA) or a guest physical address (GPA) and must
42646          * point to a physically contiguous block of memory.
42647          */
42648         uint64_t        resp_addr;
42649 } __rte_packed;
42650
42651 /* hwrm_cfa_counter_qcaps_output (size:576b/72B) */
42652 struct hwrm_cfa_counter_qcaps_output {
42653         /* The specific error status for the command. */
42654         uint16_t        error_code;
42655         /* The HWRM command request type. */
42656         uint16_t        req_type;
42657         /* The sequence ID from the original command. */
42658         uint16_t        seq_id;
42659         /* The length of the response data in number of bytes. */
42660         uint16_t        resp_len;
42661         uint32_t        flags;
42662         /* Enumeration denoting the supported CFA counter format. */
42663         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT \
42664                 UINT32_C(0x1)
42665         /* CFA counter types are not supported. */
42666         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_NONE \
42667                 UINT32_C(0x0)
42668         /* 64-bit packet counters followed by 64-bit byte counters format. */
42669         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT \
42670                 UINT32_C(0x1)
42671         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_LAST \
42672                 HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT
42673         uint32_t        unused_0;
42674         /* Minimum guaranteed number of flow counters supported for this function, in RX direction. */
42675         uint32_t        min_rx_fc;
42676         /* Maximum non-guaranteed number of flow counters supported for this function, in RX direction. */
42677         uint32_t        max_rx_fc;
42678         /* Minimum guaranteed number of flow counters supported for this function, in TX direction. */
42679         uint32_t        min_tx_fc;
42680         /* Maximum non-guaranteed number of flow counters supported for this function, in TX direction. */
42681         uint32_t        max_tx_fc;
42682         /* Minimum guaranteed number of extension flow counters supported for this function, in RX direction. */
42683         uint32_t        min_rx_efc;
42684         /* Maximum non-guaranteed number of extension flow counters supported for this function, in RX direction. */
42685         uint32_t        max_rx_efc;
42686         /* Minimum guaranteed number of extension flow counters supported for this function, in TX direction. */
42687         uint32_t        min_tx_efc;
42688         /* Maximum non-guaranteed number of extension flow counters supported for this function, in TX direction. */
42689         uint32_t        max_tx_efc;
42690         /* Minimum guaranteed number of meter drop counters supported for this function, in RX direction. */
42691         uint32_t        min_rx_mdc;
42692         /* Maximum non-guaranteed number of meter drop counters supported for this function, in RX direction. */
42693         uint32_t        max_rx_mdc;
42694         /* Minimum guaranteed number of meter drop counters supported for this function, in TX direction. */
42695         uint32_t        min_tx_mdc;
42696         /* Maximum non-guaranteed number of meter drop counters supported for this function, in TX direction. */
42697         uint32_t        max_tx_mdc;
42698         /* Maximum guaranteed number of flow counters which can be used during flow alloc. */
42699         uint32_t        max_flow_alloc_fc;
42700         uint8_t unused_1[3];
42701         /*
42702          * This field is used in Output records to indicate that the output
42703          * is completely written to RAM.  This field should be read as '1'
42704          * to indicate that the output has been completely written.
42705          * When writing a command completion or response to an internal processor,
42706          * the order of writes has to be such that this field is written last.
42707          */
42708         uint8_t valid;
42709 } __rte_packed;
42710
42711 /************************
42712  * hwrm_cfa_counter_cfg *
42713  ************************/
42714
42715
42716 /* hwrm_cfa_counter_cfg_input (size:256b/32B) */
42717 struct hwrm_cfa_counter_cfg_input {
42718         /* The HWRM command request type. */
42719         uint16_t        req_type;
42720         /*
42721          * The completion ring to send the completion event on. This should
42722          * be the NQ ID returned from the `nq_alloc` HWRM command.
42723          */
42724         uint16_t        cmpl_ring;
42725         /*
42726          * The sequence ID is used by the driver for tracking multiple
42727          * commands. This ID is treated as opaque data by the firmware and
42728          * the value is returned in the `hwrm_resp_hdr` upon completion.
42729          */
42730         uint16_t        seq_id;
42731         /*
42732          * The target ID of the command:
42733          * * 0x0-0xFFF8 - The function ID
42734          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42735          * * 0xFFFD - Reserved for user-space HWRM interface
42736          * * 0xFFFF - HWRM
42737          */
42738         uint16_t        target_id;
42739         /*
42740          * A physical address pointer pointing to a host buffer that the
42741          * command's response data will be written. This can be either a host
42742          * physical address (HPA) or a guest physical address (GPA) and must
42743          * point to a physically contiguous block of memory.
42744          */
42745         uint64_t        resp_addr;
42746         uint16_t        flags;
42747         /* Enumeration denoting the configuration mode. */
42748         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE \
42749                 UINT32_C(0x1)
42750         /* Disable the configuration mode. */
42751         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_DISABLE \
42752                 UINT32_C(0x0)
42753         /* Enable the configuration mode. */
42754         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE \
42755                 UINT32_C(0x1)
42756         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_LAST \
42757                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE
42758         /* Enumeration denoting the RX, TX type of the resource. */
42759         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH \
42760                 UINT32_C(0x2)
42761         /* Tx path. */
42762         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_TX \
42763                 (UINT32_C(0x0) << 1)
42764         /* Rx path. */
42765         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX \
42766                 (UINT32_C(0x1) << 1)
42767         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_LAST \
42768                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX
42769         /* Enumeration denoting the data transfer mode. */
42770         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK \
42771                 UINT32_C(0xc)
42772         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT       2
42773         /* Push mode. */
42774         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH \
42775                 (UINT32_C(0x0) << 2)
42776         /* Pull mode. */
42777         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL \
42778                 (UINT32_C(0x1) << 2)
42779         /* Pull on async update. */
42780         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC \
42781                 (UINT32_C(0x2) << 2)
42782         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST \
42783                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
42784         uint16_t        counter_type;
42785         /* Flow counters. */
42786         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_FC  UINT32_C(0x0)
42787         /* Extended flow counters. */
42788         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_EFC UINT32_C(0x1)
42789         /* Meter drop counters. */
42790         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC UINT32_C(0x2)
42791         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_LAST \
42792                 HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC
42793         /* Ctx memory handle to be used for the counter. */
42794         uint16_t        ctx_id;
42795         /* Counter update cadence hint (only in Push mode). */
42796         uint16_t        update_tmr_ms;
42797         /* Total number of entries. */
42798         uint32_t        num_entries;
42799         uint32_t        unused_0;
42800 } __rte_packed;
42801
42802 /* hwrm_cfa_counter_cfg_output (size:128b/16B) */
42803 struct hwrm_cfa_counter_cfg_output {
42804         /* The specific error status for the command. */
42805         uint16_t        error_code;
42806         /* The HWRM command request type. */
42807         uint16_t        req_type;
42808         /* The sequence ID from the original command. */
42809         uint16_t        seq_id;
42810         /* The length of the response data in number of bytes. */
42811         uint16_t        resp_len;
42812         uint8_t unused_0[7];
42813         /*
42814          * This field is used in Output records to indicate that the output
42815          * is completely written to RAM.  This field should be read as '1'
42816          * to indicate that the output has been completely written.
42817          * When writing a command completion or response to an internal processor,
42818          * the order of writes has to be such that this field is written last.
42819          */
42820         uint8_t valid;
42821 } __rte_packed;
42822
42823 /***************************
42824  * hwrm_cfa_counter_qstats *
42825  ***************************/
42826
42827
42828 /* hwrm_cfa_counter_qstats_input (size:320b/40B) */
42829 struct hwrm_cfa_counter_qstats_input {
42830         /* The HWRM command request type. */
42831         uint16_t        req_type;
42832         /*
42833          * The completion ring to send the completion event on. This should
42834          * be the NQ ID returned from the `nq_alloc` HWRM command.
42835          */
42836         uint16_t        cmpl_ring;
42837         /*
42838          * The sequence ID is used by the driver for tracking multiple
42839          * commands. This ID is treated as opaque data by the firmware and
42840          * the value is returned in the `hwrm_resp_hdr` upon completion.
42841          */
42842         uint16_t        seq_id;
42843         /*
42844          * The target ID of the command:
42845          * * 0x0-0xFFF8 - The function ID
42846          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42847          * * 0xFFFD - Reserved for user-space HWRM interface
42848          * * 0xFFFF - HWRM
42849          */
42850         uint16_t        target_id;
42851         /*
42852          * A physical address pointer pointing to a host buffer that the
42853          * command's response data will be written. This can be either a host
42854          * physical address (HPA) or a guest physical address (GPA) and must
42855          * point to a physically contiguous block of memory.
42856          */
42857         uint64_t        resp_addr;
42858         uint16_t        flags;
42859         /* Enumeration denoting the RX, TX type of the resource. */
42860         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH     UINT32_C(0x1)
42861         /* Tx path. */
42862         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
42863         /* Rx path. */
42864         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
42865         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_LAST \
42866                 HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX
42867         uint16_t        counter_type;
42868         uint16_t        input_flow_ctx_id;
42869         uint16_t        num_entries;
42870         uint16_t        delta_time_ms;
42871         uint16_t        meter_instance_id;
42872         uint16_t        mdc_ctx_id;
42873         uint8_t unused_0[2];
42874         uint64_t        expected_count;
42875 } __rte_packed;
42876
42877 /* hwrm_cfa_counter_qstats_output (size:128b/16B) */
42878 struct hwrm_cfa_counter_qstats_output {
42879         /* The specific error status for the command. */
42880         uint16_t        error_code;
42881         /* The HWRM command request type. */
42882         uint16_t        req_type;
42883         /* The sequence ID from the original command. */
42884         uint16_t        seq_id;
42885         /* The length of the response data in number of bytes. */
42886         uint16_t        resp_len;
42887         uint8_t unused_0[7];
42888         /*
42889          * This field is used in Output records to indicate that the output
42890          * is completely written to RAM.  This field should be read as '1'
42891          * to indicate that the output has been completely written.
42892          * When writing a command completion or response to an internal processor,
42893          * the order of writes has to be such that this field is written last.
42894          */
42895         uint8_t valid;
42896 } __rte_packed;
42897
42898 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */