1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2001-2018 Broadcom
6 #ifndef _HSI_STRUCT_DEF_DPDK_
7 #define _HSI_STRUCT_DEF_DPDK_
8 /* HSI and HWRM Specification 1.8.2 */
9 #define HWRM_VERSION_MAJOR 1
10 #define HWRM_VERSION_MINOR 8
11 #define HWRM_VERSION_UPDATE 2
13 #define HWRM_VERSION_RSVD 0 /* non-zero means beta version */
15 #define HWRM_VERSION_STR "1.8.2.0"
17 * Following is the signature for HWRM message field that indicates not
18 * applicable (All F's). Need to cast it the size of the field if needed.
20 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
21 #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
22 #define HWRM_MAX_RESP_LEN (280) /* hwrm_selftest_qlist */
23 #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
24 #define HW_HASH_KEY_SIZE 40
25 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
26 #define HWRM_ROCE_SP_HSI_VERSION_MAJOR 1
27 #define HWRM_ROCE_SP_HSI_VERSION_MINOR 8
28 #define HWRM_ROCE_SP_HSI_VERSION_UPDATE 2
33 #define HWRM_VER_GET (UINT32_C(0x0))
34 #define HWRM_FUNC_BUF_UNRGTR (UINT32_C(0xe))
35 #define HWRM_FUNC_VF_CFG (UINT32_C(0xf))
36 /* Reserved for future use */
37 #define RESERVED1 (UINT32_C(0x10))
38 #define HWRM_FUNC_RESET (UINT32_C(0x11))
39 #define HWRM_FUNC_GETFID (UINT32_C(0x12))
40 #define HWRM_FUNC_VF_ALLOC (UINT32_C(0x13))
41 #define HWRM_FUNC_VF_FREE (UINT32_C(0x14))
42 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
43 #define HWRM_FUNC_QCFG (UINT32_C(0x16))
44 #define HWRM_FUNC_CFG (UINT32_C(0x17))
45 #define HWRM_FUNC_QSTATS (UINT32_C(0x18))
46 #define HWRM_FUNC_CLR_STATS (UINT32_C(0x19))
47 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
48 #define HWRM_FUNC_VF_RESC_FREE (UINT32_C(0x1b))
49 #define HWRM_FUNC_VF_VNIC_IDS_QUERY (UINT32_C(0x1c))
50 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
51 #define HWRM_FUNC_DRV_QVER (UINT32_C(0x1e))
52 #define HWRM_FUNC_BUF_RGTR (UINT32_C(0x1f))
53 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
54 #define HWRM_PORT_MAC_CFG (UINT32_C(0x21))
55 #define HWRM_PORT_QSTATS (UINT32_C(0x23))
56 #define HWRM_PORT_LPBK_QSTATS (UINT32_C(0x24))
57 #define HWRM_PORT_CLR_STATS (UINT32_C(0x25))
58 #define HWRM_PORT_PHY_QCFG (UINT32_C(0x27))
59 #define HWRM_PORT_MAC_QCFG (UINT32_C(0x28))
60 #define HWRM_PORT_MAC_PTP_QCFG (UINT32_C(0x29))
61 #define HWRM_PORT_PHY_QCAPS (UINT32_C(0x2a))
62 #define HWRM_PORT_LED_CFG (UINT32_C(0x2d))
63 #define HWRM_PORT_LED_QCFG (UINT32_C(0x2e))
64 #define HWRM_PORT_LED_QCAPS (UINT32_C(0x2f))
65 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
66 #define HWRM_QUEUE_QCFG (UINT32_C(0x31))
67 #define HWRM_QUEUE_CFG (UINT32_C(0x32))
68 #define HWRM_FUNC_VLAN_CFG (UINT32_C(0x33))
69 #define HWRM_FUNC_VLAN_QCFG (UINT32_C(0x34))
70 #define HWRM_QUEUE_PFCENABLE_QCFG (UINT32_C(0x35))
71 #define HWRM_QUEUE_PFCENABLE_CFG (UINT32_C(0x36))
72 #define HWRM_QUEUE_PRI2COS_QCFG (UINT32_C(0x37))
73 #define HWRM_QUEUE_PRI2COS_CFG (UINT32_C(0x38))
74 #define HWRM_QUEUE_COS2BW_QCFG (UINT32_C(0x39))
75 #define HWRM_QUEUE_COS2BW_CFG (UINT32_C(0x3a))
76 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
77 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
78 #define HWRM_VNIC_FREE (UINT32_C(0x41))
79 #define HWRM_VNIC_CFG (UINT32_C(0x42))
80 #define HWRM_VNIC_QCFG (UINT32_C(0x43))
81 #define HWRM_VNIC_TPA_CFG (UINT32_C(0x44))
82 #define HWRM_VNIC_RSS_CFG (UINT32_C(0x46))
83 #define HWRM_VNIC_RSS_QCFG (UINT32_C(0x47))
84 #define HWRM_VNIC_PLCMODES_CFG (UINT32_C(0x48))
85 #define HWRM_VNIC_PLCMODES_QCFG (UINT32_C(0x49))
86 #define HWRM_VNIC_QCAPS (UINT32_C(0x4a))
87 #define HWRM_RING_ALLOC (UINT32_C(0x50))
88 #define HWRM_RING_FREE (UINT32_C(0x51))
89 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS (UINT32_C(0x52))
90 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS (UINT32_C(0x53))
91 #define HWRM_RING_RESET (UINT32_C(0x5e))
92 #define HWRM_RING_GRP_ALLOC (UINT32_C(0x60))
93 #define HWRM_RING_GRP_FREE (UINT32_C(0x61))
94 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (UINT32_C(0x70))
95 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE (UINT32_C(0x71))
96 #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
97 #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
98 #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
99 #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
100 /* Reserved for future use */
101 #define HWRM_CFA_VLAN_ANTISPOOF_CFG (UINT32_C(0x94))
102 #define HWRM_CFA_TUNNEL_FILTER_ALLOC (UINT32_C(0x95))
103 #define HWRM_CFA_TUNNEL_FILTER_FREE (UINT32_C(0x96))
104 #define HWRM_CFA_NTUPLE_FILTER_ALLOC (UINT32_C(0x99))
105 #define HWRM_CFA_NTUPLE_FILTER_FREE (UINT32_C(0x9a))
106 #define HWRM_CFA_NTUPLE_FILTER_CFG (UINT32_C(0x9b))
107 #define HWRM_CFA_EM_FLOW_ALLOC (UINT32_C(0x9c))
108 #define HWRM_CFA_EM_FLOW_FREE (UINT32_C(0x9d))
109 #define HWRM_CFA_EM_FLOW_CFG (UINT32_C(0x9e))
110 #define HWRM_TUNNEL_DST_PORT_QUERY (UINT32_C(0xa0))
111 #define HWRM_TUNNEL_DST_PORT_ALLOC (UINT32_C(0xa1))
112 #define HWRM_TUNNEL_DST_PORT_FREE (UINT32_C(0xa2))
113 #define HWRM_STAT_CTX_ALLOC (UINT32_C(0xb0))
114 #define HWRM_STAT_CTX_FREE (UINT32_C(0xb1))
115 #define HWRM_STAT_CTX_QUERY (UINT32_C(0xb2))
116 #define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3))
117 #define HWRM_FW_RESET (UINT32_C(0xc0))
118 #define HWRM_FW_QSTATUS (UINT32_C(0xc1))
119 #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
120 #define HWRM_REJECT_FWD_RESP (UINT32_C(0xd1))
121 #define HWRM_FWD_RESP (UINT32_C(0xd2))
122 #define HWRM_FWD_ASYNC_EVENT_CMPL (UINT32_C(0xd3))
123 #define HWRM_TEMP_MONITOR_QUERY (UINT32_C(0xe0))
124 #define HWRM_WOL_FILTER_ALLOC (UINT32_C(0xf0))
125 #define HWRM_WOL_FILTER_FREE (UINT32_C(0xf1))
126 #define HWRM_WOL_FILTER_QCFG (UINT32_C(0xf2))
127 #define HWRM_WOL_REASON_QCFG (UINT32_C(0xf3))
128 #define HWRM_DBG_DUMP (UINT32_C(0xff14))
129 #define HWRM_NVM_VALIDATE_OPTION (UINT32_C(0xffef))
130 #define HWRM_NVM_FLUSH (UINT32_C(0xfff0))
131 #define HWRM_NVM_GET_VARIABLE (UINT32_C(0xfff1))
132 #define HWRM_NVM_SET_VARIABLE (UINT32_C(0xfff2))
133 #define HWRM_NVM_INSTALL_UPDATE (UINT32_C(0xfff3))
134 #define HWRM_NVM_MODIFY (UINT32_C(0xfff4))
135 #define HWRM_NVM_VERIFY_UPDATE (UINT32_C(0xfff5))
136 #define HWRM_NVM_GET_DEV_INFO (UINT32_C(0xfff6))
137 #define HWRM_NVM_ERASE_DIR_ENTRY (UINT32_C(0xfff7))
138 #define HWRM_NVM_MOD_DIR_ENTRY (UINT32_C(0xfff8))
139 #define HWRM_NVM_FIND_DIR_ENTRY (UINT32_C(0xfff9))
140 #define HWRM_NVM_GET_DIR_ENTRIES (UINT32_C(0xfffa))
141 #define HWRM_NVM_GET_DIR_INFO (UINT32_C(0xfffb))
142 #define HWRM_NVM_RAW_DUMP (UINT32_C(0xfffc))
143 #define HWRM_NVM_READ (UINT32_C(0xfffd))
144 #define HWRM_NVM_WRITE (UINT32_C(0xfffe))
145 #define HWRM_NVM_RAW_WRITE_BLK (UINT32_C(0xffff))
148 * Note: The Host Software Interface (HSI) and Hardware Resource Manager (HWRM)
149 * specification describes the data structures used in Ethernet packet or RDMA
150 * message data transfers as well as an abstract interface for managing Ethernet
151 * NIC hardware resources.
153 /* Ethernet Data path Host Structures */
155 * Description: The following three sections document the host structures used
156 * between device and software drivers for communicating Ethernet packets.
158 /* BD Ring Structures */
160 * Description: This structure is used to inform the NIC of a location for and
161 * an aggregation buffer that will be used for packet data that is received. An
162 * aggregation buffer creates a different kind of completion operation for a
163 * packet where a variable number of BDs may be used to place the packet in the
164 * host. RX Rings that have aggregation buffers are known as aggregation rings
165 * and must contain only aggregation buffers.
167 /* Short TX BD (16 bytes) */
171 * All bits in this field must be valid on the first BD of a
172 * packet. Only the packet_end bit must be valid for the
173 * remaining BDs of a packet.
175 /* This value identifies the type of buffer descriptor. */
176 #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f)
177 #define TX_BD_SHORT_TYPE_SFT 0
179 * Indicates that this BD is 16B long and is
180 * used for normal L2 packet transmission.
182 #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0)
184 * If set to 1, the packet ends with the data in the buffer
185 * pointed to by this descriptor. This flag must be valid on
188 #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40)
190 * If set to 1, the device will not generate a completion for
191 * this transmit packet unless there is an error in it's
192 * processing. If this bit is set to 0, then the packet will be
193 * completed normally. This bit must be valid only on the first
196 #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80)
198 * This value indicates how many 16B BD locations are consumed
199 * in the ring by this packet. A value of 1 indicates that this
200 * BD is the only BD (and that the it is a short BD). A value of
201 * 3 indicates either 3 short BDs or 1 long BD and one short BD
202 * in the packet. A value of 0 indicates that there are 32 BD
203 * locations in the packet (the maximum). This field is valid
204 * only on the first BD of a packet.
206 #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
207 #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8
209 * This value is a hint for the length of the entire packet. It
210 * is used by the chip to optimize internal processing. The
211 * packet will be dropped if the hint is too short. This field
212 * is valid only on the first BD of a packet.
214 #define TX_BD_SHORT_FLAGS_LHINT_MASK UINT32_C(0x6000)
215 #define TX_BD_SHORT_FLAGS_LHINT_SFT 13
216 /* indicates packet length < 512B */
217 #define TX_BD_SHORT_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
218 /* indicates 512 <= packet length < 1KB */
219 #define TX_BD_SHORT_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
220 /* indicates 1KB <= packet length < 2KB */
221 #define TX_BD_SHORT_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
222 /* indicates packet length >= 2KB */
223 #define TX_BD_SHORT_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
224 #define TX_BD_SHORT_FLAGS_LHINT_LAST \
225 TX_BD_SHORT_FLAGS_LHINT_GTE2K
227 * If set to 1, the device immediately updates the Send Consumer
228 * Index after the buffer associated with this descriptor has
229 * been transferred via DMA to NIC memory from host memory. An
230 * interrupt may or may not be generated according to the state
231 * of the interrupt avoidance mechanisms. If this bit is set to
232 * 0, then the Consumer Index is only updated as soon as one of
233 * the host interrupt coalescing conditions has been met. This
234 * bit must be valid on the first BD of a packet.
236 #define TX_BD_SHORT_FLAGS_COAL_NOW UINT32_C(0x8000)
238 * All bits in this field must be valid on the first BD of a
239 * packet. Only the packet_end bit must be valid for the
240 * remaining BDs of a packet.
242 #define TX_BD_SHORT_FLAGS_MASK UINT32_C(0xffc0)
243 #define TX_BD_SHORT_FLAGS_SFT 6
246 * This is the length of the host physical buffer this BD
247 * describes in bytes. This field must be valid on all BDs of a
252 * The opaque data field is pass through to the completion and
253 * can be used for any data that the driver wants to associate
254 * with the transmit BD. This field must be valid on the first
259 * This is the host physical address for the portion of the
260 * packet described by this TX BD. This value must be valid on
261 * all BDs of a packet.
263 } __attribute__((packed));
265 /* Long TX BD (32 bytes split to 2 16-byte struct) */
269 * All bits in this field must be valid on the first BD of a
270 * packet. Only the packet_end bit must be valid for the
271 * remaining BDs of a packet.
273 /* This value identifies the type of buffer descriptor. */
274 #define TX_BD_LONG_TYPE_MASK UINT32_C(0x3f)
275 #define TX_BD_LONG_TYPE_SFT 0
277 * Indicates that this BD is 32B long and is
278 * used for normal L2 packet transmission.
280 #define TX_BD_LONG_TYPE_TX_BD_LONG UINT32_C(0x10)
282 * If set to 1, the packet ends with the data in the buffer
283 * pointed to by this descriptor. This flag must be valid on
286 #define TX_BD_LONG_FLAGS_PACKET_END UINT32_C(0x40)
288 * If set to 1, the device will not generate a completion for
289 * this transmit packet unless there is an error in it's
290 * processing. If this bit is set to 0, then the packet will be
291 * completed normally. This bit must be valid only on the first
294 #define TX_BD_LONG_FLAGS_NO_CMPL UINT32_C(0x80)
296 * This value indicates how many 16B BD locations are consumed
297 * in the ring by this packet. A value of 1 indicates that this
298 * BD is the only BD (and that the it is a short BD). A value of
299 * 3 indicates either 3 short BDs or 1 long BD and one short BD
300 * in the packet. A value of 0 indicates that there are 32 BD
301 * locations in the packet (the maximum). This field is valid
302 * only on the first BD of a packet.
304 #define TX_BD_LONG_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
305 #define TX_BD_LONG_FLAGS_BD_CNT_SFT 8
307 * This value is a hint for the length of the entire packet. It
308 * is used by the chip to optimize internal processing. The
309 * packet will be dropped if the hint is too short. This field
310 * is valid only on the first BD of a packet.
312 #define TX_BD_LONG_FLAGS_LHINT_MASK UINT32_C(0x6000)
313 #define TX_BD_LONG_FLAGS_LHINT_SFT 13
314 /* indicates packet length < 512B */
315 #define TX_BD_LONG_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
316 /* indicates 512 <= packet length < 1KB */
317 #define TX_BD_LONG_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
318 /* indicates 1KB <= packet length < 2KB */
319 #define TX_BD_LONG_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
320 /* indicates packet length >= 2KB */
321 #define TX_BD_LONG_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
322 #define TX_BD_LONG_FLAGS_LHINT_LAST \
323 TX_BD_LONG_FLAGS_LHINT_GTE2K
325 * If set to 1, the device immediately updates the Send Consumer
326 * Index after the buffer associated with this descriptor has
327 * been transferred via DMA to NIC memory from host memory. An
328 * interrupt may or may not be generated according to the state
329 * of the interrupt avoidance mechanisms. If this bit is set to
330 * 0, then the Consumer Index is only updated as soon as one of
331 * the host interrupt coalescing conditions has been met. This
332 * bit must be valid on the first BD of a packet.
334 #define TX_BD_LONG_FLAGS_COAL_NOW UINT32_C(0x8000)
336 * All bits in this field must be valid on the first BD of a
337 * packet. Only the packet_end bit must be valid for the
338 * remaining BDs of a packet.
340 #define TX_BD_LONG_FLAGS_MASK UINT32_C(0xffc0)
341 #define TX_BD_LONG_FLAGS_SFT 6
344 * This is the length of the host physical buffer this BD
345 * describes in bytes. This field must be valid on all BDs of a
350 * The opaque data field is pass through to the completion and
351 * can be used for any data that the driver wants to associate
352 * with the transmit BD. This field must be valid on the first
357 * This is the host physical address for the portion of the
358 * packet described by this TX BD. This value must be valid on
359 * all BDs of a packet.
361 } __attribute__((packed));
363 /* last 16 bytes of Long TX BD */
364 struct tx_bd_long_hi {
367 * All bits in this field must be valid on the first BD of a
368 * packet. Their value on other BDs of the packet will be
372 * If set to 1, the controller replaces the TCP/UPD checksum
373 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
374 * checksum field of the encapsulated TCP/UDP packets with the
375 * hardware calculated TCP/UDP checksum for the packet
376 * associated with this descriptor. The flag is ignored if the
377 * LSO flag is set. This bit must be valid on the first BD of a
380 #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
382 * If set to 1, the controller replaces the IP checksum of the
383 * normal packets, or the inner IP checksum of the encapsulated
384 * packets with the hardware calculated IP checksum for the
385 * packet associated with this descriptor. This bit must be
386 * valid on the first BD of a packet.
388 #define TX_BD_LONG_LFLAGS_IP_CHKSUM UINT32_C(0x2)
390 * If set to 1, the controller will not append an Ethernet CRC
391 * to the end of the frame. This bit must be valid on the first
392 * BD of a packet. Packet must be 64B or longer when this flag
393 * is set. It is not useful to use this bit with any form of TX
394 * offload such as CSO or LSO. The intent is that the packet
395 * from the host already has a valid Ethernet CRC on the packet.
397 #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4)
399 * If set to 1, the device will record the time at which the
400 * packet was actually transmitted at the TX MAC. This bit must
401 * be valid on the first BD of a packet.
403 #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8)
405 * If set to 1, The controller replaces the tunnel IP checksum
406 * field with hardware calculated IP checksum for the IP header
407 * of the packet associated with this descriptor. For outer UDP
408 * checksum, global outer UDP checksum TE_NIC register needs to
409 * be enabled. If the global outer UDP checksum TE_NIC register
410 * bit is set, outer UDP checksum will be calculated for the
411 * following cases: 1. Packets with tcp_udp_chksum flag set to
412 * offload checksum for inner packet AND the inner packet is
413 * TCP/UDP. If the inner packet is ICMP for example (non-
414 * TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
415 * checksum will not be calculated. 2. Packets with lso flag set
416 * which implies inner TCP checksum calculation as part of LSO
419 #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
421 * If set to 1, the device will treat this packet with LSO(Large
422 * Send Offload) processing for both normal or encapsulated
423 * packets, which is a form of TCP segmentation. When this bit
424 * is 1, the hdr_size and mss fields must be valid. The driver
425 * doesn't need to set t_ip_chksum, ip_chksum, and
426 * tcp_udp_chksum flags since the controller will replace the
427 * appropriate checksum fields for segmented packets. When this
428 * bit is 1, the hdr_size and mss fields must be valid.
430 #define TX_BD_LONG_LFLAGS_LSO UINT32_C(0x20)
432 * If set to zero when LSO is '1', then the IPID will be treated
433 * as a 16b number and will be wrapped if it exceeds a value of
434 * 0xffff. If set to one when LSO is '1', then the IPID will be
435 * treated as a 15b number and will be wrapped if it exceeds a
438 #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40)
440 * If set to zero when LSO is '1', then the IPID of the tunnel
441 * IP header will not be modified during LSO operations. If set
442 * to one when LSO is '1', then the IPID of the tunnel IP header
443 * will be incremented for each subsequent segment of an LSO
444 * operation. The flag is ignored if the LSO packet is a normal
445 * (non-tunneled) TCP packet.
447 #define TX_BD_LONG_LFLAGS_T_IPID UINT32_C(0x80)
449 * If set to '1', then the RoCE ICRC will be appended to the
450 * packet. Packet must be a valid RoCE format packet.
452 #define TX_BD_LONG_LFLAGS_ROCE_CRC UINT32_C(0x100)
454 * If set to '1', then the FCoE CRC will be appended to the
455 * packet. Packet must be a valid FCoE format packet.
457 #define TX_BD_LONG_LFLAGS_FCOE_CRC UINT32_C(0x200)
460 * When LSO is '1', this field must contain the offset of the
461 * TCP payload from the beginning of the packet in as 16b words.
462 * In case of encapsulated/tunneling packet, this field contains
463 * the offset of the inner TCP payload from beginning of the
464 * packet as 16-bit words. This value must be valid on the first
467 #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
468 #define TX_BD_LONG_HDR_SIZE_SFT 0
471 * This is the MSS value that will be used to do the LSO
472 * processing. The value is the length in bytes of the TCP
473 * payload for each segment generated by the LSO operation. This
474 * value must be valid on the first BD of a packet.
476 #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
477 #define TX_BD_LONG_MSS_SFT 0
481 * This value selects a CFA action to perform on the packet. Set
482 * this value to zero if no CFA action is desired. This value
483 * must be valid on the first BD of a packet.
487 * This value is action meta-data that defines CFA edit
488 * operations that are done in addition to any action editing.
490 /* When key=1, This is the VLAN tag VID value. */
491 #define TX_BD_LONG_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
492 #define TX_BD_LONG_CFA_META_VLAN_VID_SFT 0
493 /* When key=1, This is the VLAN tag DE value. */
494 #define TX_BD_LONG_CFA_META_VLAN_DE UINT32_C(0x1000)
495 /* When key=1, This is the VLAN tag PRI value. */
496 #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
497 #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT 13
498 /* When key=1, This is the VLAN tag TPID select value. */
499 #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
500 #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT 16
502 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
504 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
506 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
508 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
510 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
511 /* Value programmed in CFA VLANTPID register. */
512 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
513 #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
514 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
515 /* When key=1, This is the VLAN tag TPID select value. */
516 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
517 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
519 * This field identifies the type of edit to be performed on the
520 * packet. This value must be valid on the first BD of a packet.
522 #define TX_BD_LONG_CFA_META_KEY_MASK UINT32_C(0xf0000000)
523 #define TX_BD_LONG_CFA_META_KEY_SFT 28
525 #define TX_BD_LONG_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
527 * - meta[17:16] - TPID select value (0 =
528 * 0x8100). - meta[15:12] - PRI/DE value. -
529 * meta[11:0] - VID value.
531 #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
532 #define TX_BD_LONG_CFA_META_KEY_LAST \
533 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
534 } __attribute__((packed));
536 /* RX Producer Packet BD (16 bytes) */
537 struct rx_prod_pkt_bd {
539 /* This value identifies the type of buffer descriptor. */
540 #define RX_PROD_PKT_BD_TYPE_MASK UINT32_C(0x3f)
541 #define RX_PROD_PKT_BD_TYPE_SFT 0
543 * Indicates that this BD is 16B long and is an
544 * RX Producer (ie. empty) buffer descriptor.
546 #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT UINT32_C(0x4)
548 * If set to 1, the packet will be placed at the address plus
549 * 2B. The 2 Bytes of padding will be written as zero.
552 * This is intended to be used when the host buffer is cache-
553 * line aligned to produce packets that are easy to parse in
554 * host memory while still allowing writes to be cache line
557 #define RX_PROD_PKT_BD_FLAGS_SOP_PAD UINT32_C(0x40)
559 * If set to 1, the packet write will be padded out to the
560 * nearest cache-line with zero value padding.
563 * If receive buffers start/end on cache-line boundaries, this
564 * feature will ensure that all data writes on the PCI bus
565 * start/end on cache line boundaries.
567 #define RX_PROD_PKT_BD_FLAGS_EOP_PAD UINT32_C(0x80)
569 * This value is the number of additional buffers in the ring
570 * that describe the buffer space to be consumed for the this
571 * packet. If the value is zero, then the packet must fit within
572 * the space described by this BD. If this value is 1 or more,
573 * it indicates how many additional "buffer" BDs are in the ring
574 * immediately following this BD to be used for the same network
575 * packet. Even if the packet to be placed does not need all the
576 * additional buffers, they will be consumed anyway.
578 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
579 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT 8
580 #define RX_PROD_PKT_BD_FLAGS_MASK UINT32_C(0xffc0)
581 #define RX_PROD_PKT_BD_FLAGS_SFT 6
584 * This is the length in Bytes of the host physical buffer where
585 * data for the packet may be placed in host memory.
588 * While this is a Byte resolution value, it is often
589 * advantageous to ensure that the buffers provided end on a
594 * The opaque data field is pass through to the completion and
595 * can be used for any data that the driver wants to associate
596 * with this receive buffer set.
600 * This is the host physical address where data for the packet
601 * may by placed in host memory.
604 * While this is a Byte resolution value, it is often
605 * advantageous to ensure that the buffers provide start on a
608 } __attribute__((packed));
610 /* Completion Ring Structures */
611 /* Note: This structure is used by the HWRM to communicate HWRM Error. */
612 /* Base Completion Record (16 bytes) */
617 * This field indicates the exact type of the completion. By
618 * convention, the LSB identifies the length of the record in
619 * 16B units. Even values indicate 16B records. Odd values
620 * indicate 32B records.
622 #define CMPL_BASE_TYPE_MASK UINT32_C(0x3f)
623 #define CMPL_BASE_TYPE_SFT 0
624 /* TX L2 completion: Completion of TX packet. Length = 16B */
625 #define CMPL_BASE_TYPE_TX_L2 UINT32_C(0x0)
627 * RX L2 completion: Completion of and L2 RX
628 * packet. Length = 32B
630 #define CMPL_BASE_TYPE_RX_L2 UINT32_C(0x11)
632 * RX Aggregation Buffer completion : Completion
633 * of an L2 aggregation buffer in support of
634 * TPA, HDS, or Jumbo packet completion. Length
637 #define CMPL_BASE_TYPE_RX_AGG UINT32_C(0x12)
639 * RX L2 TPA Start Completion: Completion at the
640 * beginning of a TPA operation. Length = 32B
642 #define CMPL_BASE_TYPE_RX_TPA_START UINT32_C(0x13)
644 * RX L2 TPA End Completion: Completion at the
645 * end of a TPA operation. Length = 32B
647 #define CMPL_BASE_TYPE_RX_TPA_END UINT32_C(0x15)
649 * Statistics Ejection Completion: Completion of
650 * statistics data ejection buffer. Length = 16B
652 #define CMPL_BASE_TYPE_STAT_EJECT UINT32_C(0x1a)
653 /* HWRM Command Completion: Completion of an HWRM command. */
654 #define CMPL_BASE_TYPE_HWRM_DONE UINT32_C(0x20)
655 /* Forwarded HWRM Request */
656 #define CMPL_BASE_TYPE_HWRM_FWD_REQ UINT32_C(0x22)
657 /* Forwarded HWRM Response */
658 #define CMPL_BASE_TYPE_HWRM_FWD_RESP UINT32_C(0x24)
659 /* HWRM Asynchronous Event Information */
660 #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
661 /* CQ Notification */
662 #define CMPL_BASE_TYPE_CQ_NOTIFICATION UINT32_C(0x30)
663 /* SRQ Threshold Event */
664 #define CMPL_BASE_TYPE_SRQ_EVENT UINT32_C(0x32)
665 /* DBQ Threshold Event */
666 #define CMPL_BASE_TYPE_DBQ_EVENT UINT32_C(0x34)
667 /* QP Async Notification */
668 #define CMPL_BASE_TYPE_QP_EVENT UINT32_C(0x38)
669 /* Function Async Notification */
670 #define CMPL_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a)
679 * This value is written by the NIC such that it will be
680 * different for each pass through the completion queue. The
681 * even passes will write 1. The odd passes will write 0.
683 #define CMPL_BASE_V UINT32_C(0x1)
685 #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
686 #define CMPL_BASE_INFO3_SFT 1
689 } __attribute__((packed));
691 /* TX Completion Record (16 bytes) */
695 * This field indicates the exact type of the completion. By
696 * convention, the LSB identifies the length of the record in
697 * 16B units. Even values indicate 16B records. Odd values
698 * indicate 32B records.
700 #define TX_CMPL_TYPE_MASK UINT32_C(0x3f)
701 #define TX_CMPL_TYPE_SFT 0
702 /* TX L2 completion: Completion of TX packet. Length = 16B */
703 #define TX_CMPL_TYPE_TX_L2 UINT32_C(0x0)
705 * When this bit is '1', it indicates a packet that has an error
706 * of some type. Type of error is indicated in error_flags.
708 #define TX_CMPL_FLAGS_ERROR UINT32_C(0x40)
710 * When this bit is '1', it indicates that the packet completed
711 * was transmitted using the push acceleration data provided by
712 * the driver. When this bit is '0', it indicates that the
713 * packet had not push acceleration data written or was executed
714 * as a normal packet even though push data was provided.
716 #define TX_CMPL_FLAGS_PUSH UINT32_C(0x80)
717 #define TX_CMPL_FLAGS_MASK UINT32_C(0xffc0)
718 #define TX_CMPL_FLAGS_SFT 6
720 /* unused1 is 16 b */
723 * This is a copy of the opaque field from the first TX BD of
724 * this transmitted packet.
728 * This value is written by the NIC such that it will be
729 * different for each pass through the completion queue. The
730 * even passes will write 1. The odd passes will write 0.
732 #define TX_CMPL_V UINT32_C(0x1)
734 * This error indicates that there was some sort of problem with
735 * the BDs for the packet.
737 #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
738 #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1
740 #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
741 /* Bad Format: BDs were not formatted correctly. */
742 #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
743 #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
744 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
746 * When this bit is '1', it indicates that the length of the
747 * packet was zero. No packet was transmitted.
749 #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
751 * When this bit is '1', it indicates that the packet was longer
752 * than the programmed limit in TDI. No packet was transmitted.
754 #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
756 * When this bit is '1', it indicates that one or more of the
757 * BDs associated with this packet generated a PCI error. This
758 * probably means the address was not valid.
760 #define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40)
762 * When this bit is '1', it indicates that the packet was longer
763 * than indicated by the hint. No packet was transmitted.
765 #define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
767 * When this bit is '1', it indicates that the packet was
768 * dropped due to Poison TLP error on one or more of the TLPs in
769 * the PXP completion.
771 #define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
772 #define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe)
773 #define TX_CMPL_ERRORS_SFT 1
775 /* unused2 is 16 b */
777 /* unused3 is 32 b */
778 } __attribute__((packed));
780 /* RX Packet Completion Record (32 bytes split to 2 16-byte struct) */
784 * This field indicates the exact type of the completion. By
785 * convention, the LSB identifies the length of the record in
786 * 16B units. Even values indicate 16B records. Odd values
787 * indicate 32B records.
789 #define RX_PKT_CMPL_TYPE_MASK UINT32_C(0x3f)
790 #define RX_PKT_CMPL_TYPE_SFT 0
792 * RX L2 completion: Completion of and L2 RX
793 * packet. Length = 32B
795 #define RX_PKT_CMPL_TYPE_RX_L2 UINT32_C(0x11)
797 * When this bit is '1', it indicates a packet that has an error
798 * of some type. Type of error is indicated in error_flags.
800 #define RX_PKT_CMPL_FLAGS_ERROR UINT32_C(0x40)
801 /* This field indicates how the packet was placed in the buffer. */
802 #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
803 #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT 7
804 /* Normal: Packet was placed using normal algorithm. */
805 #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7)
806 /* Jumbo: Packet was placed using jumbo algorithm. */
807 #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
809 * Header/Data Separation: Packet was placed
810 * using Header/Data separation algorithm. The
811 * separation location is indicated by the itype
814 #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
815 #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
816 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
817 /* This bit is '1' if the RSS field in this completion is valid. */
818 #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
820 #define RX_PKT_CMPL_FLAGS_UNUSED UINT32_C(0x800)
822 * This value indicates what the inner packet determined for the
825 #define RX_PKT_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
826 #define RX_PKT_CMPL_FLAGS_ITYPE_SFT 12
827 /* Not Known: Indicates that the packet type was not known. */
828 #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 12)
830 * IP Packet: Indicates that the packet was an
831 * IP packet, but further classification was not
834 #define RX_PKT_CMPL_FLAGS_ITYPE_IP (UINT32_C(0x1) << 12)
836 * TCP Packet: Indicates that the packet was IP
837 * and TCP. This indicates that the
838 * payload_offset field is valid.
840 #define RX_PKT_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
842 * UDP Packet: Indicates that the packet was IP
843 * and UDP. This indicates that the
844 * payload_offset field is valid.
846 #define RX_PKT_CMPL_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 12)
848 * FCoE Packet: Indicates that the packet was
849 * recognized as a FCoE. This also indicates
850 * that the payload_offset field is valid.
852 #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 12)
854 * RoCE Packet: Indicates that the packet was
855 * recognized as a RoCE. This also indicates
856 * that the payload_offset field is valid.
858 #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 12)
860 * ICMP Packet: Indicates that the packet was
861 * recognized as ICMP. This indicates that the
862 * payload_offset field is valid.
864 #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 12)
866 * PtP packet wo/timestamp: Indicates that the
867 * packet was recognized as a PtP packet.
869 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 12)
871 * PtP packet w/timestamp: Indicates that the
872 * packet was recognized as a PtP packet and
873 * that a timestamp was taken for the packet.
875 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 12)
876 #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
877 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
878 #define RX_PKT_CMPL_FLAGS_MASK UINT32_C(0xffc0)
879 #define RX_PKT_CMPL_FLAGS_SFT 6
882 * This is the length of the data for the packet stored in the
883 * buffer(s) identified by the opaque value. This includes the
884 * packet BD and any associated buffer BDs. This does not
885 * include the length of any data places in aggregation BDs.
889 * This is a copy of the opaque field from the RX BD this
890 * completion corresponds to.
895 * This value is written by the NIC such that it will be
896 * different for each pass through the completion queue. The
897 * even passes will write 1. The odd passes will write 0.
899 #define RX_PKT_CMPL_V1 UINT32_C(0x1)
901 * This value is the number of aggregation buffers that follow
902 * this entry in the completion ring that are a part of this
903 * packet. If the value is zero, then the packet is completely
904 * contained in the buffer space provided for the packet in the
907 #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
908 #define RX_PKT_CMPL_AGG_BUFS_SFT 1
910 uint8_t rss_hash_type;
912 * This is the RSS hash type for the packet. The value is packed
913 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}
914 * . The value of tuple_extrac_op provides the information about
915 * what fields the hash was computed on. * 0: The RSS hash was
916 * computed over source IP address, destination IP address,
917 * source port, and destination port of inner IP and TCP or UDP
918 * headers. Note: For non-tunneled packets, the packet headers
919 * are considered inner packet headers for the RSS hash
920 * computation purpose. * 1: The RSS hash was computed over
921 * source IP address and destination IP address of inner IP
922 * header. Note: For non-tunneled packets, the packet headers
923 * are considered inner packet headers for the RSS hash
924 * computation purpose. * 2: The RSS hash was computed over
925 * source IP address, destination IP address, source port, and
926 * destination port of IP and TCP or UDP headers of outer tunnel
927 * headers. Note: For non-tunneled packets, this value is not
928 * applicable. * 3: The RSS hash was computed over source IP
929 * address and destination IP address of IP header of outer
930 * tunnel headers. Note: For non-tunneled packets, this value is
931 * not applicable. Note that 4-tuples values listed above are
932 * applicable for layer 4 protocols supported and enabled for
933 * RSS in the hardware, HWRM firmware, and drivers. For example,
934 * if RSS hash is supported and enabled for TCP traffic only,
935 * then the values of tuple_extract_op corresponding to 4-tuples
936 * are only valid for TCP traffic.
938 uint8_t payload_offset;
940 * This value indicates the offset in bytes from the beginning
941 * of the packet where the inner payload starts. This value is
942 * valid for TCP, UDP, FCoE, and RoCE packets. A value of zero
943 * indicates that header is 256B into the packet.
949 * This value is the RSS hash value calculated for the packet
950 * based on the mode bits and key value in the VNIC.
952 } __attribute__((packed));
954 /* last 16 bytes of RX Packet Completion Record */
955 struct rx_pkt_cmpl_hi {
958 * This indicates that the ip checksum was calculated for the
959 * inner packet and that the ip_cs_error field indicates if
960 * there was an error.
962 #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
964 * This indicates that the TCP, UDP or ICMP checksum was
965 * calculated for the inner packet and that the l4_cs_error
966 * field indicates if there was an error.
968 #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
970 * This indicates that the ip checksum was calculated for the
971 * tunnel header and that the t_ip_cs_error field indicates if
972 * there was an error.
974 #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
976 * This indicates that the UDP checksum was calculated for the
977 * tunnel packet and that the t_l4_cs_error field indicates if
978 * there was an error.
980 #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
981 /* This value indicates what format the metadata field is. */
982 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
983 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT 4
984 /* No metadata informtaion. Value is zero. */
985 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
987 * The metadata field contains the VLAN tag and
988 * TPID value. - metadata[11:0] contains the
989 * vlan VID value. - metadata[12] contains the
990 * vlan DE value. - metadata[15:13] contains the
991 * vlan PRI value. - metadata[31:16] contains
992 * the vlan TPID value.
994 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
995 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
996 RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
998 * This field indicates the IP type for the inner-most IP
999 * header. A value of '0' indicates IPv4. A value of '1'
1000 * indicates IPv6. This value is only valid if itype indicates a
1001 * packet with an IP header.
1003 #define RX_PKT_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
1006 * This is data from the CFA block as indicated by the
1007 * meta_format field.
1009 /* When meta_format=1, this value is the VLAN VID. */
1010 #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
1011 #define RX_PKT_CMPL_METADATA_VID_SFT 0
1012 /* When meta_format=1, this value is the VLAN DE. */
1013 #define RX_PKT_CMPL_METADATA_DE UINT32_C(0x1000)
1014 /* When meta_format=1, this value is the VLAN PRI. */
1015 #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
1016 #define RX_PKT_CMPL_METADATA_PRI_SFT 13
1017 /* When meta_format=1, this value is the VLAN TPID. */
1018 #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
1019 #define RX_PKT_CMPL_METADATA_TPID_SFT 16
1022 * This value is written by the NIC such that it will be
1023 * different for each pass through the completion queue. The
1024 * even passes will write 1. The odd passes will write 0.
1026 #define RX_PKT_CMPL_V2 UINT32_C(0x1)
1028 * This error indicates that there was some sort of problem with
1029 * the BDs for the packet that was found after part of the
1030 * packet was already placed. The packet should be treated as
1033 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
1034 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT 1
1035 /* No buffer error */
1036 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
1038 * Did Not Fit: Packet did not fit into packet
1039 * buffer provided. For regular placement, this
1040 * means the packet did not fit in the buffer
1041 * provided. For HDS and jumbo placement, this
1042 * means that the packet could not be placed
1043 * into 7 physical buffers or less.
1045 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
1046 (UINT32_C(0x1) << 1)
1048 * Not On Chip: All BDs needed for the packet
1049 * were not on-chip when the packet arrived.
1051 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
1052 (UINT32_C(0x2) << 1)
1053 /* Bad Format: BDs were not formatted correctly. */
1054 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
1055 (UINT32_C(0x3) << 1)
1056 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
1057 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT
1058 /* This indicates that there was an error in the IP header checksum. */
1059 #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR UINT32_C(0x10)
1061 * This indicates that there was an error in the TCP, UDP or
1064 #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR UINT32_C(0x20)
1066 * This indicates that there was an error in the tunnel IP
1069 #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
1071 * This indicates that there was an error in the tunnel UDP
1074 #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
1076 * This indicates that there was a CRC error on either an FCoE
1077 * or RoCE packet. The itype indicates the packet type.
1079 #define RX_PKT_CMPL_ERRORS_CRC_ERROR UINT32_C(0x100)
1081 * This indicates that there was an error in the tunnel portion
1082 * of the packet when this field is non-zero.
1084 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
1085 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT 9
1087 * No additional error occurred on the tunnel
1088 * portion of the packet of the packet does not
1091 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
1093 * Indicates that IP header version does not
1094 * match expectation from L2 Ethertype for IPv4
1095 * and IPv6 in the tunnel header.
1097 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
1098 (UINT32_C(0x1) << 9)
1100 * Indicates that header length is out of range
1101 * in the tunnel header. Valid for IPv4.
1103 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
1104 (UINT32_C(0x2) << 9)
1106 * Indicates that the physical packet is shorter
1107 * than that claimed by the PPPoE header length
1108 * for a tunnel PPPoE packet.
1110 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
1111 (UINT32_C(0x3) << 9)
1113 * Indicates that physical packet is shorter
1114 * than that claimed by the tunnel l3 header
1115 * length. Valid for IPv4, or IPv6 tunnel packet
1118 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
1119 (UINT32_C(0x4) << 9)
1121 * Indicates that the physical packet is shorter
1122 * than that claimed by the tunnel UDP header
1123 * length for a tunnel UDP packet that is not
1126 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
1127 (UINT32_C(0x5) << 9)
1129 * indicates that the IPv4 TTL or IPv6 hop limit
1130 * check have failed (e.g. TTL = 0) in the
1131 * tunnel header. Valid for IPv4, and IPv6.
1133 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
1134 (UINT32_C(0x6) << 9)
1135 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
1136 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
1138 * This indicates that there was an error in the inner portion
1139 * of the packet when this field is non-zero.
1141 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
1142 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT 12
1144 * No additional error occurred on the tunnel
1145 * portion of the packet of the packet does not
1148 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
1150 * Indicates that IP header version does not
1151 * match expectation from L2 Ethertype for IPv4
1152 * and IPv6 or that option other than VFT was
1153 * parsed on FCoE packet.
1155 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
1156 (UINT32_C(0x1) << 12)
1158 * indicates that header length is out of range.
1159 * Valid for IPv4 and RoCE
1161 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
1162 (UINT32_C(0x2) << 12)
1164 * indicates that the IPv4 TTL or IPv6 hop limit
1165 * check have failed (e.g. TTL = 0). Valid for
1168 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
1170 * Indicates that physical packet is shorter
1171 * than that claimed by the l3 header length.
1172 * Valid for IPv4, IPv6 packet or RoCE packets.
1174 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
1175 (UINT32_C(0x4) << 12)
1177 * Indicates that the physical packet is shorter
1178 * than that claimed by the UDP header length
1179 * for a UDP packet that is not fragmented.
1181 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
1182 (UINT32_C(0x5) << 12)
1184 * Indicates that TCP header length > IP
1185 * payload. Valid for TCP packets only.
1187 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
1188 (UINT32_C(0x6) << 12)
1189 /* Indicates that TCP header length < 5. Valid for TCP. */
1190 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
1191 (UINT32_C(0x7) << 12)
1193 * Indicates that TCP option headers result in a
1194 * TCP header size that does not match data
1195 * offset in TCP header. Valid for TCP.
1197 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
1198 (UINT32_C(0x8) << 12)
1199 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
1200 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
1201 #define RX_PKT_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1202 #define RX_PKT_CMPL_ERRORS_SFT 1
1205 * This field identifies the CFA action rule that was used for
1210 * This value holds the reordering sequence number for the
1211 * packet. If the reordering sequence is not valid, then this
1212 * value is zero. The reordering domain for the packet is in the
1213 * bottom 8 to 10b of the rss_hash value. The bottom 20b of this
1214 * value contain the ordering domain value for the packet.
1216 #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
1217 #define RX_PKT_CMPL_REORDER_SFT 0
1218 } __attribute__((packed));
1220 /* RX L2 TPA Start Completion Record (32 bytes split to 2 16-byte struct) */
1221 struct rx_tpa_start_cmpl {
1222 uint16_t flags_type;
1224 * This field indicates the exact type of the completion. By
1225 * convention, the LSB identifies the length of the record in
1226 * 16B units. Even values indicate 16B records. Odd values
1227 * indicate 32B records.
1229 #define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f)
1230 #define RX_TPA_START_CMPL_TYPE_SFT 0
1232 * RX L2 TPA Start Completion: Completion at the
1233 * beginning of a TPA operation. Length = 32B
1235 #define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13)
1236 /* This bit will always be '0' for TPA start completions. */
1237 #define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40)
1238 /* This field indicates how the packet was placed in the buffer. */
1239 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
1240 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7
1242 * Jumbo: TPA Packet was placed using jumbo
1243 * algorithm. This means that the first buffer
1244 * will be filled with data before moving to
1245 * aggregation buffers. Each aggregation buffer
1246 * will be filled before moving to the next
1247 * aggregation buffer.
1249 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
1251 * Header/Data Separation: Packet was placed
1252 * using Header/Data separation algorithm. The
1253 * separation location is indicated by the itype
1256 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
1258 * GRO/Jumbo: Packet will be placed using
1259 * GRO/Jumbo where the first packet is filled
1260 * with data. Subsequent packets will be placed
1261 * such that any one packet does not span two
1262 * aggregation buffers unless it starts at the
1263 * beginning of an aggregation buffer.
1265 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
1266 (UINT32_C(0x5) << 7)
1268 * GRO/Header-Data Separation: Packet will be
1269 * placed using GRO/HDS where the header is in
1270 * the first packet. Payload of each packet will
1271 * be placed such that any one packet does not
1272 * span two aggregation buffers unless it starts
1273 * at the beginning of an aggregation buffer.
1275 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
1276 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
1277 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
1278 /* This bit is '1' if the RSS field in this completion is valid. */
1279 #define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
1281 #define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800)
1283 * This value indicates what the inner packet determined for the
1286 #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
1287 #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12
1288 /* TCP Packet: Indicates that the packet was IP and TCP. */
1289 #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
1290 #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
1291 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
1292 #define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0)
1293 #define RX_TPA_START_CMPL_FLAGS_SFT 6
1296 * This value indicates the amount of packet data written to the
1297 * buffer the opaque field in this completion corresponds to.
1301 * This is a copy of the opaque field from the RX BD this
1302 * completion corresponds to.
1305 /* unused1 is 7 b */
1307 * This value is written by the NIC such that it will be
1308 * different for each pass through the completion queue. The
1309 * even passes will write 1. The odd passes will write 0.
1311 #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
1312 /* unused1 is 7 b */
1313 uint8_t rss_hash_type;
1315 * This is the RSS hash type for the packet. The value is packed
1316 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}
1317 * . The value of tuple_extrac_op provides the information about
1318 * what fields the hash was computed on. * 0: The RSS hash was
1319 * computed over source IP address, destination IP address,
1320 * source port, and destination port of inner IP and TCP or UDP
1321 * headers. Note: For non-tunneled packets, the packet headers
1322 * are considered inner packet headers for the RSS hash
1323 * computation purpose. * 1: The RSS hash was computed over
1324 * source IP address and destination IP address of inner IP
1325 * header. Note: For non-tunneled packets, the packet headers
1326 * are considered inner packet headers for the RSS hash
1327 * computation purpose. * 2: The RSS hash was computed over
1328 * source IP address, destination IP address, source port, and
1329 * destination port of IP and TCP or UDP headers of outer tunnel
1330 * headers. Note: For non-tunneled packets, this value is not
1331 * applicable. * 3: The RSS hash was computed over source IP
1332 * address and destination IP address of IP header of outer
1333 * tunnel headers. Note: For non-tunneled packets, this value is
1334 * not applicable. Note that 4-tuples values listed above are
1335 * applicable for layer 4 protocols supported and enabled for
1336 * RSS in the hardware, HWRM firmware, and drivers. For example,
1337 * if RSS hash is supported and enabled for TCP traffic only,
1338 * then the values of tuple_extract_op corresponding to 4-tuples
1339 * are only valid for TCP traffic.
1343 * This is the aggregation ID that the completion is associated
1344 * with. Use this number to correlate the TPA start completion
1345 * with the TPA end completion.
1347 /* unused2 is 9 b */
1349 * This is the aggregation ID that the completion is associated
1350 * with. Use this number to correlate the TPA start completion
1351 * with the TPA end completion.
1353 #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
1354 #define RX_TPA_START_CMPL_AGG_ID_SFT 9
1357 * This value is the RSS hash value calculated for the packet
1358 * based on the mode bits and key value in the VNIC.
1360 } __attribute__((packed));
1362 /* last 16 bytes of RX L2 TPA Start Completion Record */
1363 struct rx_tpa_start_cmpl_hi {
1366 * This indicates that the ip checksum was calculated for the
1367 * inner packet and that the sum passed for all segments
1368 * included in the aggregation.
1370 #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
1372 * This indicates that the TCP, UDP or ICMP checksum was
1373 * calculated for the inner packet and that the sum passed for
1374 * all segments included in the aggregation.
1376 #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
1378 * This indicates that the ip checksum was calculated for the
1379 * tunnel header and that the sum passed for all segments
1380 * included in the aggregation.
1382 #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
1384 * This indicates that the UDP checksum was calculated for the
1385 * tunnel packet and that the sum passed for all segments
1386 * included in the aggregation.
1388 #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
1389 /* This value indicates what format the metadata field is. */
1390 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
1391 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT 4
1392 /* No metadata informtaion. Value is zero. */
1393 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
1395 * The metadata field contains the VLAN tag and
1396 * TPID value. - metadata[11:0] contains the
1397 * vlan VID value. - metadata[12] contains the
1398 * vlan DE value. - metadata[15:13] contains the
1399 * vlan PRI value. - metadata[31:16] contains
1400 * the vlan TPID value.
1402 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
1403 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
1404 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
1406 * This field indicates the IP type for the inner-most IP
1407 * header. A value of '0' indicates IPv4. A value of '1'
1410 #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
1413 * This is data from the CFA block as indicated by the
1414 * meta_format field.
1416 /* When meta_format=1, this value is the VLAN VID. */
1417 #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
1418 #define RX_TPA_START_CMPL_METADATA_VID_SFT 0
1419 /* When meta_format=1, this value is the VLAN DE. */
1420 #define RX_TPA_START_CMPL_METADATA_DE UINT32_C(0x1000)
1421 /* When meta_format=1, this value is the VLAN PRI. */
1422 #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
1423 #define RX_TPA_START_CMPL_METADATA_PRI_SFT 13
1424 /* When meta_format=1, this value is the VLAN TPID. */
1425 #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
1426 #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
1428 /* unused4 is 15 b */
1430 * This value is written by the NIC such that it will be
1431 * different for each pass through the completion queue. The
1432 * even passes will write 1. The odd passes will write 0.
1434 #define RX_TPA_START_CMPL_V2 UINT32_C(0x1)
1435 /* unused4 is 15 b */
1438 * This field identifies the CFA action rule that was used for
1441 uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
1443 * This is the size in bytes of the inner most L4 header. This
1444 * can be subtracted from the payload_offset to determine the
1445 * start of the inner most L4 header.
1448 * This is the offset from the beginning of the packet in bytes
1449 * for the outer L3 header. If there is no outer L3 header, then
1450 * this value is zero.
1452 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
1453 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
1455 * This is the offset from the beginning of the packet in bytes
1456 * for the inner most L2 header.
1458 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
1459 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
1461 * This is the offset from the beginning of the packet in bytes
1462 * for the inner most L3 header.
1464 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
1465 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
1467 * This is the size in bytes of the inner most L4 header. This
1468 * can be subtracted from the payload_offset to determine the
1469 * start of the inner most L4 header.
1471 #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK UINT32_C(0xf8000000)
1472 #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT 27
1473 } __attribute__((packed));
1475 /* RX TPA End Completion Record (32 bytes split to 2 16-byte struct) */
1476 struct rx_tpa_end_cmpl {
1477 uint16_t flags_type;
1479 * This field indicates the exact type of the completion. By
1480 * convention, the LSB identifies the length of the record in
1481 * 16B units. Even values indicate 16B records. Odd values
1482 * indicate 32B records.
1484 #define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f)
1485 #define RX_TPA_END_CMPL_TYPE_SFT 0
1487 * RX L2 TPA End Completion: Completion at the
1488 * end of a TPA operation. Length = 32B
1490 #define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15)
1492 * When this bit is '1', it indicates a packet that has an error
1493 * of some type. Type of error is indicated in error_flags.
1495 #define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40)
1496 /* This field indicates how the packet was placed in the buffer. */
1497 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
1498 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7
1500 * Jumbo: TPA Packet was placed using jumbo
1501 * algorithm. This means that the first buffer
1502 * will be filled with data before moving to
1503 * aggregation buffers. Each aggregation buffer
1504 * will be filled before moving to the next
1505 * aggregation buffer.
1507 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
1509 * Header/Data Separation: Packet was placed
1510 * using Header/Data separation algorithm. The
1511 * separation location is indicated by the itype
1514 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
1516 * GRO/Jumbo: Packet will be placed using
1517 * GRO/Jumbo where the first packet is filled
1518 * with data. Subsequent packets will be placed
1519 * such that any one packet does not span two
1520 * aggregation buffers unless it starts at the
1521 * beginning of an aggregation buffer.
1523 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
1525 * GRO/Header-Data Separation: Packet will be
1526 * placed using GRO/HDS where the header is in
1527 * the first packet. Payload of each packet will
1528 * be placed such that any one packet does not
1529 * span two aggregation buffers unless it starts
1530 * at the beginning of an aggregation buffer.
1532 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
1533 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
1534 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
1536 #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK UINT32_C(0xc00)
1537 #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT 10
1539 * This value indicates what the inner packet determined for the
1540 * packet was. - 2 TCP Packet Indicates that the packet was IP
1541 * and TCP. This indicates that the ip_cs field is valid and
1542 * that the tcp_udp_cs field is valid and contains the TCP
1543 * checksum. This also indicates that the payload_offset field
1546 #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
1547 #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12
1548 #define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0)
1549 #define RX_TPA_END_CMPL_FLAGS_SFT 6
1552 * This value is zero for TPA End completions. There is no data
1553 * in the buffer that corresponds to the opaque value in this
1558 * This is a copy of the opaque field from the RX BD this
1559 * completion corresponds to.
1561 uint8_t agg_bufs_v1;
1562 /* unused1 is 1 b */
1564 * This value is written by the NIC such that it will be
1565 * different for each pass through the completion queue. The
1566 * even passes will write 1. The odd passes will write 0.
1568 #define RX_TPA_END_CMPL_V1 UINT32_C(0x1)
1570 * This value is the number of aggregation buffers that follow
1571 * this entry in the completion ring that are a part of this
1572 * aggregation packet. If the value is zero, then the packet is
1573 * completely contained in the buffer space provided in the
1574 * aggregation start completion.
1576 #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
1577 #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
1578 /* unused1 is 1 b */
1580 /* This value is the number of segments in the TPA operation. */
1581 uint8_t payload_offset;
1583 * This value indicates the offset in bytes from the beginning
1584 * of the packet where the inner payload starts. This value is
1585 * valid for TCP, UDP, FCoE, and RoCE packets. A value of zero
1586 * indicates an offset of 256 bytes.
1590 * This is the aggregation ID that the completion is associated
1591 * with. Use this number to correlate the TPA start completion
1592 * with the TPA end completion.
1594 /* unused2 is 1 b */
1596 * This is the aggregation ID that the completion is associated
1597 * with. Use this number to correlate the TPA start completion
1598 * with the TPA end completion.
1600 #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
1601 #define RX_TPA_END_CMPL_AGG_ID_SFT 1
1604 * For non-GRO packets, this value is the timestamp delta
1605 * between earliest and latest timestamp values for TPA packet.
1606 * If packets were not time stamped, then delta will be zero.
1607 * For GRO packets, this field is zero except for the following
1608 * sub-fields. - tsdelta[31] Timestamp present indication. When
1609 * '0', no Timestamp option is in the packet. When '1', then a
1610 * Timestamp option is present in the packet.
1612 } __attribute__((packed));
1614 /* last 16 bytes of RX TPA End Completion Record */
1615 struct rx_tpa_end_cmpl_hi {
1616 uint32_t tpa_dup_acks;
1617 /* unused3 is 28 b */
1619 * This value is the number of duplicate ACKs that have been
1620 * received as part of the TPA operation.
1622 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
1623 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
1624 /* unused3 is 28 b */
1625 uint16_t tpa_seg_len;
1627 * This value is the valid when TPA completion is active. It
1628 * indicates the length of the longest segment of the TPA
1629 * operation for LRO mode and the length of the first segment in
1630 * GRO mode. This value may be used by GRO software to re-
1631 * construct the original packet stream from the TPA packet.
1632 * This is the length of all but the last segment for GRO. In
1633 * LRO mode this value may be used to indicate MSS size to the
1637 /* unused4 is 16 b */
1640 * This value is written by the NIC such that it will be
1641 * different for each pass through the completion queue. The
1642 * even passes will write 1. The odd passes will write 0.
1644 #define RX_TPA_END_CMPL_V2 UINT32_C(0x1)
1646 * This error indicates that there was some sort of problem with
1647 * the BDs for the packet that was found after part of the
1648 * packet was already placed. The packet should be treated as
1651 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
1652 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT 1
1654 * This error occurs when there is a fatal HW
1655 * problem in the chip only. It indicates that
1656 * there were not BDs on chip but that there was
1657 * adequate reservation. provided by the TPA
1660 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
1661 (UINT32_C(0x2) << 1)
1663 * This error occurs when TPA block was not
1664 * configured to reserve adequate BDs for TPA
1665 * operations on this RX ring. All data for the
1666 * TPA operation was not placed. This error can
1667 * also be generated when the number of segments
1668 * is not programmed correctly in TPA and the 33
1669 * total aggregation buffers allowed for the TPA
1670 * operation has been exceeded.
1672 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
1673 (UINT32_C(0x4) << 1)
1674 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
1675 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
1676 #define RX_TPA_END_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1677 #define RX_TPA_END_CMPL_ERRORS_SFT 1
1679 /* unused5 is 16 b */
1680 uint32_t start_opaque;
1682 * This is the opaque value that was completed for the TPA start
1683 * completion that corresponds to this TPA end completion.
1685 } __attribute__((packed));
1687 /* HWRM Forwarded Request (16 bytes) */
1688 struct hwrm_fwd_req_cmpl {
1689 uint16_t req_len_type;
1690 /* Length of forwarded request in bytes. */
1692 * This field indicates the exact type of the completion. By
1693 * convention, the LSB identifies the length of the record in
1694 * 16B units. Even values indicate 16B records. Odd values
1695 * indicate 32B records.
1697 #define HWRM_FWD_INPUT_CMPL_TYPE_MASK UINT32_C(0x3f)
1698 #define HWRM_FWD_INPUT_CMPL_TYPE_SFT 0
1699 /* Forwarded HWRM Request */
1700 #define HWRM_FWD_INPUT_CMPL_TYPE_HWRM_FWD_INPUT UINT32_C(0x22)
1701 /* Length of forwarded request in bytes. */
1702 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
1703 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
1706 * Source ID of this request. Typically used in forwarding
1707 * requests and responses. 0x0 - 0xFFF8 - Used for function ids
1708 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
1712 /* unused1 is 32 b */
1713 uint32_t req_buf_addr_v[2];
1714 /* Address of forwarded request. */
1716 * This value is written by the NIC such that it will be
1717 * different for each pass through the completion queue. The
1718 * even passes will write 1. The odd passes will write 0.
1720 #define HWRM_FWD_INPUT_CMPL_V UINT32_C(0x1)
1721 /* Address of forwarded request. */
1722 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
1723 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
1724 } __attribute__((packed));
1726 /* HWRM Asynchronous Event Completion Record (16 bytes) */
1727 struct hwrm_async_event_cmpl {
1729 /* unused1 is 10 b */
1731 * This field indicates the exact type of the completion. By
1732 * convention, the LSB identifies the length of the record in
1733 * 16B units. Even values indicate 16B records. Odd values
1734 * indicate 32B records.
1736 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
1737 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
1738 /* HWRM Asynchronous Event Information */
1739 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
1740 /* unused1 is 10 b */
1742 /* Identifiers of events. */
1743 /* Link status changed */
1744 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
1745 /* Link MTU changed */
1746 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
1747 /* Link speed changed */
1748 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
1749 /* DCB Configuration changed */
1750 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
1751 /* Port connection not allowed */
1752 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
1753 /* Link speed configuration was not allowed */
1754 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
1756 /* Link speed configuration change */
1757 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
1758 /* Port PHY configuration change */
1759 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
1760 /* Function driver unloaded */
1761 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
1762 /* Function driver loaded */
1763 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
1764 /* Function FLR related processing has completed */
1765 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
1766 /* PF driver unloaded */
1767 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
1768 /* PF driver loaded */
1769 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
1770 /* VF Function Level Reset (FLR) */
1771 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR UINT32_C(0x30)
1772 /* VF MAC Address Change */
1773 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
1774 /* PF-VF communication channel status change. */
1775 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
1777 /* VF Configuration Change */
1778 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
1779 /* LLFC/PFC Configuration Change */
1780 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34)
1782 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
1783 uint32_t event_data2;
1784 /* Event specific data */
1788 * This value is written by the NIC such that it will be
1789 * different for each pass through the completion queue. The
1790 * even passes will write 1. The odd passes will write 0.
1792 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
1794 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
1795 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
1796 uint8_t timestamp_lo;
1797 /* 8-lsb timestamp from POR (100-msec resolution) */
1798 uint16_t timestamp_hi;
1799 /* 16-lsb timestamp from POR (100-msec resolution) */
1800 uint32_t event_data1;
1801 /* Event specific data */
1802 } __attribute__((packed));
1806 * Description: This function is called by a driver to determine the HWRM
1807 * interface version supported by the HWRM firmware, the version of HWRM
1808 * firmware implementation, the name of HWRM firmware, the versions of other
1809 * embedded firmwares, and the names of other embedded firmwares, etc. Any
1810 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
1811 * be considered an invalid version.
1813 /* Input (24 bytes) */
1814 struct hwrm_ver_get_input {
1817 * This value indicates what type of request this is. The format
1818 * for the rest of the command is determined by this field.
1822 * This value indicates the what completion ring the request
1823 * will be optionally completed on. If the value is -1, then no
1824 * CR completion will be generated. Any other value must be a
1825 * valid CR ring_id value for this function.
1828 /* This value indicates the command sequence number. */
1831 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
1832 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
1837 * This is the host address where the response will be written
1838 * when the request is complete. This area must be 16B aligned
1839 * and must be cleared to zero before the request is made.
1841 uint8_t hwrm_intf_maj;
1843 * This field represents the major version of HWRM interface
1844 * specification supported by the driver HWRM implementation.
1845 * The interface major version is intended to change only when
1846 * non backward compatible changes are made to the HWRM
1847 * interface specification.
1849 uint8_t hwrm_intf_min;
1851 * This field represents the minor version of HWRM interface
1852 * specification supported by the driver HWRM implementation. A
1853 * change in interface minor version is used to reflect
1854 * significant backward compatible modification to HWRM
1855 * interface specification. This can be due to addition or
1856 * removal of functionality. HWRM interface specifications with
1857 * the same major version but different minor versions are
1860 uint8_t hwrm_intf_upd;
1862 * This field represents the update version of HWRM interface
1863 * specification supported by the driver HWRM implementation.
1864 * The interface update version is used to reflect minor changes
1865 * or bug fixes to a released HWRM interface specification.
1867 uint8_t unused_0[5];
1868 } __attribute__((packed));
1870 /* Output (128 bytes) */
1871 struct hwrm_ver_get_output {
1872 uint16_t error_code;
1874 * Pass/Fail or error type Note: receiver to verify the in
1875 * parameters, and fail the call with an error when appropriate
1878 /* This field returns the type of original request. */
1880 /* This field provides original sequence number of the command. */
1883 * This field is the length of the response in bytes. The last
1884 * byte of the response is a valid flag that will read as '1'
1885 * when the command has been completely written to memory.
1887 uint8_t hwrm_intf_maj;
1889 * This field represents the major version of HWRM interface
1890 * specification supported by the HWRM implementation. The
1891 * interface major version is intended to change only when non
1892 * backward compatible changes are made to the HWRM interface
1893 * specification. A HWRM implementation that is compliant with
1894 * this specification shall provide value of 1 in this field.
1896 uint8_t hwrm_intf_min;
1898 * This field represents the minor version of HWRM interface
1899 * specification supported by the HWRM implementation. A change
1900 * in interface minor version is used to reflect significant
1901 * backward compatible modification to HWRM interface
1902 * specification. This can be due to addition or removal of
1903 * functionality. HWRM interface specifications with the same
1904 * major version but different minor versions are compatible. A
1905 * HWRM implementation that is compliant with this specification
1906 * shall provide value of 2 in this field.
1908 uint8_t hwrm_intf_upd;
1910 * This field represents the update version of HWRM interface
1911 * specification supported by the HWRM implementation. The
1912 * interface update version is used to reflect minor changes or
1913 * bug fixes to a released HWRM interface specification. A HWRM
1914 * implementation that is compliant with this specification
1915 * shall provide value of 2 in this field.
1917 uint8_t hwrm_intf_rsvd;
1918 uint8_t hwrm_fw_maj;
1920 * This field represents the major version of HWRM firmware. A
1921 * change in firmware major version represents a major firmware
1924 uint8_t hwrm_fw_min;
1926 * This field represents the minor version of HWRM firmware. A
1927 * change in firmware minor version represents significant
1928 * firmware functionality changes.
1930 uint8_t hwrm_fw_bld;
1932 * This field represents the build version of HWRM firmware. A
1933 * change in firmware build version represents bug fixes to a
1934 * released firmware.
1936 uint8_t hwrm_fw_rsvd;
1938 * This field is a reserved field. This field can be used to
1939 * represent firmware branches or customer specific releases
1940 * tied to a specific (major,minor,update) version of the HWRM
1943 uint8_t mgmt_fw_maj;
1945 * This field represents the major version of mgmt firmware. A
1946 * change in major version represents a major release.
1948 uint8_t mgmt_fw_min;
1950 * This field represents the minor version of mgmt firmware. A
1951 * change in minor version represents significant functionality
1954 uint8_t mgmt_fw_bld;
1956 * This field represents the build version of mgmt firmware. A
1957 * change in update version represents bug fixes.
1959 uint8_t mgmt_fw_rsvd;
1961 * This field is a reserved field. This field can be used to
1962 * represent firmware branches or customer specific releases
1963 * tied to a specific (major,minor,update) version
1965 uint8_t netctrl_fw_maj;
1967 * This field represents the major version of network control
1968 * firmware. A change in major version represents a major
1971 uint8_t netctrl_fw_min;
1973 * This field represents the minor version of network control
1974 * firmware. A change in minor version represents significant
1975 * functionality changes.
1977 uint8_t netctrl_fw_bld;
1979 * This field represents the build version of network control
1980 * firmware. A change in update version represents bug fixes.
1982 uint8_t netctrl_fw_rsvd;
1984 * This field is a reserved field. This field can be used to
1985 * represent firmware branches or customer specific releases
1986 * tied to a specific (major,minor,update) version
1988 uint32_t dev_caps_cfg;
1990 * This field is used to indicate device's capabilities and
1994 * If set to 1, then secure firmware update behavior is
1995 * supported. If set to 0, then secure firmware update behavior
1998 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
2001 * If set to 1, then firmware based DCBX agent is supported. If
2002 * set to 0, then firmware based DCBX agent capability is not
2003 * supported on this device.
2005 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
2008 * If set to 1, then HWRM short command format is supported. If
2009 * set to 0, then HWRM short command format is not supported.
2011 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
2014 * If set to 1, then HWRM short command format is required. If
2015 * set to 0, then HWRM short command format is not required.
2017 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_INPUTUIRED \
2019 uint8_t roce_fw_maj;
2021 * This field represents the major version of RoCE firmware. A
2022 * change in major version represents a major release.
2024 uint8_t roce_fw_min;
2026 * This field represents the minor version of RoCE firmware. A
2027 * change in minor version represents significant functionality
2030 uint8_t roce_fw_bld;
2032 * This field represents the build version of RoCE firmware. A
2033 * change in update version represents bug fixes.
2035 uint8_t roce_fw_rsvd;
2037 * This field is a reserved field. This field can be used to
2038 * represent firmware branches or customer specific releases
2039 * tied to a specific (major,minor,update) version
2041 char hwrm_fw_name[16];
2043 * This field represents the name of HWRM FW (ASCII chars with
2046 char mgmt_fw_name[16];
2048 * This field represents the name of mgmt FW (ASCII chars with
2051 char netctrl_fw_name[16];
2053 * This field represents the name of network control firmware
2054 * (ASCII chars with NULL at the end).
2056 uint32_t reserved2[4];
2058 * This field is reserved for future use. The responder should
2059 * set it to 0. The requester should ignore this field.
2061 char roce_fw_name[16];
2063 * This field represents the name of RoCE FW (ASCII chars with
2067 /* This field returns the chip number. */
2069 /* This field returns the revision of chip. */
2071 /* This field returns the chip metal number. */
2072 uint8_t chip_bond_id;
2073 /* This field returns the bond id of the chip. */
2074 uint8_t chip_platform_type;
2076 * This value indicates the type of platform used for chip
2080 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC UINT32_C(0x0)
2081 /* FPGA platform of the chip. */
2082 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA UINT32_C(0x1)
2083 /* Palladium platform of the chip. */
2084 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
2085 uint16_t max_req_win_len;
2087 * This field returns the maximum value of request window that
2088 * is supported by the HWRM. The request window is mapped into
2089 * device address space using MMIO.
2091 uint16_t max_resp_len;
2092 /* This field returns the maximum value of response buffer in bytes. */
2093 uint16_t def_req_timeout;
2095 * This field returns the default request timeout value in
2098 uint8_t init_pending;
2100 * This field will indicate if any subsystems is not fully
2104 * If set to 1, device is not ready. If set to 0, device is
2105 * ready to accept all HWRM commands.
2107 #define HWRM_VER_GET_OUTPUT_INIT_PENDING_DEV_NOT_RDY UINT32_C(0x1)
2112 * This field is used in Output records to indicate that the
2113 * output is completely written to RAM. This field should be
2114 * read as '1' to indicate that the output has been completely
2115 * written. When writing a command completion or response to an
2116 * internal processor, the order of writes has to be such that
2117 * this field is written last.
2119 } __attribute__((packed));
2121 /* hwrm_func_reset */
2123 * Description: This command resets a hardware function (PCIe function) and
2124 * frees any resources used by the function. This command shall be initiated by
2125 * the driver after an FLR has occurred to prepare the function for re-use. This
2126 * command may also be initiated by a driver prior to doing it's own
2127 * configuration. This command puts the function into the reset state. In the
2128 * reset state, global and port related features of the chip are not available.
2131 * Note: This command will reset a function that has already been disabled or
2132 * idled. The command returns all the resources owned by the function so a new
2133 * driver may allocate and configure resources normally.
2135 /* Input (24 bytes) */
2136 struct hwrm_func_reset_input {
2139 * This value indicates what type of request this is. The format
2140 * for the rest of the command is determined by this field.
2144 * This value indicates the what completion ring the request
2145 * will be optionally completed on. If the value is -1, then no
2146 * CR completion will be generated. Any other value must be a
2147 * valid CR ring_id value for this function.
2150 /* This value indicates the command sequence number. */
2153 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2154 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2159 * This is the host address where the response will be written
2160 * when the request is complete. This area must be 16B aligned
2161 * and must be cleared to zero before the request is made.
2164 /* This bit must be '1' for the vf_id_valid field to be configured. */
2165 #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
2168 * The ID of the VF that this PF is trying to reset. Only the
2169 * parent PF shall be allowed to reset a child VF. A parent PF
2170 * driver shall use this field only when a specific child VF is
2171 * requested to be reset.
2173 uint8_t func_reset_level;
2174 /* This value indicates the level of a function reset. */
2176 * Reset the caller function and its children
2177 * VFs (if any). If no children functions exist,
2178 * then reset the caller function only.
2180 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL UINT32_C(0x0)
2181 /* Reset the caller function only */
2182 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME UINT32_C(0x1)
2184 * Reset all children VFs of the caller function
2185 * driver if the caller is a PF driver. It is an
2186 * error to specify this level by a VF driver.
2187 * It is an error to specify this level by a PF
2188 * driver with no children VFs.
2190 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
2193 * Reset a specific VF of the caller function
2194 * driver if the caller is the parent PF driver.
2195 * It is an error to specify this level by a VF
2196 * driver. It is an error to specify this level
2197 * by a PF driver that is not the parent of the
2198 * VF that is being requested to reset.
2200 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF UINT32_C(0x3)
2202 } __attribute__((packed));
2204 /* Output (16 bytes) */
2205 struct hwrm_func_reset_output {
2206 uint16_t error_code;
2208 * Pass/Fail or error type Note: receiver to verify the in
2209 * parameters, and fail the call with an error when appropriate
2212 /* This field returns the type of original request. */
2214 /* This field provides original sequence number of the command. */
2217 * This field is the length of the response in bytes. The last
2218 * byte of the response is a valid flag that will read as '1'
2219 * when the command has been completely written to memory.
2227 * This field is used in Output records to indicate that the
2228 * output is completely written to RAM. This field should be
2229 * read as '1' to indicate that the output has been completely
2230 * written. When writing a command completion or response to an
2231 * internal processor, the order of writes has to be such that
2232 * this field is written last.
2234 } __attribute__((packed));
2236 /* hwrm_func_vf_cfg */
2238 * Description: This command allows configuration of a VF by its driver. If this
2239 * function is called by a PF driver, then the HWRM shall fail this command. If
2240 * guest VLAN and/or MAC address are provided in this command, then the HWRM
2241 * shall set up appropriate MAC/VLAN filters for the VF that is being
2242 * configured. A VF driver should set VF MTU/MRU using this command prior to
2243 * allocating RX VNICs or TX rings for the corresponding VF.
2245 /* Input (32 bytes) */
2246 struct hwrm_func_vf_cfg_input {
2249 * This value indicates what type of request this is. The format for the
2250 * rest of the command is determined by this field.
2254 * This value indicates the what completion ring the request will be
2255 * optionally completed on. If the value is -1, then no CR completion
2256 * will be generated. Any other value must be a valid CR ring_id value
2257 * for this function.
2260 /* This value indicates the command sequence number. */
2263 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2264 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2268 * This is the host address where the response will be written when the
2269 * request is complete. This area must be 16B aligned and must be
2270 * cleared to zero before the request is made.
2273 /* This bit must be '1' for the mtu field to be configured. */
2274 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
2275 /* This bit must be '1' for the guest_vlan field to be configured. */
2276 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN UINT32_C(0x2)
2278 * This bit must be '1' for the async_event_cr field to be configured.
2280 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4)
2281 /* This bit must be '1' for the dflt_mac_addr field to be configured. */
2282 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x8)
2285 * The maximum transmission unit requested on the function. The HWRM
2286 * should make sure that the mtu of the function does not exceed the mtu
2287 * of the physical port that this function is associated with. In
2288 * addition to requesting mtu per function, it is possible to configure
2289 * mtu per transmit ring. By default, the mtu of each transmit ring
2290 * associated with a function is equal to the mtu of the function. The
2291 * HWRM should make sure that the mtu of each transmit ring that is
2292 * assigned to a function has a valid mtu.
2294 uint16_t guest_vlan;
2296 * The guest VLAN for the function being configured. This field's format
2297 * is same as 802.1Q Tag's Tag Control Information (TCI) format that
2298 * includes both Priority Code Point (PCP) and VLAN Identifier (VID).
2300 uint16_t async_event_cr;
2302 * ID of the target completion ring for receiving asynchronous event
2303 * completions. If this field is not valid, then the HWRM shall use the
2304 * default completion ring of the function that is being configured as
2305 * the target completion ring for providing any asynchronous event
2306 * completions for that function. If this field is valid, then the HWRM
2307 * shall use the completion ring identified by this ID as the target
2308 * completion ring for providing any asynchronous event completions for
2309 * the function that is being configured.
2311 uint8_t dflt_mac_addr[6];
2313 * This value is the current MAC address requested by the VF driver to
2314 * be configured on this VF. A value of 00-00-00-00-00-00 indicates no
2315 * MAC address configuration is requested by the VF driver. The parent
2316 * PF driver may reject or overwrite this MAC address.
2318 } __attribute__((packed));
2320 /* Output (16 bytes) */
2322 struct hwrm_func_vf_cfg_output {
2323 uint16_t error_code;
2325 * Pass/Fail or error type Note: receiver to verify the in parameters,
2326 * and fail the call with an error when appropriate
2329 /* This field returns the type of original request. */
2331 /* This field provides original sequence number of the command. */
2334 * This field is the length of the response in bytes. The last
2335 * byte of the response is a valid flag that will read as '1'
2336 * when the command has been completely written to memory.
2344 * This field is used in Output records to indicate that the output is
2345 * completely written to RAM. This field should be read as '1' to
2346 * indicate that the output has been completely written. When writing a
2347 * command completion or response to an internal processor, the order of
2348 * writes has to be such that this field is written last.
2350 } __attribute__((packed));
2352 /* hwrm_func_qcaps */
2354 * Description: This command returns capabilities of a function. The input FID
2355 * value is used to indicate what function is being queried. This allows a
2356 * physical function driver to query virtual functions that are children of the
2357 * physical function. The output FID value is needed to configure Rings and
2358 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
2360 /* Input (24 bytes) */
2361 struct hwrm_func_qcaps_input {
2364 * This value indicates what type of request this is. The format
2365 * for the rest of the command is determined by this field.
2369 * This value indicates the what completion ring the request
2370 * will be optionally completed on. If the value is -1, then no
2371 * CR completion will be generated. Any other value must be a
2372 * valid CR ring_id value for this function.
2375 /* This value indicates the command sequence number. */
2378 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2379 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2384 * This is the host address where the response will be written
2385 * when the request is complete. This area must be 16B aligned
2386 * and must be cleared to zero before the request is made.
2390 * Function ID of the function that is being queried. 0xFF...
2391 * (All Fs) if the query is for the requesting function.
2393 uint16_t unused_0[3];
2394 } __attribute__((packed));
2396 /* Output (80 bytes) */
2397 struct hwrm_func_qcaps_output {
2398 uint16_t error_code;
2400 * Pass/Fail or error type Note: receiver to verify the in
2401 * parameters, and fail the call with an error when appropriate
2404 /* This field returns the type of original request. */
2406 /* This field provides original sequence number of the command. */
2409 * This field is the length of the response in bytes. The last
2410 * byte of the response is a valid flag that will read as '1'
2411 * when the command has been completely written to memory.
2415 * FID value. This value is used to identify operations on the
2416 * PCI bus as belonging to a particular PCI function.
2420 * Port ID of port that this function is associated with. Valid
2421 * only for the PF. 0xFF... (All Fs) if this function is not
2422 * associated with any port. 0xFF... (All Fs) if this function
2423 * is called from a VF.
2426 /* If 1, then Push mode is supported on this function. */
2427 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
2429 * If 1, then the global MSI-X auto-masking is enabled for the
2432 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
2435 * If 1, then the Precision Time Protocol (PTP) processing is
2436 * supported on this function. The HWRM should enable PTP on
2437 * only a single Physical Function (PF) per port.
2439 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
2441 * If 1, then RDMA over Converged Ethernet (RoCE) v1 is
2442 * supported on this function.
2444 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED UINT32_C(0x8)
2446 * If 1, then RDMA over Converged Ethernet (RoCE) v2 is
2447 * supported on this function.
2449 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED UINT32_C(0x10)
2451 * If 1, then control and configuration of WoL magic packet are
2452 * supported on this function.
2454 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
2457 * If 1, then control and configuration of bitmap pattern packet
2458 * are supported on this function.
2460 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED UINT32_C(0x40)
2462 * If set to 1, then the control and configuration of rate limit
2463 * of an allocated TX ring on the queried function is supported.
2465 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED UINT32_C(0x80)
2467 * If 1, then control and configuration of minimum and maximum
2468 * bandwidths are supported on the queried function.
2470 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED UINT32_C(0x100)
2472 * If the query is for a VF, then this flag shall be ignored. If
2473 * this query is for a PF and this flag is set to 1, then the PF
2474 * has the capability to set the rate limits on the TX rings of
2475 * its children VFs. If this query is for a PF and this flag is
2476 * set to 0, then the PF does not have the capability to set the
2477 * rate limits on the TX rings of its children VFs.
2479 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
2482 * If the query is for a VF, then this flag shall be ignored. If
2483 * this query is for a PF and this flag is set to 1, then the PF
2484 * has the capability to set the minimum and/or maximum
2485 * bandwidths for its children VFs. If this query is for a PF
2486 * and this flag is set to 0, then the PF does not have the
2487 * capability to set the minimum or maximum bandwidths for its
2490 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED UINT32_C(0x400)
2492 * Standard TX Ring mode is used for the allocation of TX ring
2493 * and underlying scheduling resources that allow bandwidth
2494 * reservation and limit settings on the queried function. If
2495 * set to 1, then standard TX ring mode is supported on the
2496 * queried function. If set to 0, then standard TX ring mode is
2497 * not available on the queried function.
2499 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
2501 uint8_t mac_address[6];
2503 * This value is current MAC address configured for this
2504 * function. A value of 00-00-00-00-00-00 indicates no MAC
2505 * address is currently configured.
2507 uint16_t max_rsscos_ctx;
2509 * The maximum number of RSS/COS contexts that can be allocated
2512 uint16_t max_cmpl_rings;
2514 * The maximum number of completion rings that can be allocated
2517 uint16_t max_tx_rings;
2519 * The maximum number of transmit rings that can be allocated to
2522 uint16_t max_rx_rings;
2524 * The maximum number of receive rings that can be allocated to
2527 uint16_t max_l2_ctxs;
2529 * The maximum number of L2 contexts that can be allocated to
2534 * The maximum number of VNICs that can be allocated to the
2537 uint16_t first_vf_id;
2539 * The identifier for the first VF enabled on a PF. This is
2540 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2541 * this command is called on a PF with SR-IOV disabled or on a
2546 * The maximum number of VFs that can be allocated to the
2547 * function. This is valid only on the PF with SR-IOV enabled.
2548 * 0xFF... (All Fs) if this command is called on a PF with SR-
2549 * IOV disabled or on a VF.
2551 uint16_t max_stat_ctx;
2553 * The maximum number of statistic contexts that can be
2554 * allocated to the function.
2556 uint32_t max_encap_records;
2558 * The maximum number of Encapsulation records that can be
2559 * offloaded by this function.
2561 uint32_t max_decap_records;
2563 * The maximum number of decapsulation records that can be
2564 * offloaded by this function.
2566 uint32_t max_tx_em_flows;
2568 * The maximum number of Exact Match (EM) flows that can be
2569 * offloaded by this function on the TX side.
2571 uint32_t max_tx_wm_flows;
2573 * The maximum number of Wildcard Match (WM) flows that can be
2574 * offloaded by this function on the TX side.
2576 uint32_t max_rx_em_flows;
2578 * The maximum number of Exact Match (EM) flows that can be
2579 * offloaded by this function on the RX side.
2581 uint32_t max_rx_wm_flows;
2583 * The maximum number of Wildcard Match (WM) flows that can be
2584 * offloaded by this function on the RX side.
2586 uint32_t max_mcast_filters;
2588 * The maximum number of multicast filters that can be supported
2589 * by this function on the RX side.
2591 uint32_t max_flow_id;
2593 * The maximum value of flow_id that can be supported in
2594 * completion records.
2596 uint32_t max_hw_ring_grps;
2598 * The maximum number of HW ring groups that can be supported on
2601 uint16_t max_sp_tx_rings;
2603 * The maximum number of strict priority transmit rings that can
2604 * be allocated to the function. This number indicates the
2605 * maximum number of TX rings that can be assigned strict
2606 * priorities out of the maximum number of TX rings that can be
2607 * allocated (max_tx_rings) to the function.
2612 * This field is used in Output records to indicate that the
2613 * output is completely written to RAM. This field should be
2614 * read as '1' to indicate that the output has been completely
2615 * written. When writing a command completion or response to an
2616 * internal processor, the order of writes has to be such that
2617 * this field is written last.
2619 } __attribute__((packed));
2621 /* hwrm_func_qcfg */
2623 * Description: This command returns the current configuration of a function.
2624 * The input FID value is used to indicate what function is being queried. This
2625 * allows a physical function driver to query virtual functions that are
2626 * children of the physical function. The output FID value is needed to
2627 * configure Rings and MSI-X vectors so their DMA operations appear correctly on
2628 * the PCI bus. This command should be called by every driver after
2629 * 'hwrm_func_cfg' to get the actual number of resources allocated by the HWRM.
2630 * The values returned by hwrm_func_qcfg are the values the driver shall use.
2631 * These values may be different than what was originally requested in the
2632 * 'hwrm_func_cfg' command.
2634 /* Input (24 bytes) */
2635 struct hwrm_func_qcfg_input {
2638 * This value indicates what type of request this is. The format
2639 * for the rest of the command is determined by this field.
2643 * This value indicates the what completion ring the request
2644 * will be optionally completed on. If the value is -1, then no
2645 * CR completion will be generated. Any other value must be a
2646 * valid CR ring_id value for this function.
2649 /* This value indicates the command sequence number. */
2652 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2653 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2658 * This is the host address where the response will be written
2659 * when the request is complete. This area must be 16B aligned
2660 * and must be cleared to zero before the request is made.
2664 * Function ID of the function that is being queried. 0xFF...
2665 * (All Fs) if the query is for the requesting function.
2667 uint16_t unused_0[3];
2668 } __attribute__((packed));
2670 /* Output (72 bytes) */
2671 struct hwrm_func_qcfg_output {
2672 uint16_t error_code;
2674 * Pass/Fail or error type Note: receiver to verify the in
2675 * parameters, and fail the call with an error when appropriate
2678 /* This field returns the type of original request. */
2680 /* This field provides original sequence number of the command. */
2683 * This field is the length of the response in bytes. The last
2684 * byte of the response is a valid flag that will read as '1'
2685 * when the command has been completely written to memory.
2689 * FID value. This value is used to identify operations on the
2690 * PCI bus as belonging to a particular PCI function.
2694 * Port ID of port that this function is associated with.
2695 * 0xFF... (All Fs) if this function is not associated with any
2700 * This value is the current VLAN setting for this function. The
2701 * value of 0 for this field indicates no priority tagging or
2702 * VLAN is used. This field's format is same as 802.1Q Tag's Tag
2703 * Control Information (TCI) format that includes both Priority
2704 * Code Point (PCP) and VLAN Identifier (VID).
2708 * If 1, then magic packet based Out-Of-Box WoL is enabled on
2709 * the port associated with this function.
2711 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
2714 * If 1, then bitmap pattern based Out-Of-Box WoL packet is
2715 * enabled on the port associated with this function.
2717 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED UINT32_C(0x2)
2719 * If set to 1, then FW based DCBX agent is enabled and running
2720 * on the port associated with this function. If set to 0, then
2721 * DCBX agent is not running in the firmware.
2723 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
2726 * Standard TX Ring mode is used for the allocation of TX ring
2727 * and underlying scheduling resources that allow bandwidth
2728 * reservation and limit settings on the queried function. If
2729 * set to 1, then standard TX ring mode is enabled on the
2730 * queried function. If set to 0, then the standard TX ring mode
2731 * is disabled on the queried function. In this extended TX ring
2732 * resource mode, the minimum and maximum bandwidth settings are
2733 * not supported to allow the allocation of TX rings to span
2734 * multiple scheduler nodes.
2736 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
2739 * If set to 1 then FW based LLDP agent is enabled and running
2740 * on the port associated with this function. If set to 0 then
2741 * the LLDP agent is not running in the firmware.
2743 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED UINT32_C(0x10)
2745 * If set to 1, then multi-host mode is active for this
2746 * function. If set to 0, then multi-host mode is inactive for
2747 * this function or not applicable for this device.
2749 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST UINT32_C(0x20)
2750 uint8_t mac_address[6];
2752 * This value is current MAC address configured for this
2753 * function. A value of 00-00-00-00-00-00 indicates no MAC
2754 * address is currently configured.
2758 * This value is current PCI ID of this function. If ARI is
2759 * enabled, then it is Bus Number (8b):Function Number(8b).
2760 * Otherwise, it is Bus Number (8b):Device Number (4b):Function
2763 uint16_t alloc_rsscos_ctx;
2765 * The number of RSS/COS contexts currently allocated to the
2768 uint16_t alloc_cmpl_rings;
2770 * The number of completion rings currently allocated to the
2771 * function. This does not include the rings allocated to any
2772 * children functions if any.
2774 uint16_t alloc_tx_rings;
2776 * The number of transmit rings currently allocated to the
2777 * function. This does not include the rings allocated to any
2778 * children functions if any.
2780 uint16_t alloc_rx_rings;
2782 * The number of receive rings currently allocated to the
2783 * function. This does not include the rings allocated to any
2784 * children functions if any.
2786 uint16_t alloc_l2_ctx;
2787 /* The allocated number of L2 contexts to the function. */
2788 uint16_t alloc_vnics;
2789 /* The allocated number of vnics to the function. */
2792 * The maximum transmission unit of the function. For rings
2793 * allocated on this function, this default value is used if
2794 * ring MTU is not specified.
2798 * The maximum receive unit of the function. For vnics allocated
2799 * on this function, this default value is used if vnic MRU is
2802 uint16_t stat_ctx_id;
2803 /* The statistics context assigned to a function. */
2804 uint8_t port_partition_type;
2806 * The HWRM shall return Unknown value for this field when this
2807 * command is used to query VF's configuration.
2809 /* Single physical function */
2810 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF UINT32_C(0x0)
2811 /* Multiple physical functions */
2812 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS UINT32_C(0x1)
2813 /* Network Partitioning 1.0 */
2814 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
2815 /* Network Partitioning 1.5 */
2816 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
2817 /* Network Partitioning 2.0 */
2818 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
2820 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
2821 uint8_t port_pf_cnt;
2823 * This field will indicate number of physical functions on this
2824 * port_partition. HWRM shall return unavail (i.e. value of 0)
2825 * for this field when this command is used to query VF's
2826 * configuration or from older firmware that doesn't support
2829 /* number of PFs is not available */
2830 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
2831 uint16_t dflt_vnic_id;
2832 /* The default VNIC ID assigned to a function that is being queried. */
2833 uint16_t max_mtu_configured;
2835 * This value specifies the MAX MTU that can be configured by
2836 * host drivers. This 'max_mtu_configure' can be HW max MTU or
2837 * OEM applications specified value. Host drivers can't
2838 * configure the MTU greater than this value. Host drivers
2839 * should read this value prior to configuring the MTU. FW will
2840 * fail the host request with MTU greater than
2841 * 'max_mtu_configured'.
2845 * Minimum BW allocated for this function. The HWRM will
2846 * translate this value into byte counter and time interval used
2847 * for the scheduler inside the device. A value of 0 indicates
2848 * the minimum bandwidth is not configured.
2850 /* The bandwidth value. */
2851 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
2852 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT 0
2853 /* The granularity of the value (bits or bytes). */
2854 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE UINT32_C(0x10000000)
2855 /* Value is in bits. */
2856 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
2857 /* Value is in bytes. */
2858 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
2859 (UINT32_C(0x1) << 28)
2860 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
2861 FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
2862 /* bw_value_unit is 3 b */
2863 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
2864 UINT32_C(0xe0000000)
2865 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
2866 /* Value is in Mb or MB (base 10). */
2867 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
2868 (UINT32_C(0x0) << 29)
2869 /* Value is in Kb or KB (base 10). */
2870 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
2871 (UINT32_C(0x2) << 29)
2872 /* Value is in bits or bytes. */
2873 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
2874 (UINT32_C(0x4) << 29)
2875 /* Value is in Gb or GB (base 10). */
2876 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
2877 (UINT32_C(0x6) << 29)
2878 /* Value is in 1/100th of a percentage of total bandwidth. */
2879 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
2880 (UINT32_C(0x1) << 29)
2882 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
2883 (UINT32_C(0x7) << 29)
2884 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
2885 FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
2888 * Maximum BW allocated for this function. The HWRM will
2889 * translate this value into byte counter and time interval used
2890 * for the scheduler inside the device. A value of 0 indicates
2891 * that the maximum bandwidth is not configured.
2893 /* The bandwidth value. */
2894 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
2895 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT 0
2896 /* The granularity of the value (bits or bytes). */
2897 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE UINT32_C(0x10000000)
2898 /* Value is in bits. */
2899 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
2900 /* Value is in bytes. */
2901 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
2902 (UINT32_C(0x1) << 28)
2903 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
2904 FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
2905 /* bw_value_unit is 3 b */
2906 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
2907 UINT32_C(0xe0000000)
2908 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
2909 /* Value is in Mb or MB (base 10). */
2910 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
2911 (UINT32_C(0x0) << 29)
2912 /* Value is in Kb or KB (base 10). */
2913 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
2914 (UINT32_C(0x2) << 29)
2915 /* Value is in bits or bytes. */
2916 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
2917 (UINT32_C(0x4) << 29)
2918 /* Value is in Gb or GB (base 10). */
2919 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
2920 (UINT32_C(0x6) << 29)
2921 /* Value is in 1/100th of a percentage of total bandwidth. */
2922 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
2923 (UINT32_C(0x1) << 29)
2925 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
2926 (UINT32_C(0x7) << 29)
2927 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
2928 FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
2931 * This value indicates the Edge virtual bridge mode for the
2932 * domain that this function belongs to.
2934 /* No Edge Virtual Bridging (EVB) */
2935 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
2936 /* Virtual Ethernet Bridge (VEB) */
2937 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB UINT32_C(0x1)
2938 /* Virtual Ethernet Port Aggregator (VEPA) */
2939 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA UINT32_C(0x2)
2943 * The number of VFs that are allocated to the function. This is
2944 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2945 * this command is called on a PF with SR-IOV disabled or on a
2948 uint32_t alloc_mcast_filters;
2950 * The number of allocated multicast filters for this function
2953 uint32_t alloc_hw_ring_grps;
2954 /* The number of allocated HW ring groups for this function. */
2955 uint16_t alloc_sp_tx_rings;
2957 * The number of strict priority transmit rings out of currently
2958 * allocated TX rings to the function (alloc_tx_rings).
2963 * This field is used in Output records to indicate that the
2964 * output is completely written to RAM. This field should be
2965 * read as '1' to indicate that the output has been completely
2966 * written. When writing a command completion or response to an
2967 * internal processor, the order of writes has to be such that
2968 * this field is written last.
2970 } __attribute__((packed));
2972 /* hwrm_func_vlan_qcfg */
2974 * Description: This command should be called by PF driver to get the current
2975 * C-TAG, S-TAG and correcponsing PCP and TPID values configured for the
2978 /* Input (24 bytes) */
2979 struct hwrm_func_vlan_qcfg_input {
2982 * This value indicates what type of request this is. The format
2983 * for the rest of the command is determined by this field.
2987 * This value indicates the what completion ring the request
2988 * will be optionally completed on. If the value is -1, then no
2989 * CR completion will be generated. Any other value must be a
2990 * valid CR ring_id value for this function.
2993 /* This value indicates the command sequence number. */
2996 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2997 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3002 * This is the host address where the response will be written
3003 * when the request is complete. This area must be 16B aligned
3004 * and must be cleared to zero before the request is made.
3008 * Function ID of the function that is being configured. If set
3009 * to 0xFF... (All Fs), then the configuration is for the
3010 * requesting function.
3012 uint16_t unused_0[3];
3015 /* Output (40 bytes) */
3016 struct hwrm_func_vlan_qcfg_output {
3017 uint16_t error_code;
3019 * Pass/Fail or error type Note: receiver to verify the in
3020 * parameters, and fail the call with an error when appropriate
3023 /* This field returns the type of original request. */
3025 /* This field provides original sequence number of the command. */
3028 * This field is the length of the response in bytes. The last
3029 * byte of the response is a valid flag that will read as '1'
3030 * when the command has been completely written to memory.
3038 * This field is used in Output records to indicate that the
3039 * output is completely written to RAM. This field should be
3040 * read as '1' to indicate that the output has been completely
3041 * written. When writing a command completion or response to an
3042 * internal processor, the order of writes has to be such that
3043 * this field is written last.
3046 /* S-TAG VLAN identifier configured for the function. */
3048 /* S-TAG PCP value configured for the function. */
3052 * S-TAG TPID value configured for the function. This field is
3053 * specified in network byte order.
3056 /* C-TAG VLAN identifier configured for the function. */
3058 /* C-TAG PCP value configured for the function. */
3062 * C-TAG TPID value configured for the function. This field is
3063 * specified in network byte order.
3072 /* hwrm_func_vlan_cfg */
3074 * Description: This command allows PF driver to configure C-TAG, S-TAG and
3075 * corresponding PCP and TPID values for a function.
3077 /* Input (48 bytes) */
3078 struct hwrm_func_vlan_cfg_input {
3081 * This value indicates what type of request this is. The format
3082 * for the rest of the command is determined by this field.
3086 * This value indicates the what completion ring the request
3087 * will be optionally completed on. If the value is -1, then no
3088 * CR completion will be generated. Any other value must be a
3089 * valid CR ring_id value for this function.
3092 /* This value indicates the command sequence number. */
3095 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3096 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3101 * This is the host address where the response will be written
3102 * when the request is complete. This area must be 16B aligned
3103 * and must be cleared to zero before the request is made.
3107 * Function ID of the function that is being configured. If set
3108 * to 0xFF... (All Fs), then the configuration is for the
3109 * requesting function.
3114 /* This bit must be '1' for the stag_vid field to be configured. */
3115 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID UINT32_C(0x1)
3116 /* This bit must be '1' for the ctag_vid field to be configured. */
3117 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID UINT32_C(0x2)
3118 /* This bit must be '1' for the stag_pcp field to be configured. */
3119 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP UINT32_C(0x4)
3120 /* This bit must be '1' for the ctag_pcp field to be configured. */
3121 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP UINT32_C(0x8)
3122 /* This bit must be '1' for the stag_tpid field to be configured. */
3123 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID UINT32_C(0x10)
3124 /* This bit must be '1' for the ctag_tpid field to be configured. */
3125 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID UINT32_C(0x20)
3127 /* S-TAG VLAN identifier configured for the function. */
3129 /* S-TAG PCP value configured for the function. */
3133 * S-TAG TPID value configured for the function. This field is
3134 * specified in network byte order.
3137 /* C-TAG VLAN identifier configured for the function. */
3139 /* C-TAG PCP value configured for the function. */
3143 * C-TAG TPID value configured for the function. This field is
3144 * specified in network byte order.
3153 /* Output (16 bytes) */
3154 struct hwrm_func_vlan_cfg_output {
3155 uint16_t error_code;
3157 * Pass/Fail or error type Note: receiver to verify the in
3158 * parameters, and fail the call with an error when appropriate
3161 /* This field returns the type of original request. */
3163 /* This field provides original sequence number of the command. */
3166 * This field is the length of the response in bytes. The last
3167 * byte of the response is a valid flag that will read as '1'
3168 * when the command has been completely written to memory.
3176 * This field is used in Output records to indicate that the
3177 * output is completely written to RAM. This field should be
3178 * read as '1' to indicate that the output has been completely
3179 * written. When writing a command completion or response to an
3180 * internal processor, the order of writes has to be such that
3181 * this field is written last.
3187 * Description: This command allows configuration of a PF by the corresponding
3188 * PF driver. This command also allows configuration of a child VF by its parent
3189 * PF driver. The input FID value is used to indicate what function is being
3190 * configured. This allows a PF driver to configure the PF owned by itself or a
3191 * virtual function that is a child of the PF. This command allows to reserve
3192 * resources for a VF by its parent PF. To reverse the process, the command
3193 * should be called with all enables flags cleared for resources. This will free
3194 * allocated resources for the VF and return them to the resource pool. If this
3195 * command is requested by a VF driver to configure or reserve resources, then
3196 * the HWRM shall fail this command. If default MAC address and/or VLAN are
3197 * provided in this command, then the HWRM shall set up appropriate MAC/VLAN
3198 * filters for the function that is being configured. If source properties
3199 * checks are enabled and default MAC address and/or IP address are provided in
3200 * this command, then the HWRM shall set appropriate source property checks
3201 * based on provided MAC and/or IP addresses. The parent PF driver should not
3202 * set MTU/MRU for a VF using this command. This is to allow MTU/MRU setting by
3203 * the VF driver. If the MTU or MRU for a VF is set by the PF driver, then the
3204 * HWRM should ignore it. A function's MTU/MRU should be set prior to allocating
3205 * RX VNICs or TX rings. A PF driver calls hwrm_func_cfg to allocate resources
3206 * for itself or its children VFs. All function drivers shall call hwrm_func_cfg
3207 * to reserve resources. A request to hwrm_func_cfg may not be fully granted;
3208 * that is, a request for resources may be larger than what can be supported by
3209 * the device and the HWRM will allocate the best set of resources available,
3210 * but that may be less than requested. If all the amounts requested could not
3211 * be fulfilled, the HWRM shall allocate what it could and return a status code
3212 * of success. A function driver should call hwrm_func_qcfg immediately after
3213 * hwrm_func_cfg to determine what resources were assigned to the configured
3214 * function. A call by a PF driver to hwrm_func_cfg to allocate resources for
3215 * itself shall only allocate resources for the PF driver to use, not for its
3216 * children VFs. Likewise, a call to hwrm_func_qcfg shall return the resources
3217 * available for the PF driver to use, not what is available to its children
3220 /* Input (88 bytes) */
3221 struct hwrm_func_cfg_input {
3224 * This value indicates what type of request this is. The format
3225 * for the rest of the command is determined by this field.
3229 * This value indicates the what completion ring the request
3230 * will be optionally completed on. If the value is -1, then no
3231 * CR completion will be generated. Any other value must be a
3232 * valid CR ring_id value for this function.
3235 /* This value indicates the command sequence number. */
3238 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3239 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3244 * This is the host address where the response will be written
3245 * when the request is complete. This area must be 16B aligned
3246 * and must be cleared to zero before the request is made.
3250 * Function ID of the function that is being configured. If set
3251 * to 0xFF... (All Fs), then the configuration is for the
3252 * requesting function.
3258 * When this bit is '1', the function is disabled with source
3259 * MAC address check. This is an anti-spoofing check. If this
3260 * flag is set, then the function shall be configured to
3261 * disallow transmission of frames with the source MAC address
3262 * that is configured for this function.
3264 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
3267 * When this bit is '1', the function is enabled with source MAC
3268 * address check. This is an anti-spoofing check. If this flag
3269 * is set, then the function shall be configured to allow
3270 * transmission of frames with the source MAC address that is
3271 * configured for this function.
3273 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
3276 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK UINT32_C(0x1fc)
3277 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT 2
3279 * Standard TX Ring mode is used for the allocation of TX ring
3280 * and underlying scheduling resources that allow bandwidth
3281 * reservation and limit settings on the queried function. If
3282 * set to 1, then standard TX ring mode is requested to be
3283 * enabled on the function being configured.
3285 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
3288 * Standard TX Ring mode is used for the allocation of TX ring
3289 * and underlying scheduling resources that allow bandwidth
3290 * reservation and limit settings on the queried function. If
3291 * set to 1, then the standard TX ring mode is requested to be
3292 * disabled on the function being configured. In this extended
3293 * TX ring resource mode, the minimum and maximum bandwidth
3294 * settings are not supported to allow the allocation of TX
3295 * rings to span multiple scheduler nodes.
3297 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
3300 * If this bit is set, virtual mac address configured in this
3301 * command will be persistent over warm boot.
3303 #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST UINT32_C(0x800)
3305 * This bit only applies to the VF. If this bit is set, the
3306 * statistic context counters will not be cleared when the
3307 * statistic context is freed or a function reset is called on
3308 * VF. This bit will be cleared when the PF is unloaded or a
3309 * function reset is called on the PF.
3311 #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
3314 * This bit requests that the firmware test to see if all the
3315 * assets requested in this command (i.e. number of TX rings)
3316 * are available. The firmware will return an error if the
3317 * requested assets are not available. The firwmare will NOT
3318 * reserve the assets if they are available.
3320 #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST UINT32_C(0x2000)
3322 /* This bit must be '1' for the mtu field to be configured. */
3323 #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
3324 /* This bit must be '1' for the mru field to be configured. */
3325 #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU UINT32_C(0x2)
3327 * This bit must be '1' for the num_rsscos_ctxs field to be
3330 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS UINT32_C(0x4)
3332 * This bit must be '1' for the num_cmpl_rings field to be
3335 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS UINT32_C(0x8)
3336 /* This bit must be '1' for the num_tx_rings field to be configured. */
3337 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS UINT32_C(0x10)
3338 /* This bit must be '1' for the num_rx_rings field to be configured. */
3339 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS UINT32_C(0x20)
3340 /* This bit must be '1' for the num_l2_ctxs field to be configured. */
3341 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS UINT32_C(0x40)
3342 /* This bit must be '1' for the num_vnics field to be configured. */
3343 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS UINT32_C(0x80)
3345 * This bit must be '1' for the num_stat_ctxs field to be
3348 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS UINT32_C(0x100)
3350 * This bit must be '1' for the dflt_mac_addr field to be
3353 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x200)
3354 /* This bit must be '1' for the dflt_vlan field to be configured. */
3355 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN UINT32_C(0x400)
3356 /* This bit must be '1' for the dflt_ip_addr field to be configured. */
3357 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR UINT32_C(0x800)
3358 /* This bit must be '1' for the min_bw field to be configured. */
3359 #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW UINT32_C(0x1000)
3360 /* This bit must be '1' for the max_bw field to be configured. */
3361 #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW UINT32_C(0x2000)
3363 * This bit must be '1' for the async_event_cr field to be
3366 #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4000)
3368 * This bit must be '1' for the vlan_antispoof_mode field to be
3371 #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE UINT32_C(0x8000)
3373 * This bit must be '1' for the allowed_vlan_pris field to be
3376 #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS UINT32_C(0x10000)
3377 /* This bit must be '1' for the evb_mode field to be configured. */
3378 #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE UINT32_C(0x20000)
3380 * This bit must be '1' for the num_mcast_filters field to be
3383 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS UINT32_C(0x40000)
3385 * This bit must be '1' for the num_hw_ring_grps field to be
3388 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS UINT32_C(0x80000)
3391 * The maximum transmission unit of the function. The HWRM
3392 * should make sure that the mtu of the function does not exceed
3393 * the mtu of the physical port that this function is associated
3394 * with. In addition to configuring mtu per function, it is
3395 * possible to configure mtu per transmit ring. By default, the
3396 * mtu of each transmit ring associated with a function is equal
3397 * to the mtu of the function. The HWRM should make sure that
3398 * the mtu of each transmit ring that is assigned to a function
3403 * The maximum receive unit of the function. The HWRM should
3404 * make sure that the mru of the function does not exceed the
3405 * mru of the physical port that this function is associated
3406 * with. In addition to configuring mru per function, it is
3407 * possible to configure mru per vnic. By default, the mru of
3408 * each vnic associated with a function is equal to the mru of
3409 * the function. The HWRM should make sure that the mru of each
3410 * vnic that is assigned to a function has a valid mru.
3412 uint16_t num_rsscos_ctxs;
3413 /* The number of RSS/COS contexts requested for the function. */
3414 uint16_t num_cmpl_rings;
3416 * The number of completion rings requested for the function.
3417 * This does not include the rings allocated to any children
3420 uint16_t num_tx_rings;
3422 * The number of transmit rings requested for the function. This
3423 * does not include the rings allocated to any children
3426 uint16_t num_rx_rings;
3428 * The number of receive rings requested for the function. This
3429 * does not include the rings allocated to any children
3432 uint16_t num_l2_ctxs;
3433 /* The requested number of L2 contexts for the function. */
3435 /* The requested number of vnics for the function. */
3436 uint16_t num_stat_ctxs;
3437 /* The requested number of statistic contexts for the function. */
3438 uint16_t num_hw_ring_grps;
3440 * The number of HW ring groups that should be reserved for this
3443 uint8_t dflt_mac_addr[6];
3444 /* The default MAC address for the function being configured. */
3447 * The default VLAN for the function being configured. This
3448 * field's format is same as 802.1Q Tag's Tag Control
3449 * Information (TCI) format that includes both Priority Code
3450 * Point (PCP) and VLAN Identifier (VID).
3452 uint32_t dflt_ip_addr[4];
3454 * The default IP address for the function being configured.
3455 * This address is only used in enabling source property check.
3459 * Minimum BW allocated for this function. The HWRM will
3460 * translate this value into byte counter and time interval used
3461 * for the scheduler inside the device.
3463 /* The bandwidth value. */
3464 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
3465 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT 0
3466 /* The granularity of the value (bits or bytes). */
3467 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE UINT32_C(0x10000000)
3468 /* Value is in bits. */
3469 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
3470 /* Value is in bytes. */
3471 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
3472 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
3473 FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
3474 /* bw_value_unit is 3 b */
3475 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
3476 UINT32_C(0xe0000000)
3477 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
3478 /* Value is in Mb or MB (base 10). */
3479 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
3480 (UINT32_C(0x0) << 29)
3481 /* Value is in Kb or KB (base 10). */
3482 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
3483 (UINT32_C(0x2) << 29)
3484 /* Value is in bits or bytes. */
3485 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
3486 (UINT32_C(0x4) << 29)
3487 /* Value is in Gb or GB (base 10). */
3488 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
3489 (UINT32_C(0x6) << 29)
3490 /* Value is in 1/100th of a percentage of total bandwidth. */
3491 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
3492 (UINT32_C(0x1) << 29)
3494 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
3495 (UINT32_C(0x7) << 29)
3496 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
3497 FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
3500 * Maximum BW allocated for this function. The HWRM will
3501 * translate this value into byte counter and time interval used
3502 * for the scheduler inside the device.
3504 /* The bandwidth value. */
3505 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
3507 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT 0
3508 /* The granularity of the value (bits or bytes). */
3509 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
3510 /* Value is in bits. */
3511 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
3512 /* Value is in bytes. */
3513 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
3514 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
3515 FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
3516 /* bw_value_unit is 3 b */
3517 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
3518 UINT32_C(0xe0000000)
3519 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
3520 /* Value is in Mb or MB (base 10). */
3521 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
3522 (UINT32_C(0x0) << 29)
3523 /* Value is in Kb or KB (base 10). */
3524 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
3525 (UINT32_C(0x2) << 29)
3526 /* Value is in bits or bytes. */
3527 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
3528 (UINT32_C(0x4) << 29)
3529 /* Value is in Gb or GB (base 10). */
3530 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
3531 (UINT32_C(0x6) << 29)
3532 /* Value is in 1/100th of a percentage of total bandwidth. */
3533 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
3534 (UINT32_C(0x1) << 29)
3536 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
3537 (UINT32_C(0x7) << 29)
3538 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
3539 FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
3540 uint16_t async_event_cr;
3542 * ID of the target completion ring for receiving asynchronous
3543 * event completions. If this field is not valid, then the HWRM
3544 * shall use the default completion ring of the function that is
3545 * being configured as the target completion ring for providing
3546 * any asynchronous event completions for that function. If this
3547 * field is valid, then the HWRM shall use the completion ring
3548 * identified by this ID as the target completion ring for
3549 * providing any asynchronous event completions for the function
3550 * that is being configured.
3552 uint8_t vlan_antispoof_mode;
3553 /* VLAN Anti-spoofing mode. */
3554 /* No VLAN anti-spoofing checks are enabled */
3555 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK UINT32_C(0x0)
3556 /* Validate VLAN against the configured VLAN(s) */
3557 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
3559 /* Insert VLAN if it does not exist, otherwise discard */
3560 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
3563 * Insert VLAN if it does not exist, override
3567 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
3569 uint8_t allowed_vlan_pris;
3571 * This bit field defines VLAN PRIs that are allowed on this
3572 * function. If nth bit is set, then VLAN PRI n is allowed on
3577 * The HWRM shall allow a PF driver to change EVB mode for the
3578 * partition it belongs to. The HWRM shall not allow a VF driver
3579 * to change the EVB mode. The HWRM shall take into account the
3580 * switching of EVB mode from one to another and reconfigure
3581 * hardware resources as appropriately. The switching from VEB
3582 * to VEPA mode requires the disabling of the loopback traffic.
3583 * Additionally, source knock outs are handled differently in
3584 * VEB and VEPA modes.
3586 /* No Edge Virtual Bridging (EVB) */
3587 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
3588 /* Virtual Ethernet Bridge (VEB) */
3589 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB UINT32_C(0x1)
3590 /* Virtual Ethernet Port Aggregator (VEPA) */
3591 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA UINT32_C(0x2)
3593 uint16_t num_mcast_filters;
3595 * The number of multicast filters that should be reserved for
3596 * this function on the RX side.
3598 } __attribute__((packed));
3600 /* Output (16 bytes) */
3601 struct hwrm_func_cfg_output {
3602 uint16_t error_code;
3604 * Pass/Fail or error type Note: receiver to verify the in
3605 * parameters, and fail the call with an error when appropriate
3608 /* This field returns the type of original request. */
3610 /* This field provides original sequence number of the command. */
3613 * This field is the length of the response in bytes. The last
3614 * byte of the response is a valid flag that will read as '1'
3615 * when the command has been completely written to memory.
3623 * This field is used in Output records to indicate that the
3624 * output is completely written to RAM. This field should be
3625 * read as '1' to indicate that the output has been completely
3626 * written. When writing a command completion or response to an
3627 * internal processor, the order of writes has to be such that
3628 * this field is written last.
3630 } __attribute__((packed));
3632 /* hwrm_func_qstats */
3634 * Description: This command returns statistics of a function. The input FID
3635 * value is used to indicate what function is being queried. This allows a
3636 * physical function driver to query virtual functions that are children of the
3637 * physical function. The HWRM shall return any unsupported counter with a value
3638 * of 0xFFFFFFFF for 32-bit counters and 0xFFFFFFFFFFFFFFFF for 64-bit counters.
3640 /* Input (24 bytes) */
3641 struct hwrm_func_qstats_input {
3644 * This value indicates what type of request this is. The format
3645 * for the rest of the command is determined by this field.
3649 * This value indicates the what completion ring the request
3650 * will be optionally completed on. If the value is -1, then no
3651 * CR completion will be generated. Any other value must be a
3652 * valid CR ring_id value for this function.
3655 /* This value indicates the command sequence number. */
3658 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3659 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3664 * This is the host address where the response will be written
3665 * when the request is complete. This area must be 16B aligned
3666 * and must be cleared to zero before the request is made.
3670 * Function ID of the function that is being queried. 0xFF...
3671 * (All Fs) if the query is for the requesting function.
3673 uint16_t unused_0[3];
3674 } __attribute__((packed));
3676 /* Output (176 bytes) */
3677 struct hwrm_func_qstats_output {
3678 uint16_t error_code;
3680 * Pass/Fail or error type Note: receiver to verify the in
3681 * parameters, and fail the call with an error when appropriate
3684 /* This field returns the type of original request. */
3686 /* This field provides original sequence number of the command. */
3689 * This field is the length of the response in bytes. The last
3690 * byte of the response is a valid flag that will read as '1'
3691 * when the command has been completely written to memory.
3693 uint64_t tx_ucast_pkts;
3694 /* Number of transmitted unicast packets on the function. */
3695 uint64_t tx_mcast_pkts;
3696 /* Number of transmitted multicast packets on the function. */
3697 uint64_t tx_bcast_pkts;
3698 /* Number of transmitted broadcast packets on the function. */
3699 uint64_t tx_err_pkts;
3701 * Number of transmitted packets that were discarded due to
3702 * internal NIC resource problems. For transmit, this can only
3703 * happen if TMP is configured to allow dropping in HOL blocking
3704 * conditions, which is not a normal configuration.
3706 uint64_t tx_drop_pkts;
3708 * Number of dropped packets on transmit path on the function.
3709 * These are packets that have been marked for drop by the TE
3710 * CFA block or are packets that exceeded the transmit MTU limit
3713 uint64_t tx_ucast_bytes;
3714 /* Number of transmitted bytes for unicast traffic on the function. */
3715 uint64_t tx_mcast_bytes;
3717 * Number of transmitted bytes for multicast traffic on the
3720 uint64_t tx_bcast_bytes;
3722 * Number of transmitted bytes for broadcast traffic on the
3725 uint64_t rx_ucast_pkts;
3726 /* Number of received unicast packets on the function. */
3727 uint64_t rx_mcast_pkts;
3728 /* Number of received multicast packets on the function. */
3729 uint64_t rx_bcast_pkts;
3730 /* Number of received broadcast packets on the function. */
3731 uint64_t rx_err_pkts;
3733 * Number of received packets that were discarded on the
3734 * function due to resource limitations. This can happen for 3
3735 * reasons. # The BD used for the packet has a bad format. #
3736 * There were no BDs available in the ring for the packet. #
3737 * There were no BDs available on-chip for the packet.
3739 uint64_t rx_drop_pkts;
3741 * Number of dropped packets on received path on the function.
3742 * These are packets that have been marked for drop by the RE
3745 uint64_t rx_ucast_bytes;
3746 /* Number of received bytes for unicast traffic on the function. */
3747 uint64_t rx_mcast_bytes;
3748 /* Number of received bytes for multicast traffic on the function. */
3749 uint64_t rx_bcast_bytes;
3750 /* Number of received bytes for broadcast traffic on the function. */
3751 uint64_t rx_agg_pkts;
3752 /* Number of aggregated unicast packets on the function. */
3753 uint64_t rx_agg_bytes;
3754 /* Number of aggregated unicast bytes on the function. */
3755 uint64_t rx_agg_events;
3756 /* Number of aggregation events on the function. */
3757 uint64_t rx_agg_aborts;
3758 /* Number of aborted aggregations on the function. */
3765 * This field is used in Output records to indicate that the
3766 * output is completely written to RAM. This field should be
3767 * read as '1' to indicate that the output has been completely
3768 * written. When writing a command completion or response to an
3769 * internal processor, the order of writes has to be such that
3770 * this field is written last.
3772 } __attribute__((packed));
3774 /* hwrm_func_clr_stats */
3776 * Description: This command clears statistics of a function. The input FID
3777 * value is used to indicate what function's statistics is being cleared. This
3778 * allows a physical function driver to clear statistics of virtual functions
3779 * that are children of the physical function.
3781 /* Input (24 bytes) */
3782 struct hwrm_func_clr_stats_input {
3785 * This value indicates what type of request this is. The format
3786 * for the rest of the command is determined by this field.
3790 * This value indicates the what completion ring the request
3791 * will be optionally completed on. If the value is -1, then no
3792 * CR completion will be generated. Any other value must be a
3793 * valid CR ring_id value for this function.
3796 /* This value indicates the command sequence number. */
3799 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3800 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3805 * This is the host address where the response will be written
3806 * when the request is complete. This area must be 16B aligned
3807 * and must be cleared to zero before the request is made.
3811 * Function ID of the function. 0xFF... (All Fs) if the query is
3812 * for the requesting function.
3814 uint16_t unused_0[3];
3815 } __attribute__((packed));
3817 /* Output (16 bytes) */
3818 struct hwrm_func_clr_stats_output {
3819 uint16_t error_code;
3821 * Pass/Fail or error type Note: receiver to verify the in
3822 * parameters, and fail the call with an error when appropriate
3825 /* This field returns the type of original request. */
3827 /* This field provides original sequence number of the command. */
3830 * This field is the length of the response in bytes. The last
3831 * byte of the response is a valid flag that will read as '1'
3832 * when the command has been completely written to memory.
3840 * This field is used in Output records to indicate that the
3841 * output is completely written to RAM. This field should be
3842 * read as '1' to indicate that the output has been completely
3843 * written. When writing a command completion or response to an
3844 * internal processor, the order of writes has to be such that
3845 * this field is written last.
3847 } __attribute__((packed));
3849 /* hwrm_func_vf_vnic_ids_query */
3850 /* Description: This command is used to query vf vnic ids. */
3851 /* Input (32 bytes) */
3852 struct hwrm_func_vf_vnic_ids_query_input {
3855 * This value indicates what type of request this is. The format
3856 * for the rest of the command is determined by this field.
3860 * This value indicates the what completion ring the request
3861 * will be optionally completed on. If the value is -1, then no
3862 * CR completion will be generated. Any other value must be a
3863 * valid CR ring_id value for this function.
3866 /* This value indicates the command sequence number. */
3869 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3870 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3875 * This is the host address where the response will be written
3876 * when the request is complete. This area must be 16B aligned
3877 * and must be cleared to zero before the request is made.
3881 * This value is used to identify a Virtual Function (VF). The
3882 * scope of VF ID is local within a PF.
3886 uint32_t max_vnic_id_cnt;
3887 /* Max number of vnic ids in vnic id table */
3888 uint64_t vnic_id_tbl_addr;
3889 /* This is the address for VF VNIC ID table */
3890 } __attribute__((packed));
3892 /* Output (16 bytes) */
3893 struct hwrm_func_vf_vnic_ids_query_output {
3894 uint16_t error_code;
3896 * Pass/Fail or error type Note: receiver to verify the in
3897 * parameters, and fail the call with an error when appropriate
3900 /* This field returns the type of original request. */
3902 /* This field provides original sequence number of the command. */
3905 * This field is the length of the response in bytes. The last
3906 * byte of the response is a valid flag that will read as '1'
3907 * when the command has been completely written to memory.
3909 uint32_t vnic_id_cnt;
3911 * Actual number of vnic ids Each VNIC ID is written as a 32-bit
3919 * This field is used in Output records to indicate that the
3920 * output is completely written to RAM. This field should be
3921 * read as '1' to indicate that the output has been completely
3922 * written. When writing a command completion or response to an
3923 * internal processor, the order of writes has to be such that
3924 * this field is written last.
3926 } __attribute__((packed));
3928 /* hwrm_func_drv_rgtr */
3930 * Description: This command is used by the function driver to register its
3931 * information with the HWRM. A function driver shall implement this command. A
3932 * function driver shall use this command during the driver initialization right
3933 * after the HWRM version discovery and default ring resources allocation.
3935 /* Input (80 bytes) */
3936 struct hwrm_func_drv_rgtr_input {
3939 * This value indicates what type of request this is. The format
3940 * for the rest of the command is determined by this field.
3944 * This value indicates the what completion ring the request
3945 * will be optionally completed on. If the value is -1, then no
3946 * CR completion will be generated. Any other value must be a
3947 * valid CR ring_id value for this function.
3950 /* This value indicates the command sequence number. */
3953 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3954 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3959 * This is the host address where the response will be written
3960 * when the request is complete. This area must be 16B aligned
3961 * and must be cleared to zero before the request is made.
3965 * When this bit is '1', the function driver is requesting all
3966 * requests from its children VF drivers to be forwarded to
3967 * itself. This flag can only be set by the PF driver. If a VF
3968 * driver sets this flag, it should be ignored by the HWRM.
3970 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
3972 * When this bit is '1', the function is requesting none of the
3973 * requests from its children VF drivers to be forwarded to
3974 * itself. This flag can only be set by the PF driver. If a VF
3975 * driver sets this flag, it should be ignored by the HWRM.
3977 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
3979 /* This bit must be '1' for the os_type field to be configured. */
3980 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
3981 /* This bit must be '1' for the ver field to be configured. */
3982 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
3983 /* This bit must be '1' for the timestamp field to be configured. */
3984 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
3985 /* This bit must be '1' for the vf_req_fwd field to be configured. */
3986 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_INPUT_FWD UINT32_C(0x8)
3988 * This bit must be '1' for the async_event_fwd field to be
3991 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD UINT32_C(0x10)
3994 * This value indicates the type of OS. The values are based on
3995 * CIM_OperatingSystem.mof file as published by the DMTF.
3998 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN UINT32_C(0x0)
3999 /* Other OS not listed below. */
4000 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER UINT32_C(0x1)
4002 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS UINT32_C(0xe)
4004 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS UINT32_C(0x12)
4006 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS UINT32_C(0x1d)
4008 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX UINT32_C(0x24)
4010 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD UINT32_C(0x2a)
4011 /* VMware ESXi OS. */
4012 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI UINT32_C(0x68)
4013 /* Microsoft Windows 8 64-bit OS. */
4014 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 UINT32_C(0x73)
4015 /* Microsoft Windows Server 2012 R2 OS. */
4016 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
4018 /* This is the major version of the driver. */
4020 /* This is the minor version of the driver. */
4022 /* This is the update version of the driver. */
4027 * This is a 32-bit timestamp provided by the driver for keep
4028 * alive. The timestamp is in multiples of 1ms.
4031 uint32_t vf_req_fwd[8];
4033 * This is a 256-bit bit mask provided by the PF driver for
4034 * letting the HWRM know what commands issued by the VF driver
4035 * to the HWRM should be forwarded to the PF driver. Nth bit
4036 * refers to the Nth req_type. Setting Nth bit to 1 indicates
4037 * that requests from the VF driver with req_type equal to N
4038 * shall be forwarded to the parent PF driver. This field is not
4039 * valid for the VF driver.
4041 uint32_t async_event_fwd[8];
4043 * This is a 256-bit bit mask provided by the function driver
4044 * (PF or VF driver) to indicate the list of asynchronous event
4045 * completions to be forwarded. Nth bit refers to the Nth
4046 * event_id. Setting Nth bit to 1 by the function driver shall
4047 * result in the HWRM forwarding asynchronous event completion
4048 * with event_id equal to N. If all bits are set to 0 (value of
4049 * 0), then the HWRM shall not forward any asynchronous event
4050 * completion to this function driver.
4052 } __attribute__((packed));
4054 /* Output (16 bytes) */
4055 struct hwrm_func_drv_rgtr_output {
4056 uint16_t error_code;
4058 * Pass/Fail or error type Note: receiver to verify the in
4059 * parameters, and fail the call with an error when appropriate
4062 /* This field returns the type of original request. */
4064 /* This field provides original sequence number of the command. */
4067 * This field is the length of the response in bytes. The last
4068 * byte of the response is a valid flag that will read as '1'
4069 * when the command has been completely written to memory.
4077 * This field is used in Output records to indicate that the
4078 * output is completely written to RAM. This field should be
4079 * read as '1' to indicate that the output has been completely
4080 * written. When writing a command completion or response to an
4081 * internal processor, the order of writes has to be such that
4082 * this field is written last.
4084 } __attribute__((packed));
4086 /* hwrm_func_drv_unrgtr */
4088 * Description: This command is used by the function driver to un register with
4089 * the HWRM. A function driver shall implement this command. A function driver
4090 * shall use this command during the driver unloading.
4092 /* Input (24 bytes) */
4093 struct hwrm_func_drv_unrgtr_input {
4096 * This value indicates what type of request this is. The format
4097 * for the rest of the command is determined by this field.
4101 * This value indicates the what completion ring the request
4102 * will be optionally completed on. If the value is -1, then no
4103 * CR completion will be generated. Any other value must be a
4104 * valid CR ring_id value for this function.
4107 /* This value indicates the command sequence number. */
4110 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4111 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4116 * This is the host address where the response will be written
4117 * when the request is complete. This area must be 16B aligned
4118 * and must be cleared to zero before the request is made.
4122 * When this bit is '1', the function driver is notifying the
4123 * HWRM to prepare for the shutdown.
4125 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
4128 } __attribute__((packed));
4130 /* Output (16 bytes) */
4131 struct hwrm_func_drv_unrgtr_output {
4132 uint16_t error_code;
4134 * Pass/Fail or error type Note: receiver to verify the in
4135 * parameters, and fail the call with an error when appropriate
4138 /* This field returns the type of original request. */
4140 /* This field provides original sequence number of the command. */
4143 * This field is the length of the response in bytes. The last
4144 * byte of the response is a valid flag that will read as '1'
4145 * when the command has been completely written to memory.
4153 * This field is used in Output records to indicate that the
4154 * output is completely written to RAM. This field should be
4155 * read as '1' to indicate that the output has been completely
4156 * written. When writing a command completion or response to an
4157 * internal processor, the order of writes has to be such that
4158 * this field is written last.
4160 } __attribute__((packed));
4162 /* hwrm_func_buf_rgtr */
4164 * Description: This command is used by the PF driver to register buffers used
4165 * in the PF-VF communication with the HWRM. The PF driver uses this command to
4166 * register buffers for each PF-VF channel. A parent PF may issue this command
4167 * per child VF. If VF ID is not valid, then this command is used to register
4168 * buffers for all children VFs of the PF.
4170 /* Input (128 bytes) */
4171 struct hwrm_func_buf_rgtr_input {
4174 * This value indicates what type of request this is. The format
4175 * for the rest of the command is determined by this field.
4179 * This value indicates the what completion ring the request
4180 * will be optionally completed on. If the value is -1, then no
4181 * CR completion will be generated. Any other value must be a
4182 * valid CR ring_id value for this function.
4185 /* This value indicates the command sequence number. */
4188 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4189 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4194 * This is the host address where the response will be written
4195 * when the request is complete. This area must be 16B aligned
4196 * and must be cleared to zero before the request is made.
4199 /* This bit must be '1' for the vf_id field to be configured. */
4200 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
4201 /* This bit must be '1' for the err_buf_addr field to be configured. */
4202 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR UINT32_C(0x2)
4205 * This value is used to identify a Virtual Function (VF). The
4206 * scope of VF ID is local within a PF.
4208 uint16_t req_buf_num_pages;
4210 * This field represents the number of pages used for request
4213 uint16_t req_buf_page_size;
4214 /* This field represents the page size used for request buffer(s). */
4216 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_16B UINT32_C(0x4)
4218 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_4K UINT32_C(0xc)
4220 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_8K UINT32_C(0xd)
4222 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_64K UINT32_C(0x10)
4224 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_2M UINT32_C(0x15)
4226 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_4M UINT32_C(0x16)
4228 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_1G UINT32_C(0x1e)
4229 uint16_t req_buf_len;
4230 /* The length of the request buffer per VF in bytes. */
4231 uint16_t resp_buf_len;
4232 /* The length of the response buffer in bytes. */
4235 uint64_t req_buf_page_addr[10];
4236 /* This field represents the page address of req buffer. */
4237 uint64_t error_buf_addr;
4239 * This field is used to receive the error reporting from the
4240 * chipset. Only applicable for PFs.
4242 uint64_t resp_buf_addr;
4243 /* This field is used to receive the response forwarded by the HWRM. */
4244 } __attribute__((packed));
4246 /* Output (16 bytes) */
4247 struct hwrm_func_buf_rgtr_output {
4248 uint16_t error_code;
4250 * Pass/Fail or error type Note: receiver to verify the in
4251 * parameters, and fail the call with an error when appropriate
4254 /* This field returns the type of original request. */
4256 /* This field provides original sequence number of the command. */
4259 * This field is the length of the response in bytes. The last
4260 * byte of the response is a valid flag that will read as '1'
4261 * when the command has been completely written to memory.
4269 * This field is used in Output records to indicate that the
4270 * output is completely written to RAM. This field should be
4271 * read as '1' to indicate that the output has been completely
4272 * written. When writing a command completion or response to an
4273 * internal processor, the order of writes has to be such that
4274 * this field is written last.
4276 } __attribute__((packed));
4278 /* hwrm_func_buf_unrgtr */
4280 * Description: This command is used by the PF driver to unregister buffers used
4281 * in the PF-VF communication with the HWRM. The PF driver uses this command to
4282 * unregister buffers for PF-VF communication. A parent PF may issue this
4283 * command to unregister buffers for communication between the PF and a specific
4284 * VF. If the VF ID is not valid, then this command is used to unregister
4285 * buffers used for communications with all children VFs of the PF.
4287 /* Input (24 bytes) */
4288 struct hwrm_func_buf_unrgtr_input {
4291 * This value indicates what type of request this is. The format
4292 * for the rest of the command is determined by this field.
4296 * This value indicates the what completion ring the request
4297 * will be optionally completed on. If the value is -1, then no
4298 * CR completion will be generated. Any other value must be a
4299 * valid CR ring_id value for this function.
4302 /* This value indicates the command sequence number. */
4305 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4306 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4311 * This is the host address where the response will be written
4312 * when the request is complete. This area must be 16B aligned
4313 * and must be cleared to zero before the request is made.
4316 /* This bit must be '1' for the vf_id field to be configured. */
4317 #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
4320 * This value is used to identify a Virtual Function (VF). The
4321 * scope of VF ID is local within a PF.
4324 } __attribute__((packed));
4326 /* Output (16 bytes) */
4327 struct hwrm_func_buf_unrgtr_output {
4328 uint16_t error_code;
4330 * Pass/Fail or error type Note: receiver to verify the in
4331 * parameters, and fail the call with an error when appropriate
4334 /* This field returns the type of original request. */
4336 /* This field provides original sequence number of the command. */
4339 * This field is the length of the response in bytes. The last
4340 * byte of the response is a valid flag that will read as '1'
4341 * when the command has been completely written to memory.
4349 * This field is used in Output records to indicate that the
4350 * output is completely written to RAM. This field should be
4351 * read as '1' to indicate that the output has been completely
4352 * written. When writing a command completion or response to an
4353 * internal processor, the order of writes has to be such that
4354 * this field is written last.
4356 } __attribute__((packed));
4358 /* hwrm_port_phy_cfg */
4360 * Description: This command configures the PHY device for the port. It allows
4361 * setting of the most generic settings for the PHY. The HWRM shall complete
4362 * this command as soon as PHY settings are configured. They may not be applied
4363 * when the command response is provided. A VF driver shall not be allowed to
4364 * configure PHY using this command. In a network partition mode, a PF driver
4365 * shall not be allowed to configure PHY using this command.
4367 /* Input (56 bytes) */
4368 struct hwrm_port_phy_cfg_input {
4371 * This value indicates what type of request this is. The format
4372 * for the rest of the command is determined by this field.
4376 * This value indicates the what completion ring the request
4377 * will be optionally completed on. If the value is -1, then no
4378 * CR completion will be generated. Any other value must be a
4379 * valid CR ring_id value for this function.
4382 /* This value indicates the command sequence number. */
4385 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4386 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4391 * This is the host address where the response will be written
4392 * when the request is complete. This area must be 16B aligned
4393 * and must be cleared to zero before the request is made.
4397 * When this bit is set to '1', the PHY for the port shall be
4398 * reset. # If this bit is set to 1, then the HWRM shall reset
4399 * the PHY after applying PHY configuration changes specified in
4400 * this command. # In order to guarantee that PHY configuration
4401 * changes specified in this command take effect, the HWRM
4402 * client should set this flag to 1. # If this bit is not set to
4403 * 1, then the HWRM may reset the PHY depending on the current
4404 * PHY configuration and settings specified in this command.
4406 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
4407 /* deprecated bit. Do not use!!! */
4408 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED UINT32_C(0x2)
4410 * When this bit is set to '1', the link shall be forced to the
4411 * force_link_speed value. When this bit is set to '1', the HWRM
4412 * client should not enable any of the auto negotiation related
4413 * fields represented by auto_XXX fields in this command. When
4414 * this bit is set to '1' and the HWRM client has enabled a
4415 * auto_XXX field in this command, then the HWRM shall ignore
4416 * the enabled auto_XXX field. When this bit is set to zero, the
4417 * link shall be allowed to autoneg.
4419 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
4421 * When this bit is set to '1', the auto-negotiation process
4422 * shall be restarted on the link.
4424 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
4426 * When this bit is set to '1', Energy Efficient Ethernet (EEE)
4427 * is requested to be enabled on this link. If EEE is not
4428 * supported on this port, then this flag shall be ignored by
4431 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
4433 * When this bit is set to '1', Energy Efficient Ethernet (EEE)
4434 * is requested to be disabled on this link. If EEE is not
4435 * supported on this port, then this flag shall be ignored by
4438 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
4440 * When this bit is set to '1' and EEE is enabled on this link,
4441 * then TX LPI is requested to be enabled on the link. If EEE is
4442 * not supported on this port, then this flag shall be ignored
4443 * by the HWRM. If EEE is disabled on this port, then this flag
4444 * shall be ignored by the HWRM.
4446 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE UINT32_C(0x40)
4448 * When this bit is set to '1' and EEE is enabled on this link,
4449 * then TX LPI is requested to be disabled on the link. If EEE
4450 * is not supported on this port, then this flag shall be
4451 * ignored by the HWRM. If EEE is disabled on this port, then
4452 * this flag shall be ignored by the HWRM.
4454 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE UINT32_C(0x80)
4456 * When set to 1, then the HWRM shall enable FEC
4457 * autonegotitation on this port if supported. When set to 0,
4458 * then this flag shall be ignored. If FEC autonegotiation is
4459 * not supported, then the HWRM shall ignore this flag.
4461 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE UINT32_C(0x100)
4463 * When set to 1, then the HWRM shall disable FEC
4464 * autonegotiation on this port if supported. When set to 0,
4465 * then this flag shall be ignored. If FEC autonegotiation is
4466 * not supported, then the HWRM shall ignore this flag.
4468 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
4471 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire
4472 * Code) on this port if supported. When set to 0, then this
4473 * flag shall be ignored. If FEC CLAUSE 74 is not supported,
4474 * then the HWRM shall ignore this flag.
4476 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
4479 * When set to 1, then the HWRM shall disable FEC CLAUSE 74
4480 * (Fire Code) on this port if supported. When set to 0, then
4481 * this flag shall be ignored. If FEC CLAUSE 74 is not
4482 * supported, then the HWRM shall ignore this flag.
4484 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
4487 * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed
4488 * Solomon) on this port if supported. When set to 0, then this
4489 * flag shall be ignored. If FEC CLAUSE 91 is not supported,
4490 * then the HWRM shall ignore this flag.
4492 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
4495 * When set to 1, then the HWRM shall disable FEC CLAUSE 91
4496 * (Reed Solomon) on this port if supported. When set to 0, then
4497 * this flag shall be ignored. If FEC CLAUSE 91 is not
4498 * supported, then the HWRM shall ignore this flag.
4500 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
4503 * When this bit is set to '1', the link shall be forced to be
4504 * taken down. # When this bit is set to '1", all other command
4505 * input settings related to the link speed shall be ignored.
4506 * Once the link state is forced down, it can be explicitly
4507 * cleared from that state by setting this flag to '0'. # If
4508 * this flag is set to '0', then the link shall be cleared from
4509 * forced down state if the link is in forced down state. There
4510 * may be conditions (e.g. out-of-band or sideband configuration
4511 * changes for the link) outside the scope of the HWRM
4512 * implementation that may clear forced down link state.
4514 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN UINT32_C(0x4000)
4516 /* This bit must be '1' for the auto_mode field to be configured. */
4517 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
4518 /* This bit must be '1' for the auto_duplex field to be configured. */
4519 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
4520 /* This bit must be '1' for the auto_pause field to be configured. */
4521 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
4523 * This bit must be '1' for the auto_link_speed field to be
4526 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
4528 * This bit must be '1' for the auto_link_speed_mask field to be
4531 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
4533 /* This bit must be '1' for the wirespeed field to be configured. */
4534 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIOUTPUTEED UINT32_C(0x20)
4535 /* This bit must be '1' for the lpbk field to be configured. */
4536 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
4537 /* This bit must be '1' for the preemphasis field to be configured. */
4538 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
4539 /* This bit must be '1' for the force_pause field to be configured. */
4540 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
4542 * This bit must be '1' for the eee_link_speed_mask field to be
4545 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
4547 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
4548 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
4550 /* Port ID of port that is to be configured. */
4551 uint16_t force_link_speed;
4553 * This is the speed that will be used if the force bit is '1'.
4554 * If unsupported speed is selected, an error will be generated.
4556 /* 100Mb link speed */
4557 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
4558 /* 1Gb link speed */
4559 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
4560 /* 2Gb link speed */
4561 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
4562 /* 2.5Gb link speed */
4563 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
4564 /* 10Gb link speed */
4565 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
4566 /* 20Mb link speed */
4567 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
4568 /* 25Gb link speed */
4569 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
4570 /* 40Gb link speed */
4571 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
4572 /* 50Gb link speed */
4573 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
4574 /* 100Gb link speed */
4575 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
4576 /* 10Mb link speed */
4577 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
4580 * This value is used to identify what autoneg mode is used when
4581 * the link speed is not being forced.
4584 * Disable autoneg or autoneg disabled. No
4585 * speeds are selected.
4587 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE UINT32_C(0x0)
4588 /* Select all possible speeds for autoneg mode. */
4589 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
4591 * Select only the auto_link_speed speed for
4592 * autoneg mode. This mode has been DEPRECATED.
4593 * An HWRM client should not use this mode.
4595 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
4597 * Select the auto_link_speed or any speed below
4598 * that speed for autoneg. This mode has been
4599 * DEPRECATED. An HWRM client should not use
4602 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
4604 * Select the speeds based on the corresponding
4605 * link speed mask value that is provided.
4607 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
4608 uint8_t auto_duplex;
4610 * This is the duplex setting that will be used if the
4611 * autoneg_mode is "one_speed" or "one_or_below".
4613 /* Half Duplex will be requested. */
4614 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
4615 /* Full duplex will be requested. */
4616 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
4617 /* Both Half and Full dupex will be requested. */
4618 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
4621 * This value is used to configure the pause that will be used
4622 * for autonegotiation. Add text on the usage of auto_pause and
4626 * When this bit is '1', Generation of tx pause messages has
4627 * been requested. Disabled otherwise.
4629 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
4631 * When this bit is '1', Reception of rx pause messages has been
4632 * requested. Disabled otherwise.
4634 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
4636 * When set to 1, the advertisement of pause is enabled. # When
4637 * the auto_mode is not set to none and this flag is set to 1,
4638 * then the auto_pause bits on this port are being advertised
4639 * and autoneg pause results are being interpreted. # When the
4640 * auto_mode is not set to none and this flag is set to 0, the
4641 * pause is forced as indicated in force_pause, and also
4642 * advertised as auto_pause bits, but the autoneg results are
4643 * not interpreted since the pause configuration is being
4644 * forced. # When the auto_mode is set to none and this flag is
4645 * set to 1, auto_pause bits should be ignored and should be set
4648 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
4650 uint16_t auto_link_speed;
4652 * This is the speed that will be used if the autoneg_mode is
4653 * "one_speed" or "one_or_below". If an unsupported speed is
4654 * selected, an error will be generated.
4656 /* 100Mb link speed */
4657 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
4658 /* 1Gb link speed */
4659 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
4660 /* 2Gb link speed */
4661 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
4662 /* 2.5Gb link speed */
4663 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
4664 /* 10Gb link speed */
4665 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
4666 /* 20Mb link speed */
4667 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
4668 /* 25Gb link speed */
4669 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
4670 /* 40Gb link speed */
4671 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
4672 /* 50Gb link speed */
4673 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
4674 /* 100Gb link speed */
4675 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
4676 /* 10Mb link speed */
4677 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
4678 uint16_t auto_link_speed_mask;
4680 * This is a mask of link speeds that will be used if
4681 * autoneg_mode is "mask". If unsupported speed is enabled an
4682 * error will be generated.
4684 /* 100Mb link speed (Half-duplex) */
4685 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
4687 /* 100Mb link speed (Full-duplex) */
4688 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
4690 /* 1Gb link speed (Half-duplex) */
4691 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
4693 /* 1Gb link speed (Full-duplex) */
4694 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
4696 /* 2Gb link speed */
4697 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
4699 /* 2.5Gb link speed */
4700 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
4702 /* 10Gb link speed */
4703 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB UINT32_C(0x40)
4704 /* 20Gb link speed */
4705 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB UINT32_C(0x80)
4706 /* 25Gb link speed */
4707 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
4709 /* 40Gb link speed */
4710 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
4712 /* 50Gb link speed */
4713 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
4715 /* 100Gb link speed */
4716 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
4718 /* 10Mb link speed (Half-duplex) */
4719 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
4721 /* 10Mb link speed (Full-duplex) */
4722 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
4725 /* This value controls the wirespeed feature. */
4726 /* Wirespeed feature is disabled. */
4727 #define HWRM_PORT_PHY_CFG_INPUT_WIOUTPUTEED_OFF UINT32_C(0x0)
4728 /* Wirespeed feature is enabled. */
4729 #define HWRM_PORT_PHY_CFG_INPUT_WIOUTPUTEED_ON UINT32_C(0x1)
4731 /* This value controls the loopback setting for the PHY. */
4732 /* No loopback is selected. Normal operation. */
4733 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE UINT32_C(0x0)
4735 * The HW will be configured with local loopback
4736 * such that host data is sent back to the host
4737 * without modification.
4739 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1)
4741 * The HW will be configured with remote
4742 * loopback such that port logic will send
4743 * packets back out the transmitter that are
4746 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
4747 uint8_t force_pause;
4749 * This value is used to configure the pause that will be used
4753 * When this bit is '1', Generation of tx pause messages is
4754 * supported. Disabled otherwise.
4756 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
4758 * When this bit is '1', Reception of rx pause messages is
4759 * supported. Disabled otherwise.
4761 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
4763 uint32_t preemphasis;
4765 * This value controls the pre-emphasis to be used for the link.
4766 * Driver should not set this value (use enable.preemphasis = 0)
4767 * unless driver is sure of setting. Normally HWRM FW will
4768 * determine proper pre-emphasis.
4770 uint16_t eee_link_speed_mask;
4772 * Setting for link speed mask that is used to advertise speeds
4773 * during autonegotiation when EEE is enabled. This field is
4774 * valid only when EEE is enabled. The speeds specified in this
4775 * field shall be a subset of speeds specified in
4776 * auto_link_speed_mask. If EEE is enabled,then at least one
4777 * speed shall be provided in this mask.
4780 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
4781 /* 100Mb link speed (Full-duplex) */
4782 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
4784 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
4785 /* 1Gb link speed (Full-duplex) */
4786 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
4788 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
4790 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
4791 /* 10Gb link speed */
4792 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
4795 uint32_t tx_lpi_timer;
4798 * Reuested setting of TX LPI timer in microseconds. This field
4799 * is valid only when EEE is enabled and TX LPI is enabled.
4801 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
4802 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
4803 } __attribute__((packed));
4805 /* Output (16 bytes) */
4806 struct hwrm_port_phy_cfg_output {
4807 uint16_t error_code;
4809 * Pass/Fail or error type Note: receiver to verify the in
4810 * parameters, and fail the call with an error when appropriate
4813 /* This field returns the type of original request. */
4815 /* This field provides original sequence number of the command. */
4818 * This field is the length of the response in bytes. The last
4819 * byte of the response is a valid flag that will read as '1'
4820 * when the command has been completely written to memory.
4828 * This field is used in Output records to indicate that the
4829 * output is completely written to RAM. This field should be
4830 * read as '1' to indicate that the output has been completely
4831 * written. When writing a command completion or response to an
4832 * internal processor, the order of writes has to be such that
4833 * this field is written last.
4835 } __attribute__((packed));
4837 /* hwrm_port_phy_qcfg */
4838 /* Description: This command queries the PHY configuration for the port. */
4839 /* Input (24 bytes) */
4840 struct hwrm_port_phy_qcfg_input {
4843 * This value indicates what type of request this is. The format
4844 * for the rest of the command is determined by this field.
4848 * This value indicates the what completion ring the request
4849 * will be optionally completed on. If the value is -1, then no
4850 * CR completion will be generated. Any other value must be a
4851 * valid CR ring_id value for this function.
4854 /* This value indicates the command sequence number. */
4857 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4858 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4863 * This is the host address where the response will be written
4864 * when the request is complete. This area must be 16B aligned
4865 * and must be cleared to zero before the request is made.
4868 /* Port ID of port that is to be queried. */
4869 uint16_t unused_0[3];
4870 } __attribute__((packed));
4872 /* Output (96 bytes) */
4873 struct hwrm_port_phy_qcfg_output {
4874 uint16_t error_code;
4876 * Pass/Fail or error type Note: receiver to verify the in
4877 * parameters, and fail the call with an error when appropriate
4880 /* This field returns the type of original request. */
4882 /* This field provides original sequence number of the command. */
4885 * This field is the length of the response in bytes. The last
4886 * byte of the response is a valid flag that will read as '1'
4887 * when the command has been completely written to memory.
4890 /* This value indicates the current link status. */
4891 /* There is no link or cable detected. */
4892 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
4893 /* There is no link, but a cable has been detected. */
4894 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL UINT32_C(0x1)
4895 /* There is a link. */
4896 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK UINT32_C(0x2)
4898 uint16_t link_speed;
4899 /* This value indicates the current link speed of the connection. */
4900 /* 100Mb link speed */
4901 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
4902 /* 1Gb link speed */
4903 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB UINT32_C(0xa)
4904 /* 2Gb link speed */
4905 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB UINT32_C(0x14)
4906 /* 2.5Gb link speed */
4907 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
4908 /* 10Gb link speed */
4909 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB UINT32_C(0x64)
4910 /* 20Mb link speed */
4911 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB UINT32_C(0xc8)
4912 /* 25Gb link speed */
4913 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB UINT32_C(0xfa)
4914 /* 40Gb link speed */
4915 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB UINT32_C(0x190)
4916 /* 50Gb link speed */
4917 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB UINT32_C(0x1f4)
4918 /* 100Gb link speed */
4919 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
4920 /* 10Mb link speed */
4921 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB UINT32_C(0xffff)
4923 /* This value is indicates the duplex of the current connection. */
4924 /* Half Duplex connection. */
4925 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
4926 /* Full duplex connection. */
4927 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
4930 * This value is used to indicate the current pause
4931 * configuration. When autoneg is enabled, this value represents
4932 * the autoneg results of pause configuration.
4935 * When this bit is '1', Generation of tx pause messages is
4936 * supported. Disabled otherwise.
4938 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX UINT32_C(0x1)
4940 * When this bit is '1', Reception of rx pause messages is
4941 * supported. Disabled otherwise.
4943 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX UINT32_C(0x2)
4944 uint16_t support_speeds;
4946 * The supported speeds for the port. This is a bit mask. For
4947 * each speed that is supported, the corrresponding bit will be
4950 /* 100Mb link speed (Half-duplex) */
4951 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD UINT32_C(0x1)
4952 /* 100Mb link speed (Full-duplex) */
4953 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB UINT32_C(0x2)
4954 /* 1Gb link speed (Half-duplex) */
4955 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD UINT32_C(0x4)
4956 /* 1Gb link speed (Full-duplex) */
4957 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB UINT32_C(0x8)
4958 /* 2Gb link speed */
4959 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB UINT32_C(0x10)
4960 /* 2.5Gb link speed */
4961 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB UINT32_C(0x20)
4962 /* 10Gb link speed */
4963 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB UINT32_C(0x40)
4964 /* 20Gb link speed */
4965 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB UINT32_C(0x80)
4966 /* 25Gb link speed */
4967 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB UINT32_C(0x100)
4968 /* 40Gb link speed */
4969 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB UINT32_C(0x200)
4970 /* 50Gb link speed */
4971 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB UINT32_C(0x400)
4972 /* 100Gb link speed */
4973 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB UINT32_C(0x800)
4974 /* 10Mb link speed (Half-duplex) */
4975 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD UINT32_C(0x1000)
4976 /* 10Mb link speed (Full-duplex) */
4977 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB UINT32_C(0x2000)
4978 uint16_t force_link_speed;
4980 * Current setting of forced link speed. When the link speed is
4981 * not being forced, this value shall be set to 0.
4983 /* 100Mb link speed */
4984 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
4985 /* 1Gb link speed */
4986 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
4987 /* 2Gb link speed */
4988 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
4989 /* 2.5Gb link speed */
4990 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
4991 /* 10Gb link speed */
4992 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
4993 /* 20Mb link speed */
4994 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
4995 /* 25Gb link speed */
4996 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
4997 /* 40Gb link speed */
4998 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
4999 /* 50Gb link speed */
5000 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
5001 /* 100Gb link speed */
5002 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
5003 /* 10Mb link speed */
5004 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
5006 /* Current setting of auto negotiation mode. */
5008 * Disable autoneg or autoneg disabled. No
5009 * speeds are selected.
5011 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE UINT32_C(0x0)
5012 /* Select all possible speeds for autoneg mode. */
5013 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
5015 * Select only the auto_link_speed speed for
5016 * autoneg mode. This mode has been DEPRECATED.
5017 * An HWRM client should not use this mode.
5019 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
5021 * Select the auto_link_speed or any speed below
5022 * that speed for autoneg. This mode has been
5023 * DEPRECATED. An HWRM client should not use
5026 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
5028 * Select the speeds based on the corresponding
5029 * link speed mask value that is provided.
5031 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
5034 * Current setting of pause autonegotiation. Move autoneg_pause
5038 * When this bit is '1', Generation of tx pause messages has
5039 * been requested. Disabled otherwise.
5041 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX UINT32_C(0x1)
5043 * When this bit is '1', Reception of rx pause messages has been
5044 * requested. Disabled otherwise.
5046 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX UINT32_C(0x2)
5048 * When set to 1, the advertisement of pause is enabled. # When
5049 * the auto_mode is not set to none and this flag is set to 1,
5050 * then the auto_pause bits on this port are being advertised
5051 * and autoneg pause results are being interpreted. # When the
5052 * auto_mode is not set to none and this flag is set to 0, the
5053 * pause is forced as indicated in force_pause, and also
5054 * advertised as auto_pause bits, but the autoneg results are
5055 * not interpreted since the pause configuration is being
5056 * forced. # When the auto_mode is set to none and this flag is
5057 * set to 1, auto_pause bits should be ignored and should be set
5060 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
5061 uint16_t auto_link_speed;
5063 * Current setting for auto_link_speed. This field is only valid
5064 * when auto_mode is set to "one_speed" or "one_or_below".
5066 /* 100Mb link speed */
5067 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
5068 /* 1Gb link speed */
5069 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
5070 /* 2Gb link speed */
5071 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
5072 /* 2.5Gb link speed */
5073 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
5074 /* 10Gb link speed */
5075 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
5076 /* 20Mb link speed */
5077 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
5078 /* 25Gb link speed */
5079 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
5080 /* 40Gb link speed */
5081 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
5082 /* 50Gb link speed */
5083 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
5084 /* 100Gb link speed */
5085 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
5086 /* 10Mb link speed */
5087 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
5088 uint16_t auto_link_speed_mask;
5090 * Current setting for auto_link_speed_mask that is used to
5091 * advertise speeds during autonegotiation. This field is only
5092 * valid when auto_mode is set to "mask". The speeds specified
5093 * in this field shall be a subset of supported speeds on this
5096 /* 100Mb link speed (Half-duplex) */
5097 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
5099 /* 100Mb link speed (Full-duplex) */
5100 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
5102 /* 1Gb link speed (Half-duplex) */
5103 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
5105 /* 1Gb link speed (Full-duplex) */
5106 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB UINT32_C(0x8)
5107 /* 2Gb link speed */
5108 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
5110 /* 2.5Gb link speed */
5111 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
5113 /* 10Gb link speed */
5114 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
5116 /* 20Gb link speed */
5117 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
5119 /* 25Gb link speed */
5120 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
5122 /* 40Gb link speed */
5123 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
5125 /* 50Gb link speed */
5126 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
5128 /* 100Gb link speed */
5129 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
5131 /* 10Mb link speed (Half-duplex) */
5132 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
5134 /* 10Mb link speed (Full-duplex) */
5135 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
5138 /* Current setting for wirespeed. */
5139 /* Wirespeed feature is disabled. */
5140 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIOUTPUTEED_OFF UINT32_C(0x0)
5141 /* Wirespeed feature is enabled. */
5142 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIOUTPUTEED_ON UINT32_C(0x1)
5144 /* Current setting for loopback. */
5145 /* No loopback is selected. Normal operation. */
5146 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0)
5148 * The HW will be configured with local loopback
5149 * such that host data is sent back to the host
5150 * without modification.
5152 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1)
5154 * The HW will be configured with remote
5155 * loopback such that port logic will send
5156 * packets back out the transmitter that are
5159 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
5160 uint8_t force_pause;
5162 * Current setting of forced pause. When the pause configuration
5163 * is not being forced, then this value shall be set to 0.
5166 * When this bit is '1', Generation of tx pause messages is
5167 * supported. Disabled otherwise.
5169 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX UINT32_C(0x1)
5171 * When this bit is '1', Reception of rx pause messages is
5172 * supported. Disabled otherwise.
5174 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX UINT32_C(0x2)
5175 uint8_t module_status;
5177 * This value indicates the current status of the optics module
5180 /* Module is inserted and accepted */
5181 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE UINT32_C(0x0)
5182 /* Module is rejected and transmit side Laser is disabled. */
5183 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX UINT32_C(0x1)
5184 /* Module mismatch warning. */
5185 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG UINT32_C(0x2)
5186 /* Module is rejected and powered down. */
5187 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN UINT32_C(0x3)
5188 /* Module is not inserted. */
5189 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
5191 /* Module status is not applicable. */
5192 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
5194 uint32_t preemphasis;
5195 /* Current setting for preemphasis. */
5197 /* This field represents the major version of the PHY. */
5199 /* This field represents the minor version of the PHY. */
5201 /* This field represents the build version of the PHY. */
5203 /* This value represents a PHY type. */
5205 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN UINT32_C(0x0)
5207 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR UINT32_C(0x1)
5208 /* BASE-KR4 (Deprecated) */
5209 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 UINT32_C(0x2)
5211 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR UINT32_C(0x3)
5213 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR UINT32_C(0x4)
5214 /* BASE-KR2 (Deprecated) */
5215 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 UINT32_C(0x5)
5217 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX UINT32_C(0x6)
5219 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR UINT32_C(0x7)
5221 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET UINT32_C(0x8)
5222 /* EEE capable BASE-T */
5223 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE UINT32_C(0x9)
5224 /* SGMII connected external PHY */
5225 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY UINT32_C(0xa)
5226 /* 25G_BASECR_CA_L */
5227 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L UINT32_C(0xb)
5228 /* 25G_BASECR_CA_S */
5229 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S UINT32_C(0xc)
5230 /* 25G_BASECR_CA_N */
5231 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N UINT32_C(0xd)
5233 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR UINT32_C(0xe)
5235 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 UINT32_C(0xf)
5237 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 UINT32_C(0x10)
5239 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 UINT32_C(0x11)
5241 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 UINT32_C(0x12)
5243 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 UINT32_C(0x13)
5245 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 UINT32_C(0x14)
5247 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 UINT32_C(0x15)
5249 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 UINT32_C(0x16)
5251 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 UINT32_C(0x17)
5252 /* 40G_ACTIVE_CABLE */
5253 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
5255 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET UINT32_C(0x19)
5257 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX UINT32_C(0x1a)
5259 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX UINT32_C(0x1b)
5261 /* This value represents a media type. */
5263 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
5265 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP UINT32_C(0x1)
5266 /* Direct Attached Copper */
5267 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC UINT32_C(0x2)
5269 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE UINT32_C(0x3)
5270 uint8_t xcvr_pkg_type;
5271 /* This value represents a transceiver type. */
5272 /* PHY and MAC are in the same package */
5273 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
5275 /* PHY and MAC are in different packages */
5276 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
5278 uint8_t eee_config_phy_addr;
5280 * This field represents flags related to EEE configuration.
5281 * These EEE configuration flags are valid only when the
5282 * auto_mode is not set to none (in other words autonegotiation
5285 /* This field represents PHY address. */
5286 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK UINT32_C(0x1f)
5287 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT 0
5289 * When set to 1, Energy Efficient Ethernet (EEE) mode is
5290 * enabled. Speeds for autoneg with EEE mode enabled are based
5291 * on eee_link_speed_mask.
5293 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED UINT32_C(0x20)
5295 * This flag is valid only when eee_enabled is set to 1. # If
5296 * eee_enabled is set to 0, then EEE mode is disabled and this
5297 * flag shall be ignored. # If eee_enabled is set to 1 and this
5298 * flag is set to 1, then Energy Efficient Ethernet (EEE) mode
5299 * is enabled and in use. # If eee_enabled is set to 1 and this
5300 * flag is set to 0, then Energy Efficient Ethernet (EEE) mode
5301 * is enabled but is currently not in use.
5303 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE UINT32_C(0x40)
5305 * This flag is valid only when eee_enabled is set to 1. # If
5306 * eee_enabled is set to 0, then EEE mode is disabled and this
5307 * flag shall be ignored. # If eee_enabled is set to 1 and this
5308 * flag is set to 1, then Energy Efficient Ethernet (EEE) mode
5309 * is enabled and TX LPI is enabled. # If eee_enabled is set to
5310 * 1 and this flag is set to 0, then Energy Efficient Ethernet
5311 * (EEE) mode is enabled but TX LPI is disabled.
5313 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI UINT32_C(0x80)
5315 * This field represents flags related to EEE configuration.
5316 * These EEE configuration flags are valid only when the
5317 * auto_mode is not set to none (in other words autonegotiation
5320 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK UINT32_C(0xe0)
5321 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT 5
5322 uint8_t parallel_detect;
5323 /* Reserved field, set to 0 */
5325 * When set to 1, the parallel detection is used to determine
5326 * the speed of the link partner. Parallel detection is used
5327 * when a autonegotiation capable device is connected to a link
5328 * parter that is not capable of autonegotiation.
5330 #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT UINT32_C(0x1)
5331 /* Reserved field, set to 0 */
5332 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_MASK UINT32_C(0xfe)
5333 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_SFT 1
5334 uint16_t link_partner_adv_speeds;
5336 * The advertised speeds for the port by the link partner. Each
5337 * advertised speed will be set to '1'.
5339 /* 100Mb link speed (Half-duplex) */
5340 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
5342 /* 100Mb link speed (Full-duplex) */
5343 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
5345 /* 1Gb link speed (Half-duplex) */
5346 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
5348 /* 1Gb link speed (Full-duplex) */
5349 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
5351 /* 2Gb link speed */
5352 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
5354 /* 2.5Gb link speed */
5355 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
5357 /* 10Gb link speed */
5358 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
5360 /* 20Gb link speed */
5361 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
5363 /* 25Gb link speed */
5364 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
5366 /* 40Gb link speed */
5367 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
5369 /* 50Gb link speed */
5370 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
5372 /* 100Gb link speed */
5373 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
5375 /* 10Mb link speed (Half-duplex) */
5376 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
5378 /* 10Mb link speed (Full-duplex) */
5379 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
5381 uint8_t link_partner_adv_auto_mode;
5383 * The advertised autoneg for the port by the link partner. This
5384 * field is deprecated and should be set to 0.
5387 * Disable autoneg or autoneg disabled. No
5388 * speeds are selected.
5390 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
5392 /* Select all possible speeds for autoneg mode. */
5394 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
5397 * Select only the auto_link_speed speed for
5398 * autoneg mode. This mode has been DEPRECATED.
5399 * An HWRM client should not use this mode.
5402 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
5405 * Select the auto_link_speed or any speed below
5406 * that speed for autoneg. This mode has been
5407 * DEPRECATED. An HWRM client should not use
5411 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
5414 * Select the speeds based on the corresponding
5415 * link speed mask value that is provided.
5418 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
5420 uint8_t link_partner_adv_pause;
5421 /* The advertised pause settings on the port by the link partner. */
5423 * When this bit is '1', Generation of tx pause messages is
5424 * supported. Disabled otherwise.
5426 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
5429 * When this bit is '1', Reception of rx pause messages is
5430 * supported. Disabled otherwise.
5432 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
5434 uint16_t adv_eee_link_speed_mask;
5436 * Current setting for link speed mask that is used to advertise
5437 * speeds during autonegotiation when EEE is enabled. This field
5438 * is valid only when eee_enabled flags is set to 1. The speeds
5439 * specified in this field shall be a subset of speeds specified
5440 * in auto_link_speed_mask.
5443 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
5445 /* 100Mb link speed (Full-duplex) */
5446 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
5449 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
5451 /* 1Gb link speed (Full-duplex) */
5452 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
5455 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
5458 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
5460 /* 10Gb link speed */
5461 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
5463 uint16_t link_partner_adv_eee_link_speed_mask;
5465 * Current setting for link speed mask that is advertised by the
5466 * link partner when EEE is enabled. This field is valid only
5467 * when eee_enabled flags is set to 1.
5471 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
5473 /* 100Mb link speed (Full-duplex) */
5475 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
5479 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
5481 /* 1Gb link speed (Full-duplex) */
5483 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
5487 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
5491 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
5493 /* 10Gb link speed */
5495 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
5497 uint32_t xcvr_identifier_type_tx_lpi_timer;
5498 /* This value represents transceiver identifier type. */
5500 * Current setting of TX LPI timer in microseconds. This field
5501 * is valid only when_eee_enabled flag is set to 1 and
5502 * tx_lpi_enabled is set to 1.
5504 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
5505 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT 0
5506 /* This value represents transceiver identifier type. */
5507 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
5508 UINT32_C(0xff000000)
5509 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT 24
5511 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
5512 (UINT32_C(0x0) << 24)
5513 /* SFP/SFP+/SFP28 */
5514 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
5515 (UINT32_C(0x3) << 24)
5517 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
5518 (UINT32_C(0xc) << 24)
5520 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
5521 (UINT32_C(0xd) << 24)
5523 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
5524 (UINT32_C(0x11) << 24)
5527 * This value represents the current configuration of Forward
5528 * Error Correction (FEC) on the port.
5531 * When set to 1, then FEC is not supported on this port. If
5532 * this flag is set to 1, then all other FEC configuration flags
5533 * shall be ignored. When set to 0, then FEC is supported as
5534 * indicated by other configuration flags. If no cable is
5535 * attached and the HWRM does not yet know the FEC capability,
5536 * then the HWRM shall set this flag to 1 when reporting FEC
5539 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
5542 * When set to 1, then FEC autonegotiation is supported on this
5543 * port. When set to 0, then FEC autonegotiation is not
5544 * supported on this port.
5546 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
5549 * When set to 1, then FEC autonegotiation is enabled on this
5550 * port. When set to 0, then FEC autonegotiation is disabled if
5551 * supported. This flag should be ignored if FEC autonegotiation
5552 * is not supported on this port.
5554 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
5557 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on
5558 * this port. When set to 0, then FEC CLAUSE 74 (Fire Code) is
5559 * not supported on this port.
5561 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
5564 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on
5565 * this port. When set to 0, then FEC CLAUSE 74 (Fire Code) is
5566 * disabled if supported. This flag should be ignored if FEC
5567 * CLAUSE 74 is not supported on this port.
5569 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
5572 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported
5573 * on this port. When set to 0, then FEC CLAUSE 91 (Reed
5574 * Solomon) is not supported on this port.
5576 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
5579 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled
5580 * on this port. When set to 0, then FEC CLAUSE 91 (Reed
5581 * Solomon) is disabled if supported. This flag should be
5582 * ignored if FEC CLAUSE 91 is not supported on this port.
5584 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
5586 uint8_t duplex_state;
5588 * This value is indicates the duplex of the current connection
5591 /* Half Duplex connection. */
5592 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
5593 /* Full duplex connection. */
5594 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
5596 char phy_vendor_name[16];
5598 * Up to 16 bytes of null padded ASCII string representing PHY
5599 * vendor. If the string is set to null, then the vendor name is
5602 char phy_vendor_partnumber[16];
5604 * Up to 16 bytes of null padded ASCII string that identifies
5605 * vendor specific part number of the PHY. If the string is set
5606 * to null, then the vendor specific part number is not
5615 * This field is used in Output records to indicate that the
5616 * output is completely written to RAM. This field should be
5617 * read as '1' to indicate that the output has been completely
5618 * written. When writing a command completion or response to an
5619 * internal processor, the order of writes has to be such that
5620 * this field is written last.
5622 } __attribute__((packed));
5624 /* hwrm_port_qstats */
5625 /* Description: This function returns per port Ethernet statistics. */
5626 /* Input (40 bytes) */
5627 struct hwrm_port_qstats_input {
5630 * This value indicates what type of request this is. The format
5631 * for the rest of the command is determined by this field.
5635 * This value indicates the what completion ring the request
5636 * will be optionally completed on. If the value is -1, then no
5637 * CR completion will be generated. Any other value must be a
5638 * valid CR ring_id value for this function.
5641 /* This value indicates the command sequence number. */
5644 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5645 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5650 * This is the host address where the response will be written
5651 * when the request is complete. This area must be 16B aligned
5652 * and must be cleared to zero before the request is made.
5655 /* Port ID of port that is being queried. */
5658 uint8_t unused_2[3];
5660 uint64_t tx_stat_host_addr;
5661 /* This is the host address where Tx port statistics will be stored */
5662 uint64_t rx_stat_host_addr;
5663 /* This is the host address where Rx port statistics will be stored */
5664 } __attribute__((packed));
5666 /* Output (16 bytes) */
5667 struct hwrm_port_qstats_output {
5668 uint16_t error_code;
5670 * Pass/Fail or error type Note: receiver to verify the in
5671 * parameters, and fail the call with an error when appropriate
5674 /* This field returns the type of original request. */
5676 /* This field provides original sequence number of the command. */
5679 * This field is the length of the response in bytes. The last
5680 * byte of the response is a valid flag that will read as '1'
5681 * when the command has been completely written to memory.
5683 uint16_t tx_stat_size;
5684 /* The size of TX port statistics block in bytes. */
5685 uint16_t rx_stat_size;
5686 /* The size of RX port statistics block in bytes. */
5692 * This field is used in Output records to indicate that the
5693 * output is completely written to RAM. This field should be
5694 * read as '1' to indicate that the output has been completely
5695 * written. When writing a command completion or response to an
5696 * internal processor, the order of writes has to be such that
5697 * this field is written last.
5699 } __attribute__((packed));
5701 /* hwrm_port_clr_stats */
5703 * Description: This function clears per port statistics. The HWRM shall not
5704 * allow a VF driver to clear port statistics. The HWRM shall not allow a PF
5705 * driver to clear port statistics in a partitioning mode. The HWRM may allow a
5706 * PF driver to clear port statistics in the non-partitioning mode.
5708 /* Input (24 bytes) */
5709 struct hwrm_port_clr_stats_input {
5712 * This value indicates what type of request this is. The format
5713 * for the rest of the command is determined by this field.
5717 * This value indicates the what completion ring the request
5718 * will be optionally completed on. If the value is -1, then no
5719 * CR completion will be generated. Any other value must be a
5720 * valid CR ring_id value for this function.
5723 /* This value indicates the command sequence number. */
5726 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5727 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5732 * This is the host address where the response will be written
5733 * when the request is complete. This area must be 16B aligned
5734 * and must be cleared to zero before the request is made.
5737 /* Port ID of port that is being queried. */
5738 uint16_t unused_0[3];
5739 } __attribute__((packed));
5741 /* Output (16 bytes) */
5742 struct hwrm_port_clr_stats_output {
5743 uint16_t error_code;
5745 * Pass/Fail or error type Note: receiver to verify the in
5746 * parameters, and fail the call with an error when appropriate
5749 /* This field returns the type of original request. */
5751 /* This field provides original sequence number of the command. */
5754 * This field is the length of the response in bytes. The last
5755 * byte of the response is a valid flag that will read as '1'
5756 * when the command has been completely written to memory.
5764 * This field is used in Output records to indicate that the
5765 * output is completely written to RAM. This field should be
5766 * read as '1' to indicate that the output has been completely
5767 * written. When writing a command completion or response to an
5768 * internal processor, the order of writes has to be such that
5769 * this field is written last.
5771 } __attribute__((packed));
5773 /* hwrm_port_led_cfg */
5775 * Description: This function is used to configure LEDs on a given port. Each
5776 * port has individual set of LEDs associated with it. These LEDs are used for
5777 * speed/link configuration as well as activity indicator configuration. Up to
5778 * three LEDs can be configured, one for activity and two for speeds.
5780 /* Input (64 bytes) */
5781 struct hwrm_port_led_cfg_input {
5784 * This value indicates what type of request this is. The format
5785 * for the rest of the command is determined by this field.
5789 * This value indicates the what completion ring the request
5790 * will be optionally completed on. If the value is -1, then no
5791 * CR completion will be generated. Any other value must be a
5792 * valid CR ring_id value for this function.
5795 /* This value indicates the command sequence number. */
5798 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5799 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5804 * This is the host address where the response will be written
5805 * when the request is complete. This area must be 16B aligned
5806 * and must be cleared to zero before the request is made.
5809 /* This bit must be '1' for the led0_id field to be configured. */
5810 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID UINT32_C(0x1)
5811 /* This bit must be '1' for the led0_state field to be configured. */
5812 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE UINT32_C(0x2)
5813 /* This bit must be '1' for the led0_color field to be configured. */
5814 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR UINT32_C(0x4)
5816 * This bit must be '1' for the led0_blink_on field to be
5819 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON UINT32_C(0x8)
5821 * This bit must be '1' for the led0_blink_off field to be
5824 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF UINT32_C(0x10)
5826 * This bit must be '1' for the led0_group_id field to be
5829 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID UINT32_C(0x20)
5830 /* This bit must be '1' for the led1_id field to be configured. */
5831 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID UINT32_C(0x40)
5832 /* This bit must be '1' for the led1_state field to be configured. */
5833 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE UINT32_C(0x80)
5834 /* This bit must be '1' for the led1_color field to be configured. */
5835 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR UINT32_C(0x100)
5837 * This bit must be '1' for the led1_blink_on field to be
5840 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON UINT32_C(0x200)
5842 * This bit must be '1' for the led1_blink_off field to be
5845 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF UINT32_C(0x400)
5847 * This bit must be '1' for the led1_group_id field to be
5850 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID UINT32_C(0x800)
5851 /* This bit must be '1' for the led2_id field to be configured. */
5852 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID UINT32_C(0x1000)
5853 /* This bit must be '1' for the led2_state field to be configured. */
5854 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE UINT32_C(0x2000)
5855 /* This bit must be '1' for the led2_color field to be configured. */
5856 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR UINT32_C(0x4000)
5858 * This bit must be '1' for the led2_blink_on field to be
5861 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON UINT32_C(0x8000)
5863 * This bit must be '1' for the led2_blink_off field to be
5866 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF UINT32_C(0x10000)
5868 * This bit must be '1' for the led2_group_id field to be
5871 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID UINT32_C(0x20000)
5872 /* This bit must be '1' for the led3_id field to be configured. */
5873 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID UINT32_C(0x40000)
5874 /* This bit must be '1' for the led3_state field to be configured. */
5875 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE UINT32_C(0x80000)
5876 /* This bit must be '1' for the led3_color field to be configured. */
5877 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR UINT32_C(0x100000)
5879 * This bit must be '1' for the led3_blink_on field to be
5882 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON UINT32_C(0x200000)
5884 * This bit must be '1' for the led3_blink_off field to be
5887 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
5890 * This bit must be '1' for the led3_group_id field to be
5893 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID UINT32_C(0x800000)
5895 /* Port ID of port whose LEDs are configured. */
5898 * The number of LEDs that are being configured. Up to 4 LEDs
5899 * can be configured with this command.
5902 /* Reserved field. */
5904 /* An identifier for the LED #0. */
5906 /* The requested state of the LED #0. */
5907 /* Default state of the LED */
5908 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT UINT32_C(0x0)
5910 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF UINT32_C(0x1)
5912 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON UINT32_C(0x2)
5914 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK UINT32_C(0x3)
5915 /* Blink Alternately */
5916 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
5918 /* The requested color of LED #0. */
5920 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT UINT32_C(0x0)
5922 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER UINT32_C(0x1)
5924 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN UINT32_C(0x2)
5925 /* Green or Amber */
5926 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
5928 uint16_t led0_blink_on;
5930 * If the LED #0 state is "blink" or "blinkalt", then this field
5931 * represents the requested time in milliseconds to keep LED on
5934 uint16_t led0_blink_off;
5936 * If the LED #0 state is "blink" or "blinkalt", then this field
5937 * represents the requested time in milliseconds to keep LED off
5940 uint8_t led0_group_id;
5942 * An identifier for the group of LEDs that LED #0 belongs to.
5943 * If set to 0, then the LED #0 shall not be grouped and shall
5944 * be treated as an individual resource. For all other non-zero
5945 * values of this field, LED #0 shall be grouped together with
5946 * the LEDs with the same group ID value.
5949 /* Reserved field. */
5951 /* An identifier for the LED #1. */
5953 /* The requested state of the LED #1. */
5954 /* Default state of the LED */
5955 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT UINT32_C(0x0)
5957 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF UINT32_C(0x1)
5959 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON UINT32_C(0x2)
5961 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK UINT32_C(0x3)
5962 /* Blink Alternately */
5963 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
5965 /* The requested color of LED #1. */
5967 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT UINT32_C(0x0)
5969 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER UINT32_C(0x1)
5971 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN UINT32_C(0x2)
5972 /* Green or Amber */
5973 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
5975 uint16_t led1_blink_on;
5977 * If the LED #1 state is "blink" or "blinkalt", then this field
5978 * represents the requested time in milliseconds to keep LED on
5981 uint16_t led1_blink_off;
5983 * If the LED #1 state is "blink" or "blinkalt", then this field
5984 * represents the requested time in milliseconds to keep LED off
5987 uint8_t led1_group_id;
5989 * An identifier for the group of LEDs that LED #1 belongs to.
5990 * If set to 0, then the LED #1 shall not be grouped and shall
5991 * be treated as an individual resource. For all other non-zero
5992 * values of this field, LED #1 shall be grouped together with
5993 * the LEDs with the same group ID value.
5996 /* Reserved field. */
5998 /* An identifier for the LED #2. */
6000 /* The requested state of the LED #2. */
6001 /* Default state of the LED */
6002 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT UINT32_C(0x0)
6004 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF UINT32_C(0x1)
6006 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON UINT32_C(0x2)
6008 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK UINT32_C(0x3)
6009 /* Blink Alternately */
6010 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
6012 /* The requested color of LED #2. */
6014 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT UINT32_C(0x0)
6016 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER UINT32_C(0x1)
6018 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN UINT32_C(0x2)
6019 /* Green or Amber */
6020 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
6022 uint16_t led2_blink_on;
6024 * If the LED #2 state is "blink" or "blinkalt", then this field
6025 * represents the requested time in milliseconds to keep LED on
6028 uint16_t led2_blink_off;
6030 * If the LED #2 state is "blink" or "blinkalt", then this field
6031 * represents the requested time in milliseconds to keep LED off
6034 uint8_t led2_group_id;
6036 * An identifier for the group of LEDs that LED #2 belongs to.
6037 * If set to 0, then the LED #2 shall not be grouped and shall
6038 * be treated as an individual resource. For all other non-zero
6039 * values of this field, LED #2 shall be grouped together with
6040 * the LEDs with the same group ID value.
6043 /* Reserved field. */
6045 /* An identifier for the LED #3. */
6047 /* The requested state of the LED #3. */
6048 /* Default state of the LED */
6049 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT UINT32_C(0x0)
6051 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF UINT32_C(0x1)
6053 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON UINT32_C(0x2)
6055 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK UINT32_C(0x3)
6056 /* Blink Alternately */
6057 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
6059 /* The requested color of LED #3. */
6061 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT UINT32_C(0x0)
6063 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER UINT32_C(0x1)
6065 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN UINT32_C(0x2)
6066 /* Green or Amber */
6067 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
6069 uint16_t led3_blink_on;
6071 * If the LED #3 state is "blink" or "blinkalt", then this field
6072 * represents the requested time in milliseconds to keep LED on
6075 uint16_t led3_blink_off;
6077 * If the LED #3 state is "blink" or "blinkalt", then this field
6078 * represents the requested time in milliseconds to keep LED off
6081 uint8_t led3_group_id;
6083 * An identifier for the group of LEDs that LED #3 belongs to.
6084 * If set to 0, then the LED #3 shall not be grouped and shall
6085 * be treated as an individual resource. For all other non-zero
6086 * values of this field, LED #3 shall be grouped together with
6087 * the LEDs with the same group ID value.
6090 /* Reserved field. */
6091 } __attribute__((packed));
6093 /* Output (16 bytes) */
6094 struct hwrm_port_led_cfg_output {
6095 uint16_t error_code;
6097 * Pass/Fail or error type Note: receiver to verify the in
6098 * parameters, and fail the call with an error when appropriate
6101 /* This field returns the type of original request. */
6103 /* This field provides original sequence number of the command. */
6106 * This field is the length of the response in bytes. The last
6107 * byte of the response is a valid flag that will read as '1'
6108 * when the command has been completely written to memory.
6116 * This field is used in Output records to indicate that the
6117 * output is completely written to RAM. This field should be
6118 * read as '1' to indicate that the output has been completely
6119 * written. When writing a command completion or response to an
6120 * internal processor, the order of writes has to be such that
6121 * this field is written last.
6123 } __attribute__((packed));
6125 /* hwrm_port_led_qcfg */
6127 * Description: This function is used to query configuration of LEDs on a given
6128 * port. Each port has individual set of LEDs associated with it. These LEDs are
6129 * used for speed/link configuration as well as activity indicator
6130 * configuration. Up to three LEDs can be configured, one for activity and two
6133 /* Input (24 bytes) */
6134 struct hwrm_port_led_qcfg_input {
6137 * This value indicates what type of request this is. The format
6138 * for the rest of the command is determined by this field.
6142 * This value indicates the what completion ring the request
6143 * will be optionally completed on. If the value is -1, then no
6144 * CR completion will be generated. Any other value must be a
6145 * valid CR ring_id value for this function.
6148 /* This value indicates the command sequence number. */
6151 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6152 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6157 * This is the host address where the response will be written
6158 * when the request is complete. This area must be 16B aligned
6159 * and must be cleared to zero before the request is made.
6162 /* Port ID of port whose LED configuration is being queried. */
6163 uint16_t unused_0[3];
6164 } __attribute__((packed));
6166 /* Output (56 bytes) */
6167 struct hwrm_port_led_qcfg_output {
6168 uint16_t error_code;
6170 * Pass/Fail or error type Note: receiver to verify the in
6171 * parameters, and fail the call with an error when appropriate
6174 /* This field returns the type of original request. */
6176 /* This field provides original sequence number of the command. */
6179 * This field is the length of the response in bytes. The last
6180 * byte of the response is a valid flag that will read as '1'
6181 * when the command has been completely written to memory.
6185 * The number of LEDs that are configured on this port. Up to 4
6186 * LEDs can be returned in the response.
6189 /* An identifier for the LED #0. */
6191 /* The type of LED #0. */
6193 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0)
6195 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
6197 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff)
6199 /* The current state of the LED #0. */
6200 /* Default state of the LED */
6201 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT UINT32_C(0x0)
6203 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF UINT32_C(0x1)
6205 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON UINT32_C(0x2)
6207 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK UINT32_C(0x3)
6208 /* Blink Alternately */
6209 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
6211 /* The color of LED #0. */
6213 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT UINT32_C(0x0)
6215 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER UINT32_C(0x1)
6217 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN UINT32_C(0x2)
6218 /* Green or Amber */
6219 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
6221 uint16_t led0_blink_on;
6223 * If the LED #0 state is "blink" or "blinkalt", then this field
6224 * represents the requested time in milliseconds to keep LED on
6227 uint16_t led0_blink_off;
6229 * If the LED #0 state is "blink" or "blinkalt", then this field
6230 * represents the requested time in milliseconds to keep LED off
6233 uint8_t led0_group_id;
6235 * An identifier for the group of LEDs that LED #0 belongs to.
6236 * If set to 0, then the LED #0 is not grouped. For all other
6237 * non-zero values of this field, LED #0 is grouped together
6238 * with the LEDs with the same group ID value.
6241 /* An identifier for the LED #1. */
6243 /* The type of LED #1. */
6245 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0)
6247 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
6249 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff)
6251 /* The current state of the LED #1. */
6252 /* Default state of the LED */
6253 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT UINT32_C(0x0)
6255 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF UINT32_C(0x1)
6257 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON UINT32_C(0x2)
6259 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK UINT32_C(0x3)
6260 /* Blink Alternately */
6261 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
6263 /* The color of LED #1. */
6265 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT UINT32_C(0x0)
6267 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER UINT32_C(0x1)
6269 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN UINT32_C(0x2)
6270 /* Green or Amber */
6271 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
6273 uint16_t led1_blink_on;
6275 * If the LED #1 state is "blink" or "blinkalt", then this field
6276 * represents the requested time in milliseconds to keep LED on
6279 uint16_t led1_blink_off;
6281 * If the LED #1 state is "blink" or "blinkalt", then this field
6282 * represents the requested time in milliseconds to keep LED off
6285 uint8_t led1_group_id;
6287 * An identifier for the group of LEDs that LED #1 belongs to.
6288 * If set to 0, then the LED #1 is not grouped. For all other
6289 * non-zero values of this field, LED #1 is grouped together
6290 * with the LEDs with the same group ID value.
6293 /* An identifier for the LED #2. */
6295 /* The type of LED #2. */
6297 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0)
6299 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
6301 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff)
6303 /* The current state of the LED #2. */
6304 /* Default state of the LED */
6305 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT UINT32_C(0x0)
6307 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF UINT32_C(0x1)
6309 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON UINT32_C(0x2)
6311 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK UINT32_C(0x3)
6312 /* Blink Alternately */
6313 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
6315 /* The color of LED #2. */
6317 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT UINT32_C(0x0)
6319 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER UINT32_C(0x1)
6321 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN UINT32_C(0x2)
6322 /* Green or Amber */
6323 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
6325 uint16_t led2_blink_on;
6327 * If the LED #2 state is "blink" or "blinkalt", then this field
6328 * represents the requested time in milliseconds to keep LED on
6331 uint16_t led2_blink_off;
6333 * If the LED #2 state is "blink" or "blinkalt", then this field
6334 * represents the requested time in milliseconds to keep LED off
6337 uint8_t led2_group_id;
6339 * An identifier for the group of LEDs that LED #2 belongs to.
6340 * If set to 0, then the LED #2 is not grouped. For all other
6341 * non-zero values of this field, LED #2 is grouped together
6342 * with the LEDs with the same group ID value.
6345 /* An identifier for the LED #3. */
6347 /* The type of LED #3. */
6349 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0)
6351 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
6353 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff)
6355 /* The current state of the LED #3. */
6356 /* Default state of the LED */
6357 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT UINT32_C(0x0)
6359 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF UINT32_C(0x1)
6361 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON UINT32_C(0x2)
6363 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK UINT32_C(0x3)
6364 /* Blink Alternately */
6365 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
6367 /* The color of LED #3. */
6369 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT UINT32_C(0x0)
6371 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER UINT32_C(0x1)
6373 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN UINT32_C(0x2)
6374 /* Green or Amber */
6375 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
6377 uint16_t led3_blink_on;
6379 * If the LED #3 state is "blink" or "blinkalt", then this field
6380 * represents the requested time in milliseconds to keep LED on
6383 uint16_t led3_blink_off;
6385 * If the LED #3 state is "blink" or "blinkalt", then this field
6386 * represents the requested time in milliseconds to keep LED off
6389 uint8_t led3_group_id;
6391 * An identifier for the group of LEDs that LED #3 belongs to.
6392 * If set to 0, then the LED #3 is not grouped. For all other
6393 * non-zero values of this field, LED #3 is grouped together
6394 * with the LEDs with the same group ID value.
6403 * This field is used in Output records to indicate that the
6404 * output is completely written to RAM. This field should be
6405 * read as '1' to indicate that the output has been completely
6406 * written. When writing a command completion or response to an
6407 * internal processor, the order of writes has to be such that
6408 * this field is written last.
6410 } __attribute__((packed));
6412 /* hwrm_port_led_qcaps */
6414 * Description: This function is used to query capabilities of LEDs on a given
6415 * port. Each port has individual set of LEDs associated with it. These LEDs are
6416 * used for speed/link configuration as well as activity indicator
6419 /* Input (24 bytes) */
6420 struct hwrm_port_led_qcaps_input {
6423 * This value indicates what type of request this is. The format
6424 * for the rest of the command is determined by this field.
6428 * This value indicates the what completion ring the request
6429 * will be optionally completed on. If the value is -1, then no
6430 * CR completion will be generated. Any other value must be a
6431 * valid CR ring_id value for this function.
6434 /* This value indicates the command sequence number. */
6437 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6438 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6443 * This is the host address where the response will be written
6444 * when the request is complete. This area must be 16B aligned
6445 * and must be cleared to zero before the request is made.
6448 /* Port ID of port whose LED configuration is being queried. */
6449 uint16_t unused_0[3];
6450 } __attribute__((packed));
6452 /* Output (48 bytes) */
6453 struct hwrm_port_led_qcaps_output {
6454 uint16_t error_code;
6456 * Pass/Fail or error type Note: receiver to verify the in
6457 * parameters, and fail the call with an error when appropriate
6460 /* This field returns the type of original request. */
6462 /* This field provides original sequence number of the command. */
6465 * This field is the length of the response in bytes. The last
6466 * byte of the response is a valid flag that will read as '1'
6467 * when the command has been completely written to memory.
6471 * The number of LEDs that are configured on this port. Up to 4
6472 * LEDs can be returned in the response.
6474 uint8_t unused_0[3];
6475 /* Reserved for future use. */
6477 /* An identifier for the LED #0. */
6479 /* The type of LED #0. */
6481 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0)
6483 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
6485 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff)
6486 uint8_t led0_group_id;
6488 * An identifier for the group of LEDs that LED #0 belongs to.
6489 * If set to 0, then the LED #0 cannot be grouped. For all other
6490 * non-zero values of this field, LED #0 is grouped together
6491 * with the LEDs with the same group ID value.
6494 uint16_t led0_state_caps;
6495 /* The states supported by LED #0. */
6497 * If set to 1, this LED is enabled. If set to 0, this LED is
6500 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED UINT32_C(0x1)
6502 * If set to 1, off state is supported on this LED. If set to 0,
6503 * off state is not supported on this LED.
6505 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
6508 * If set to 1, on state is supported on this LED. If set to 0,
6509 * on state is not supported on this LED.
6511 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
6514 * If set to 1, blink state is supported on this LED. If set to
6515 * 0, blink state is not supported on this LED.
6517 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
6520 * If set to 1, blink_alt state is supported on this LED. If set
6521 * to 0, blink_alt state is not supported on this LED.
6523 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
6525 uint16_t led0_color_caps;
6526 /* The colors supported by LED #0. */
6528 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD UINT32_C(0x1)
6530 * If set to 1, Amber color is supported on this LED. If set to
6531 * 0, Amber color is not supported on this LED.
6533 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
6536 * If set to 1, Green color is supported on this LED. If set to
6537 * 0, Green color is not supported on this LED.
6539 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
6542 /* An identifier for the LED #1. */
6544 /* The type of LED #1. */
6546 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0)
6548 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
6550 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff)
6551 uint8_t led1_group_id;
6553 * An identifier for the group of LEDs that LED #1 belongs to.
6554 * If set to 0, then the LED #0 cannot be grouped. For all other
6555 * non-zero values of this field, LED #0 is grouped together
6556 * with the LEDs with the same group ID value.
6559 uint16_t led1_state_caps;
6560 /* The states supported by LED #1. */
6562 * If set to 1, this LED is enabled. If set to 0, this LED is
6565 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED UINT32_C(0x1)
6567 * If set to 1, off state is supported on this LED. If set to 0,
6568 * off state is not supported on this LED.
6570 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
6573 * If set to 1, on state is supported on this LED. If set to 0,
6574 * on state is not supported on this LED.
6576 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
6579 * If set to 1, blink state is supported on this LED. If set to
6580 * 0, blink state is not supported on this LED.
6582 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
6585 * If set to 1, blink_alt state is supported on this LED. If set
6586 * to 0, blink_alt state is not supported on this LED.
6588 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
6590 uint16_t led1_color_caps;
6591 /* The colors supported by LED #1. */
6593 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD UINT32_C(0x1)
6595 * If set to 1, Amber color is supported on this LED. If set to
6596 * 0, Amber color is not supported on this LED.
6598 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
6601 * If set to 1, Green color is supported on this LED. If set to
6602 * 0, Green color is not supported on this LED.
6604 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
6607 /* An identifier for the LED #2. */
6609 /* The type of LED #2. */
6611 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0)
6613 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
6615 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff)
6616 uint8_t led2_group_id;
6618 * An identifier for the group of LEDs that LED #0 belongs to.
6619 * If set to 0, then the LED #0 cannot be grouped. For all other
6620 * non-zero values of this field, LED #0 is grouped together
6621 * with the LEDs with the same group ID value.
6624 uint16_t led2_state_caps;
6625 /* The states supported by LED #2. */
6627 * If set to 1, this LED is enabled. If set to 0, this LED is
6630 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED UINT32_C(0x1)
6632 * If set to 1, off state is supported on this LED. If set to 0,
6633 * off state is not supported on this LED.
6635 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
6638 * If set to 1, on state is supported on this LED. If set to 0,
6639 * on state is not supported on this LED.
6641 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
6644 * If set to 1, blink state is supported on this LED. If set to
6645 * 0, blink state is not supported on this LED.
6647 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
6650 * If set to 1, blink_alt state is supported on this LED. If set
6651 * to 0, blink_alt state is not supported on this LED.
6653 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
6655 uint16_t led2_color_caps;
6656 /* The colors supported by LED #2. */
6658 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD UINT32_C(0x1)
6660 * If set to 1, Amber color is supported on this LED. If set to
6661 * 0, Amber color is not supported on this LED.
6663 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
6666 * If set to 1, Green color is supported on this LED. If set to
6667 * 0, Green color is not supported on this LED.
6669 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
6672 /* An identifier for the LED #3. */
6674 /* The type of LED #3. */
6676 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0)
6678 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
6680 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff)
6681 uint8_t led3_group_id;
6683 * An identifier for the group of LEDs that LED #3 belongs to.
6684 * If set to 0, then the LED #0 cannot be grouped. For all other
6685 * non-zero values of this field, LED #0 is grouped together
6686 * with the LEDs with the same group ID value.
6689 uint16_t led3_state_caps;
6690 /* The states supported by LED #3. */
6692 * If set to 1, this LED is enabled. If set to 0, this LED is
6695 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED UINT32_C(0x1)
6697 * If set to 1, off state is supported on this LED. If set to 0,
6698 * off state is not supported on this LED.
6700 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
6703 * If set to 1, on state is supported on this LED. If set to 0,
6704 * on state is not supported on this LED.
6706 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
6709 * If set to 1, blink state is supported on this LED. If set to
6710 * 0, blink state is not supported on this LED.
6712 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
6715 * If set to 1, blink_alt state is supported on this LED. If set
6716 * to 0, blink_alt state is not supported on this LED.
6718 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
6720 uint16_t led3_color_caps;
6721 /* The colors supported by LED #3. */
6723 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD UINT32_C(0x1)
6725 * If set to 1, Amber color is supported on this LED. If set to
6726 * 0, Amber color is not supported on this LED.
6728 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
6731 * If set to 1, Green color is supported on this LED. If set to
6732 * 0, Green color is not supported on this LED.
6734 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
6741 * This field is used in Output records to indicate that the
6742 * output is completely written to RAM. This field should be
6743 * read as '1' to indicate that the output has been completely
6744 * written. When writing a command completion or response to an
6745 * internal processor, the order of writes has to be such that
6746 * this field is written last.
6748 } __attribute__((packed));
6750 /* hwrm_queue_qportcfg */
6752 * Description: This function is called by a driver to query queue configuration
6753 * of a port. # The HWRM shall at least advertise one queue with lossy service
6754 * profile. # The driver shall use this command to query queue ids before
6755 * configuring or using any queues. # If a service profile is not set for a
6756 * queue, then the driver shall not use that queue without configuring a service
6757 * profile for it. # If the driver is not allowed to configure service profiles,
6758 * then the driver shall only use queues for which service profiles are pre-
6761 /* Input (24 bytes) */
6762 /* hwrm_queue_qportcfg_input (size:192b/24B) */
6763 struct hwrm_queue_qportcfg_input {
6764 /* The HWRM command request type. */
6767 * The completion ring to send the completion event on. This should
6768 * be the NQ ID returned from the `nq_alloc` HWRM command.
6772 * The sequence ID is used by the driver for tracking multiple
6773 * commands. This ID is treated as opaque data by the firmware and
6774 * the value is returned in the `hwrm_resp_hdr` upon completion.
6778 * The target ID of the command:
6779 * * 0x0-0xFFF8 - The function ID
6780 * * 0xFFF8-0xFFFE - Reserved for internal processors
6785 * A physical address pointer pointing to a host buffer that the
6786 * command's response data will be written. This can be either a host
6787 * physical address (HPA) or a guest physical address (GPA) and must
6788 * point to a physically contiguous block of memory.
6793 * Enumeration denoting the RX, TX type of the resource.
6794 * This enumeration is used for resources that are similar for both
6795 * TX and RX paths of the chip.
6797 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
6799 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
6801 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
6802 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
6803 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
6805 * Port ID of port for which the queue configuration is being
6806 * queried. This field is only required when sent by IPC.
6810 * Drivers will set this capability when it can use
6811 * queue_idx_service_profile to map the queues to application.
6813 uint8_t drv_qmap_cap;
6815 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
6817 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED UINT32_C(0x1)
6818 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
6819 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
6821 } __attribute__((packed));
6823 /* Output (32 bytes) */
6824 /* hwrm_queue_qportcfg_output (size:256b/32B) */
6825 struct hwrm_queue_qportcfg_output {
6826 /* The specific error status for the command. */
6827 uint16_t error_code;
6828 /* The HWRM command request type. */
6830 /* The sequence ID from the original command. */
6832 /* The length of the response data in number of bytes. */
6835 * The maximum number of queues that can be configured on this
6837 * Valid values range from 1 through 8.
6839 uint8_t max_configurable_queues;
6841 * The maximum number of lossless queues that can be configured
6843 * Valid values range from 0 through 8.
6845 uint8_t max_configurable_lossless_queues;
6847 * Bitmask indicating which queues can be configured by the
6848 * hwrm_queue_cfg command.
6850 * Each bit represents a specific queue where bit 0 represents
6851 * queue 0 and bit 7 represents queue 7.
6852 * # A value of 0 indicates that the queue is not configurable
6853 * by the hwrm_queue_cfg command.
6854 * # A value of 1 indicates that the queue is configurable.
6855 * # A hwrm_queue_cfg command shall return error when trying to
6856 * configure a queue not configurable.
6858 uint8_t queue_cfg_allowed;
6859 /* Information about queue configuration. */
6860 uint8_t queue_cfg_info;
6862 * If this flag is set to '1', then the queues are
6863 * configured asymmetrically on TX and RX sides.
6864 * If this flag is set to '0', then the queues are
6865 * configured symmetrically on TX and RX sides. For
6866 * symmetric configuration, the queue configuration
6867 * including queue ids and service profiles on the
6868 * TX side is the same as the corresponding queue
6869 * configuration on the RX side.
6871 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
6874 * Bitmask indicating which queues can be configured by the
6875 * hwrm_queue_pfcenable_cfg command.
6877 * Each bit represents a specific priority where bit 0 represents
6878 * priority 0 and bit 7 represents priority 7.
6879 * # A value of 0 indicates that the priority is not configurable by
6880 * the hwrm_queue_pfcenable_cfg command.
6881 * # A value of 1 indicates that the priority is configurable.
6882 * # A hwrm_queue_pfcenable_cfg command shall return error when
6883 * trying to configure a priority that is not configurable.
6885 uint8_t queue_pfcenable_cfg_allowed;
6887 * Bitmask indicating which queues can be configured by the
6888 * hwrm_queue_pri2cos_cfg command.
6890 * Each bit represents a specific queue where bit 0 represents
6891 * queue 0 and bit 7 represents queue 7.
6892 * # A value of 0 indicates that the queue is not configurable
6893 * by the hwrm_queue_pri2cos_cfg command.
6894 * # A value of 1 indicates that the queue is configurable.
6895 * # A hwrm_queue_pri2cos_cfg command shall return error when
6896 * trying to configure a queue that is not configurable.
6898 uint8_t queue_pri2cos_cfg_allowed;
6900 * Bitmask indicating which queues can be configured by the
6901 * hwrm_queue_pri2cos_cfg command.
6903 * Each bit represents a specific queue where bit 0 represents
6904 * queue 0 and bit 7 represents queue 7.
6905 * # A value of 0 indicates that the queue is not configurable
6906 * by the hwrm_queue_pri2cos_cfg command.
6907 * # A value of 1 indicates that the queue is configurable.
6908 * # A hwrm_queue_pri2cos_cfg command shall return error when
6909 * trying to configure a queue not configurable.
6911 uint8_t queue_cos2bw_cfg_allowed;
6913 * ID of CoS Queue 0.
6916 * # This ID can be used on any subsequent call to an hwrm command
6917 * that takes a queue id.
6918 * # IDs must always be queried by this command before any use
6919 * by the driver or software.
6920 * # Any driver or software should not make any assumptions about
6922 * # A value of 0xff indicates that the queue is not available.
6923 * # Available queues may not be in sequential order.
6926 /* This value is applicable to CoS queues only. */
6927 uint8_t queue_id0_service_profile;
6928 /* Lossy (best-effort) */
6929 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
6931 /* Lossless (legacy) */
6932 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
6935 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
6937 /* Lossy RoCE CNP */
6938 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
6941 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
6943 /* Set to 0xFF... (All Fs) if there is no service profile specified */
6944 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
6946 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
6947 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
6949 * ID of CoS Queue 1.
6952 * # This ID can be used on any subsequent call to an hwrm command
6953 * that takes a queue id.
6954 * # IDs must always be queried by this command before any use
6955 * by the driver or software.
6956 * # Any driver or software should not make any assumptions about
6958 * # A value of 0xff indicates that the queue is not available.
6959 * # Available queues may not be in sequential order.
6962 /* This value is applicable to CoS queues only. */
6963 uint8_t queue_id1_service_profile;
6964 /* Lossy (best-effort) */
6965 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
6967 /* Lossless (legacy) */
6968 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
6971 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
6973 /* Lossy RoCE CNP */
6974 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
6977 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
6979 /* Set to 0xFF... (All Fs) if there is no service profile specified */
6980 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
6982 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
6983 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
6985 * ID of CoS Queue 2.
6988 * # This ID can be used on any subsequent call to an hwrm command
6989 * that takes a queue id.
6990 * # IDs must always be queried by this command before any use
6991 * by the driver or software.
6992 * # Any driver or software should not make any assumptions about
6994 * # A value of 0xff indicates that the queue is not available.
6995 * # Available queues may not be in sequential order.
6998 /* This value is applicable to CoS queues only. */
6999 uint8_t queue_id2_service_profile;
7000 /* Lossy (best-effort) */
7001 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
7003 /* Lossless (legacy) */
7004 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
7007 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
7009 /* Lossy RoCE CNP */
7010 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
7013 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
7015 /* Set to 0xFF... (All Fs) if there is no service profile specified */
7016 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
7018 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
7019 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
7021 * ID of CoS Queue 3.
7024 * # This ID can be used on any subsequent call to an hwrm command
7025 * that takes a queue id.
7026 * # IDs must always be queried by this command before any use
7027 * by the driver or software.
7028 * # Any driver or software should not make any assumptions about
7030 * # A value of 0xff indicates that the queue is not available.
7031 * # Available queues may not be in sequential order.
7034 /* This value is applicable to CoS queues only. */
7035 uint8_t queue_id3_service_profile;
7036 /* Lossy (best-effort) */
7037 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
7039 /* Lossless (legacy) */
7040 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
7043 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
7045 /* Lossy RoCE CNP */
7046 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
7049 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
7051 /* Set to 0xFF... (All Fs) if there is no service profile specified */
7052 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
7054 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
7055 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
7057 * ID of CoS Queue 4.
7060 * # This ID can be used on any subsequent call to an hwrm command
7061 * that takes a queue id.
7062 * # IDs must always be queried by this command before any use
7063 * by the driver or software.
7064 * # Any driver or software should not make any assumptions about
7066 * # A value of 0xff indicates that the queue is not available.
7067 * # Available queues may not be in sequential order.
7070 /* This value is applicable to CoS queues only. */
7071 uint8_t queue_id4_service_profile;
7072 /* Lossy (best-effort) */
7073 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
7075 /* Lossless (legacy) */
7076 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
7079 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
7081 /* Lossy RoCE CNP */
7082 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
7085 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
7087 /* Set to 0xFF... (All Fs) if there is no service profile specified */
7088 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
7090 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
7091 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
7093 * ID of CoS Queue 5.
7096 * # This ID can be used on any subsequent call to an hwrm command
7097 * that takes a queue id.
7098 * # IDs must always be queried by this command before any use
7099 * by the driver or software.
7100 * # Any driver or software should not make any assumptions about
7102 * # A value of 0xff indicates that the queue is not available.
7103 * # Available queues may not be in sequential order.
7106 /* This value is applicable to CoS queues only. */
7107 uint8_t queue_id5_service_profile;
7108 /* Lossy (best-effort) */
7109 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
7111 /* Lossless (legacy) */
7112 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
7115 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
7117 /* Lossy RoCE CNP */
7118 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
7121 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
7123 /* Set to 0xFF... (All Fs) if there is no service profile specified */
7124 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
7126 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
7127 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
7129 * ID of CoS Queue 6.
7132 * # This ID can be used on any subsequent call to an hwrm command
7133 * that takes a queue id.
7134 * # IDs must always be queried by this command before any use
7135 * by the driver or software.
7136 * # Any driver or software should not make any assumptions about
7138 * # A value of 0xff indicates that the queue is not available.
7139 * # Available queues may not be in sequential order.
7142 /* This value is applicable to CoS queues only. */
7143 uint8_t queue_id6_service_profile;
7144 /* Lossy (best-effort) */
7145 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
7147 /* Lossless (legacy) */
7148 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
7151 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
7153 /* Lossy RoCE CNP */
7154 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
7157 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
7159 /* Set to 0xFF... (All Fs) if there is no service profile specified */
7160 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
7162 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
7163 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
7165 * ID of CoS Queue 7.
7168 * # This ID can be used on any subsequent call to an hwrm command
7169 * that takes a queue id.
7170 * # IDs must always be queried by this command before any use
7171 * by the driver or software.
7172 * # Any driver or software should not make any assumptions about
7174 * # A value of 0xff indicates that the queue is not available.
7175 * # Available queues may not be in sequential order.
7178 /* This value is applicable to CoS queues only. */
7179 uint8_t queue_id7_service_profile;
7180 /* Lossy (best-effort) */
7181 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
7183 /* Lossless (legacy) */
7184 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
7187 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
7189 /* Lossy RoCE CNP */
7190 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
7193 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
7195 /* Set to 0xFF... (All Fs) if there is no service profile specified */
7196 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
7198 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
7199 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
7201 * This field is used in Output records to indicate that the output
7202 * is completely written to RAM. This field should be read as '1'
7203 * to indicate that the output has been completely written.
7204 * When writing a command completion or response to an internal
7206 * the order of writes has to be such that this field is written last.
7209 } __attribute__((packed));
7211 /*********************
7212 * hwrm_port_mac_cfg *
7213 *********************/
7216 /* hwrm_port_mac_cfg_input (size:320b/40B) */
7217 struct hwrm_port_mac_cfg_input {
7224 #define PORT_MAC_CFG_REQ_FLAGS_MATCH_LINK 0x1UL
7225 #define PORT_MAC_CFG_REQ_FLAGS_VLAN_PRI2COS_ENABLE 0x2UL
7226 #define PORT_MAC_CFG_REQ_FLAGS_TUNNEL_PRI2COS_ENABLE 0x4UL
7227 #define PORT_MAC_CFG_REQ_FLAGS_IP_DSCP2COS_ENABLE 0x8UL
7228 #define PORT_MAC_CFG_REQ_FLAGS_PTP_RX_TS_CAPTURE_ENABLE 0x10UL
7229 #define PORT_MAC_CFG_REQ_FLAGS_PTP_RX_TS_CAPTURE_DISABLE 0x20UL
7230 #define PORT_MAC_CFG_REQ_FLAGS_PTP_TX_TS_CAPTURE_ENABLE 0x40UL
7231 #define PORT_MAC_CFG_REQ_FLAGS_PTP_TX_TS_CAPTURE_DISABLE 0x80UL
7232 #define PORT_MAC_CFG_REQ_FLAGS_OOB_WOL_ENABLE 0x100UL
7233 #define PORT_MAC_CFG_REQ_FLAGS_OOB_WOL_DISABLE 0x200UL
7234 #define PORT_MAC_CFG_REQ_FLAGS_VLAN_PRI2COS_DISABLE 0x400UL
7235 #define PORT_MAC_CFG_REQ_FLAGS_TUNNEL_PRI2COS_DISABLE 0x800UL
7236 #define PORT_MAC_CFG_REQ_FLAGS_IP_DSCP2COS_DISABLE 0x1000UL
7238 #define PORT_MAC_CFG_REQ_ENABLES_IPG 0x1UL
7239 #define PORT_MAC_CFG_REQ_ENABLES_LPBK 0x2UL
7240 #define PORT_MAC_CFG_REQ_ENABLES_VLAN_PRI2COS_MAP_PRI 0x4UL
7241 #define PORT_MAC_CFG_REQ_ENABLES_TUNNEL_PRI2COS_MAP_PRI 0x10UL
7242 #define PORT_MAC_CFG_REQ_ENABLES_DSCP2COS_MAP_PRI 0x20UL
7243 #define PORT_MAC_CFG_REQ_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE 0x40UL
7244 #define PORT_MAC_CFG_REQ_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE 0x80UL
7245 #define PORT_MAC_CFG_REQ_ENABLES_COS_FIELD_CFG 0x100UL
7249 #define PORT_MAC_CFG_REQ_LPBK_NONE 0x0UL
7250 #define PORT_MAC_CFG_REQ_LPBK_LOCAL 0x1UL
7251 #define PORT_MAC_CFG_REQ_LPBK_REMOTE 0x2UL
7252 #define PORT_MAC_CFG_REQ_LPBK_LAST PORT_MAC_CFG_REQ_LPBK_REMOTE
7253 uint8_t vlan_pri2cos_map_pri;
7255 uint8_t tunnel_pri2cos_map_pri;
7256 uint8_t dscp2pri_map_pri;
7257 uint16_t rx_ts_capture_ptp_msg_type;
7258 uint16_t tx_ts_capture_ptp_msg_type;
7259 uint8_t cos_field_cfg;
7260 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_RSVD1 0x1UL
7261 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_MASK 0x6UL
7262 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_SFT 1
7263 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
7265 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
7267 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
7269 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
7271 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
7272 PORT_MAC_CFG_REQ_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
7273 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK 0x18UL
7274 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT 3
7275 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
7277 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
7279 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
7281 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
7283 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
7284 PORT_MAC_CFG_REQ_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
7285 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_DEFAULT_COS_MASK 0xe0UL
7286 #define PORT_MAC_CFG_REQ_COS_FIELD_CFG_DEFAULT_COS_SFT 5
7287 uint8_t unused_0[3];
7291 /* hwrm_port_mac_cfg_output (size:128b/16B) */
7292 struct hwrm_port_mac_cfg_output {
7293 uint16_t error_code;
7301 #define PORT_MAC_CFG_RESP_LPBK_NONE 0x0UL
7302 #define PORT_MAC_CFG_RESP_LPBK_LOCAL 0x1UL
7303 #define PORT_MAC_CFG_RESP_LPBK_REMOTE 0x2UL
7304 #define PORT_MAC_CFG_RESP_LPBK_LAST PORT_MAC_CFG_RESP_LPBK_REMOTE
7310 /**********************
7311 * hwrm_port_mac_qcfg *
7312 **********************/
7315 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
7316 struct hwrm_port_mac_qcfg_input {
7323 uint8_t unused_0[6];
7327 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
7328 struct hwrm_port_mac_qcfg_output {
7329 uint16_t error_code;
7337 #define PORT_MAC_QCFG_RESP_LPBK_NONE 0x0UL
7338 #define PORT_MAC_QCFG_RESP_LPBK_LOCAL 0x1UL
7339 #define PORT_MAC_QCFG_RESP_LPBK_REMOTE 0x2UL
7340 #define PORT_MAC_QCFG_RESP_LPBK_LAST PORT_MAC_QCFG_RESP_LPBK_REMOTE
7341 uint8_t vlan_pri2cos_map_pri;
7343 #define PORT_MAC_QCFG_RESP_FLAGS_VLAN_PRI2COS_ENABLE 0x1UL
7344 #define PORT_MAC_QCFG_RESP_FLAGS_TUNNEL_PRI2COS_ENABLE 0x2UL
7345 #define PORT_MAC_QCFG_RESP_FLAGS_IP_DSCP2COS_ENABLE 0x4UL
7346 #define PORT_MAC_QCFG_RESP_FLAGS_OOB_WOL_ENABLE 0x8UL
7347 #define PORT_MAC_QCFG_RESP_FLAGS_PTP_RX_TS_CAPTURE_ENABLE 0x10UL
7348 #define PORT_MAC_QCFG_RESP_FLAGS_PTP_TX_TS_CAPTURE_ENABLE 0x20UL
7349 uint8_t tunnel_pri2cos_map_pri;
7350 uint8_t dscp2pri_map_pri;
7351 uint16_t rx_ts_capture_ptp_msg_type;
7352 uint16_t tx_ts_capture_ptp_msg_type;
7353 uint8_t cos_field_cfg;
7354 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_RSVD 0x1UL
7355 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_MASK 0x6UL
7356 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_SFT 1
7357 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
7359 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
7361 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
7363 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
7365 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
7366 PORT_MAC_QCFG_RESP_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
7367 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK 0x18UL
7368 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT 3
7369 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
7371 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
7373 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
7375 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
7377 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
7378 PORT_MAC_QCFG_RESP_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
7379 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_DEFAULT_COS_MASK 0xe0UL
7380 #define PORT_MAC_QCFG_RESP_COS_FIELD_CFG_DEFAULT_COS_SFT 5
7385 /**************************
7386 * hwrm_port_mac_ptp_qcfg *
7387 **************************/
7390 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
7391 struct hwrm_port_mac_ptp_qcfg_input {
7398 uint8_t unused_0[6];
7402 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
7403 struct hwrm_port_mac_ptp_qcfg_output {
7404 uint16_t error_code;
7409 #define PORT_MAC_PTP_QCFG_RESP_FLAGS_DIRECT_ACCESS 0x1UL
7410 #define PORT_MAC_PTP_QCFG_RESP_FLAGS_HWRM_ACCESS 0x2UL
7411 uint8_t unused_0[3];
7412 uint32_t rx_ts_reg_off_lower;
7413 uint32_t rx_ts_reg_off_upper;
7414 uint32_t rx_ts_reg_off_seq_id;
7415 uint32_t rx_ts_reg_off_src_id_0;
7416 uint32_t rx_ts_reg_off_src_id_1;
7417 uint32_t rx_ts_reg_off_src_id_2;
7418 uint32_t rx_ts_reg_off_domain_id;
7419 uint32_t rx_ts_reg_off_fifo;
7420 uint32_t rx_ts_reg_off_fifo_adv;
7421 uint32_t rx_ts_reg_off_granularity;
7422 uint32_t tx_ts_reg_off_lower;
7423 uint32_t tx_ts_reg_off_upper;
7424 uint32_t tx_ts_reg_off_seq_id;
7425 uint32_t tx_ts_reg_off_fifo;
7426 uint32_t tx_ts_reg_off_granularity;
7427 uint8_t unused_1[7];
7432 /* hwrm_vnic_alloc */
7434 * Description: This VNIC is a resource in the RX side of the chip that is used
7435 * to represent a virtual host "interface". # At the time of VNIC allocation or
7436 * configuration, the function can specify whether it wants the requested VNIC
7437 * to be the default VNIC for the function or not. # If a function requests
7438 * allocation of a VNIC for the first time and a VNIC is successfully allocated
7439 * by the HWRM, then the HWRM shall make the allocated VNIC as the default VNIC
7440 * for that function. # The default VNIC shall be used for the default action
7441 * for a partition or function. # For each VNIC allocated on a function, a
7442 * mapping on the RX side to map the allocated VNIC to source virtual interface
7443 * shall be performed by the HWRM. This should be hidden to the function driver
7444 * requesting the VNIC allocation. This enables broadcast/multicast replication
7445 * with source knockout. # If multicast replication with source knockout is
7446 * enabled, then the internal VNIC to SVIF mapping data structures shall be
7447 * programmed at the time of VNIC allocation.
7449 /* Input (24 bytes) */
7450 struct hwrm_vnic_alloc_input {
7453 * This value indicates what type of request this is. The format
7454 * for the rest of the command is determined by this field.
7458 * This value indicates the what completion ring the request
7459 * will be optionally completed on. If the value is -1, then no
7460 * CR completion will be generated. Any other value must be a
7461 * valid CR ring_id value for this function.
7464 /* This value indicates the command sequence number. */
7467 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7468 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7473 * This is the host address where the response will be written
7474 * when the request is complete. This area must be 16B aligned
7475 * and must be cleared to zero before the request is made.
7479 * When this bit is '1', this VNIC is requested to be the
7480 * default VNIC for this function.
7482 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
7484 } __attribute__((packed));
7486 /* Output (16 bytes) */
7487 struct hwrm_vnic_alloc_output {
7488 uint16_t error_code;
7490 * Pass/Fail or error type Note: receiver to verify the in
7491 * parameters, and fail the call with an error when appropriate
7494 /* This field returns the type of original request. */
7496 /* This field provides original sequence number of the command. */
7499 * This field is the length of the response in bytes. The last
7500 * byte of the response is a valid flag that will read as '1'
7501 * when the command has been completely written to memory.
7504 /* Logical vnic ID */
7510 * This field is used in Output records to indicate that the
7511 * output is completely written to RAM. This field should be
7512 * read as '1' to indicate that the output has been completely
7513 * written. When writing a command completion or response to an
7514 * internal processor, the order of writes has to be such that
7515 * this field is written last.
7517 } __attribute__((packed));
7519 /* hwrm_vnic_free */
7521 * Description: Free a VNIC resource. Idle any resources associated with the
7522 * VNIC as well as the VNIC. Reset and release all resources associated with the
7525 /* Input (24 bytes) */
7526 struct hwrm_vnic_free_input {
7529 * This value indicates what type of request this is. The format
7530 * for the rest of the command is determined by this field.
7534 * This value indicates the what completion ring the request
7535 * will be optionally completed on. If the value is -1, then no
7536 * CR completion will be generated. Any other value must be a
7537 * valid CR ring_id value for this function.
7540 /* This value indicates the command sequence number. */
7543 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7544 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7549 * This is the host address where the response will be written
7550 * when the request is complete. This area must be 16B aligned
7551 * and must be cleared to zero before the request is made.
7554 /* Logical vnic ID */
7556 } __attribute__((packed));
7558 /* Output (16 bytes) */
7559 struct hwrm_vnic_free_output {
7560 uint16_t error_code;
7562 * Pass/Fail or error type Note: receiver to verify the in
7563 * parameters, and fail the call with an error when appropriate
7566 /* This field returns the type of original request. */
7568 /* This field provides original sequence number of the command. */
7571 * This field is the length of the response in bytes. The last
7572 * byte of the response is a valid flag that will read as '1'
7573 * when the command has been completely written to memory.
7581 * This field is used in Output records to indicate that the
7582 * output is completely written to RAM. This field should be
7583 * read as '1' to indicate that the output has been completely
7584 * written. When writing a command completion or response to an
7585 * internal processor, the order of writes has to be such that
7586 * this field is written last.
7588 } __attribute__((packed));
7591 /* Description: Configure the RX VNIC structure. */
7592 /* Input (40 bytes) */
7593 struct hwrm_vnic_cfg_input {
7596 * This value indicates what type of request this is. The format
7597 * for the rest of the command is determined by this field.
7601 * This value indicates the what completion ring the request
7602 * will be optionally completed on. If the value is -1, then no
7603 * CR completion will be generated. Any other value must be a
7604 * valid CR ring_id value for this function.
7607 /* This value indicates the command sequence number. */
7610 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7611 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7616 * This is the host address where the response will be written
7617 * when the request is complete. This area must be 16B aligned
7618 * and must be cleared to zero before the request is made.
7622 * When this bit is '1', the VNIC is requested to be the default
7623 * VNIC for the function.
7625 #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
7627 * When this bit is '1', the VNIC is being configured to strip
7628 * VLAN in the RX path. If set to '0', then VLAN stripping is
7629 * disabled on this VNIC.
7631 #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
7633 * When this bit is '1', the VNIC is being configured to buffer
7634 * receive packets in the hardware until the host posts new
7635 * receive buffers. If set to '0', then bd_stall is being
7636 * configured to be disabled on this VNIC.
7638 #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
7640 * When this bit is '1', the VNIC is being configured to receive
7641 * both RoCE and non-RoCE traffic. If set to '0', then this VNIC
7642 * is not configured to be operating in dual VNIC mode.
7644 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
7646 * When this flag is set to '1', the VNIC is requested to be
7647 * configured to receive only RoCE traffic. If this flag is set
7648 * to '0', then this flag shall be ignored by the HWRM. If
7649 * roce_dual_vnic_mode flag is set to '1', then the HWRM client
7650 * shall not set this flag to '1'.
7652 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
7654 * When a VNIC uses one destination ring group for certain
7655 * application (e.g. Receive Flow Steering) where exact match is
7656 * used to direct packets to a VNIC with one destination ring
7657 * group only, there is no need to configure RSS indirection
7658 * table for that VNIC as only one destination ring group is
7659 * used. This flag is used to enable a mode where RSS is enabled
7660 * in the VNIC using a RSS context for computing RSS hash but
7661 * the RSS indirection table is not configured using
7662 * hwrm_vnic_rss_cfg. If this mode is enabled, then the driver
7663 * should not program RSS indirection table for the RSS context
7664 * that is used for computing RSS hash only.
7666 #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
7668 * When this bit is '1', the VNIC is being configured to receive
7669 * both RoCE and non-RoCE traffic, but forward only the RoCE
7670 * traffic further. Also, RoCE traffic can be mirrored to L2
7673 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
7677 * This bit must be '1' for the dflt_ring_grp field to be
7680 #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP UINT32_C(0x1)
7681 /* This bit must be '1' for the rss_rule field to be configured. */
7682 #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE UINT32_C(0x2)
7683 /* This bit must be '1' for the cos_rule field to be configured. */
7684 #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE UINT32_C(0x4)
7685 /* This bit must be '1' for the lb_rule field to be configured. */
7686 #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE UINT32_C(0x8)
7687 /* This bit must be '1' for the mru field to be configured. */
7688 #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU UINT32_C(0x10)
7690 /* Logical vnic ID */
7691 uint16_t dflt_ring_grp;
7693 * Default Completion ring for the VNIC. This ring will be
7694 * chosen if packet does not match any RSS rules and if there is
7699 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
7700 * there is no RSS rule.
7704 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
7705 * there is no COS rule.
7709 * RSS ID for load balancing rule/table structure. 0xFF... (All
7710 * Fs) if there is no LB rule.
7714 * The maximum receive unit of the vnic. Each vnic is associated
7715 * with a function. The vnic mru value overwrites the mru
7716 * setting of the associated function. The HWRM shall make sure
7717 * that vnic mru does not exceed the mru of the port the
7718 * function is associated with.
7721 } __attribute__((packed));
7723 /* Output (16 bytes) */
7724 struct hwrm_vnic_cfg_output {
7725 uint16_t error_code;
7727 * Pass/Fail or error type Note: receiver to verify the in
7728 * parameters, and fail the call with an error when appropriate
7731 /* This field returns the type of original request. */
7733 /* This field provides original sequence number of the command. */
7736 * This field is the length of the response in bytes. The last
7737 * byte of the response is a valid flag that will read as '1'
7738 * when the command has been completely written to memory.
7746 * This field is used in Output records to indicate that the
7747 * output is completely written to RAM. This field should be
7748 * read as '1' to indicate that the output has been completely
7749 * written. When writing a command completion or response to an
7750 * internal processor, the order of writes has to be such that
7751 * this field is written last.
7753 } __attribute__((packed));
7755 /* hwrm_vnic_qcfg */
7757 * Description: Query the RX VNIC structure. This function can be used by a PF
7758 * driver to query its own VNIC resource or VNIC resource of its child VF. This
7759 * function can also be used by a VF driver to query its own VNIC resource.
7761 /* Input (32 bytes) */
7762 struct hwrm_vnic_qcfg_input {
7765 * This value indicates what type of request this is. The format
7766 * for the rest of the command is determined by this field.
7770 * This value indicates the what completion ring the request
7771 * will be optionally completed on. If the value is -1, then no
7772 * CR completion will be generated. Any other value must be a
7773 * valid CR ring_id value for this function.
7776 /* This value indicates the command sequence number. */
7779 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7780 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7785 * This is the host address where the response will be written
7786 * when the request is complete. This area must be 16B aligned
7787 * and must be cleared to zero before the request is made.
7790 /* This bit must be '1' for the vf_id_valid field to be configured. */
7791 #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
7793 /* Logical vnic ID */
7795 /* ID of Virtual Function whose VNIC resource is being queried. */
7796 uint16_t unused_0[3];
7797 } __attribute__((packed));
7799 /* Output (32 bytes) */
7800 struct hwrm_vnic_qcfg_output {
7801 uint16_t error_code;
7803 * Pass/Fail or error type Note: receiver to verify the in
7804 * parameters, and fail the call with an error when appropriate
7807 /* This field returns the type of original request. */
7809 /* This field provides original sequence number of the command. */
7812 * This field is the length of the response in bytes. The last
7813 * byte of the response is a valid flag that will read as '1'
7814 * when the command has been completely written to memory.
7816 uint16_t dflt_ring_grp;
7817 /* Default Completion ring for the VNIC. */
7820 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
7821 * there is no RSS rule.
7825 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
7826 * there is no COS rule.
7830 * RSS ID for load balancing rule/table structure. 0xFF... (All
7831 * Fs) if there is no LB rule.
7834 /* The maximum receive unit of the vnic. */
7839 * When this bit is '1', the VNIC is the default VNIC for the
7842 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT UINT32_C(0x1)
7844 * When this bit is '1', the VNIC is configured to strip VLAN in
7845 * the RX path. If set to '0', then VLAN stripping is disabled
7848 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
7850 * When this bit is '1', the VNIC is configured to buffer
7851 * receive packets in the hardware until the host posts new
7852 * receive buffers. If set to '0', then bd_stall is disabled on
7855 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
7857 * When this bit is '1', the VNIC is configured to receive both
7858 * RoCE and non-RoCE traffic. If set to '0', then this VNIC is
7859 * not configured to operate in dual VNIC mode.
7861 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
7863 * When this flag is set to '1', the VNIC is configured to
7864 * receive only RoCE traffic. When this flag is set to '0', the
7865 * VNIC is not configured to receive only RoCE traffic. If
7866 * roce_dual_vnic_mode flag and this flag both are set to '1',
7867 * then it is an invalid configuration of the VNIC. The HWRM
7868 * should not allow that type of mis-configuration by HWRM
7871 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
7873 * When a VNIC uses one destination ring group for certain
7874 * application (e.g. Receive Flow Steering) where exact match is
7875 * used to direct packets to a VNIC with one destination ring
7876 * group only, there is no need to configure RSS indirection
7877 * table for that VNIC as only one destination ring group is
7878 * used. When this bit is set to '1', then the VNIC is enabled
7879 * in a mode where RSS is enabled in the VNIC using a RSS
7880 * context for computing RSS hash but the RSS indirection table
7881 * is not configured.
7883 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
7885 * When this bit is '1', the VNIC is configured to receive both
7886 * RoCE and non-RoCE traffic, but forward only RoCE traffic
7887 * further. Also RoCE traffic can be mirrored to L2 driver.
7889 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
7897 * This field is used in Output records to indicate that the
7898 * output is completely written to RAM. This field should be
7899 * read as '1' to indicate that the output has been completely
7900 * written. When writing a command completion or response to an
7901 * internal processor, the order of writes has to be such that
7902 * this field is written last.
7904 } __attribute__((packed));
7907 /* hwrm_vnic_tpa_cfg */
7908 /* Description: This function is used to enable/configure TPA on the VNIC. */
7909 /* Input (40 bytes) */
7910 struct hwrm_vnic_tpa_cfg_input {
7913 * This value indicates what type of request this is. The format
7914 * for the rest of the command is determined by this field.
7918 * This value indicates the what completion ring the request
7919 * will be optionally completed on. If the value is -1, then no
7920 * CR completion will be generated. Any other value must be a
7921 * valid CR ring_id value for this function.
7924 /* This value indicates the command sequence number. */
7927 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7928 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7933 * This is the host address where the response will be written
7934 * when the request is complete. This area must be 16B aligned
7935 * and must be cleared to zero before the request is made.
7939 * When this bit is '1', the VNIC shall be configured to perform
7940 * transparent packet aggregation (TPA) of non-tunneled TCP
7943 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA UINT32_C(0x1)
7945 * When this bit is '1', the VNIC shall be configured to perform
7946 * transparent packet aggregation (TPA) of tunneled TCP packets.
7948 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA UINT32_C(0x2)
7950 * When this bit is '1', the VNIC shall be configured to perform
7951 * transparent packet aggregation (TPA) according to Windows
7952 * Receive Segment Coalescing (RSC) rules.
7954 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE UINT32_C(0x4)
7956 * When this bit is '1', the VNIC shall be configured to perform
7957 * transparent packet aggregation (TPA) according to Linux
7958 * Generic Receive Offload (GRO) rules.
7960 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO UINT32_C(0x8)
7962 * When this bit is '1', the VNIC shall be configured to perform
7963 * transparent packet aggregation (TPA) for TCP packets with IP
7964 * ECN set to non-zero.
7966 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN UINT32_C(0x10)
7968 * When this bit is '1', the VNIC shall be configured to perform
7969 * transparent packet aggregation (TPA) for GRE tunneled TCP
7970 * packets only if all packets have the same GRE sequence.
7972 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
7975 * When this bit is '1' and the GRO mode is enabled, the VNIC
7976 * shall be configured to perform transparent packet aggregation
7977 * (TPA) for TCP/IPv4 packets with consecutively increasing
7978 * IPIDs. In other words, the last packet that is being
7979 * aggregated to an already existing aggregation context shall
7980 * have IPID 1 more than the IPID of the last packet that was
7981 * aggregated in that aggregation context.
7983 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK UINT32_C(0x40)
7985 * When this bit is '1' and the GRO mode is enabled, the VNIC
7986 * shall be configured to perform transparent packet aggregation
7987 * (TPA) for TCP packets with the same TTL (IPv4) or Hop limit
7990 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK UINT32_C(0x80)
7992 /* This bit must be '1' for the max_agg_segs field to be configured. */
7993 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS UINT32_C(0x1)
7994 /* This bit must be '1' for the max_aggs field to be configured. */
7995 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS UINT32_C(0x2)
7997 * This bit must be '1' for the max_agg_timer field to be
8000 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER UINT32_C(0x4)
8001 /* This bit must be '1' for the min_agg_len field to be configured. */
8002 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN UINT32_C(0x8)
8004 /* Logical vnic ID */
8005 uint16_t max_agg_segs;
8007 * This is the maximum number of TCP segments that can be
8008 * aggregated (unit is Log2). Max value is 31.
8011 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1 UINT32_C(0x0)
8013 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2 UINT32_C(0x1)
8015 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4 UINT32_C(0x2)
8017 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8 UINT32_C(0x3)
8018 /* Any segment size larger than this is not valid */
8019 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
8022 * This is the maximum number of aggregations this VNIC is
8023 * allowed (unit is Log2). Max value is 7
8026 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1 UINT32_C(0x0)
8027 /* 2 aggregations */
8028 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2 UINT32_C(0x1)
8029 /* 4 aggregations */
8030 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4 UINT32_C(0x2)
8031 /* 8 aggregations */
8032 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8 UINT32_C(0x3)
8033 /* 16 aggregations */
8034 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16 UINT32_C(0x4)
8035 /* Any aggregation size larger than this is not valid */
8036 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
8039 uint32_t max_agg_timer;
8041 * This is the maximum amount of time allowed for an aggregation
8042 * context to complete after it was initiated.
8044 uint32_t min_agg_len;
8046 * This is the minimum amount of payload length required to
8047 * start an aggregation context.
8049 } __attribute__((packed));
8051 /* Output (16 bytes) */
8052 struct hwrm_vnic_tpa_cfg_output {
8053 uint16_t error_code;
8055 * Pass/Fail or error type Note: receiver to verify the in
8056 * parameters, and fail the call with an error when appropriate
8059 /* This field returns the type of original request. */
8061 /* This field provides original sequence number of the command. */
8064 * This field is the length of the response in bytes. The last
8065 * byte of the response is a valid flag that will read as '1'
8066 * when the command has been completely written to memory.
8074 * This field is used in Output records to indicate that the
8075 * output is completely written to RAM. This field should be
8076 * read as '1' to indicate that the output has been completely
8077 * written. When writing a command completion or response to an
8078 * internal processor, the order of writes has to be such that
8079 * this field is written last.
8081 } __attribute__((packed));
8083 /* hwrm_vnic_rss_cfg */
8084 /* Description: This function is used to enable RSS configuration. */
8085 /* Input (48 bytes) */
8086 struct hwrm_vnic_rss_cfg_input {
8089 * This value indicates what type of request this is. The format
8090 * for the rest of the command is determined by this field.
8094 * This value indicates the what completion ring the request
8095 * will be optionally completed on. If the value is -1, then no
8096 * CR completion will be generated. Any other value must be a
8097 * valid CR ring_id value for this function.
8100 /* This value indicates the command sequence number. */
8103 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8104 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8109 * This is the host address where the response will be written
8110 * when the request is complete. This area must be 16B aligned
8111 * and must be cleared to zero before the request is made.
8115 * When this bit is '1', the RSS hash shall be computed over
8116 * source and destination IPv4 addresses of IPv4 packets.
8118 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
8120 * When this bit is '1', the RSS hash shall be computed over
8121 * source/destination IPv4 addresses and source/destination
8122 * ports of TCP/IPv4 packets.
8124 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
8126 * When this bit is '1', the RSS hash shall be computed over
8127 * source/destination IPv4 addresses and source/destination
8128 * ports of UDP/IPv4 packets.
8130 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
8132 * When this bit is '1', the RSS hash shall be computed over
8133 * source and destination IPv4 addresses of IPv6 packets.
8135 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
8137 * When this bit is '1', the RSS hash shall be computed over
8138 * source/destination IPv6 addresses and source/destination
8139 * ports of TCP/IPv6 packets.
8141 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
8143 * When this bit is '1', the RSS hash shall be computed over
8144 * source/destination IPv6 addresses and source/destination
8145 * ports of UDP/IPv6 packets.
8147 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
8149 uint64_t ring_grp_tbl_addr;
8150 /* This is the address for rss ring group table */
8151 uint64_t hash_key_tbl_addr;
8152 /* This is the address for rss hash key table */
8153 uint16_t rss_ctx_idx;
8154 /* Index to the rss indirection table. */
8155 uint16_t unused_1[3];
8156 } __attribute__((packed));
8158 /* Output (16 bytes) */
8159 struct hwrm_vnic_rss_cfg_output {
8160 uint16_t error_code;
8162 * Pass/Fail or error type Note: receiver to verify the in
8163 * parameters, and fail the call with an error when appropriate
8166 /* This field returns the type of original request. */
8168 /* This field provides original sequence number of the command. */
8171 * This field is the length of the response in bytes. The last
8172 * byte of the response is a valid flag that will read as '1'
8173 * when the command has been completely written to memory.
8181 * This field is used in Output records to indicate that the
8182 * output is completely written to RAM. This field should be
8183 * read as '1' to indicate that the output has been completely
8184 * written. When writing a command completion or response to an
8185 * internal processor, the order of writes has to be such that
8186 * this field is written last.
8188 } __attribute__((packed));
8190 /* hwrm_vnic_plcmodes_cfg */
8192 * Description: This function can be used to set placement mode configuration of
8195 /* Input (40 bytes) */
8196 struct hwrm_vnic_plcmodes_cfg_input {
8199 * This value indicates what type of request this is. The format for the
8200 * rest of the command is determined by this field.
8204 * This value indicates the what completion ring the request will be
8205 * optionally completed on. If the value is -1, then no CR completion
8206 * will be generated. Any other value must be a valid CR ring_id value
8207 * for this function.
8210 /* This value indicates the command sequence number. */
8213 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8214 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8218 * This is the host address where the response will be written when the
8219 * request is complete. This area must be 16B aligned and must be
8220 * cleared to zero before the request is made.
8224 * When this bit is '1', the VNIC shall be configured to use regular
8225 * placement algorithm. By default, the regular placement algorithm
8226 * shall be enabled on the VNIC.
8228 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
8231 * When this bit is '1', the VNIC shall be configured use the jumbo
8232 * placement algorithm.
8234 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
8237 * When this bit is '1', the VNIC shall be configured to enable Header-
8238 * Data split for IPv4 packets according to the following rules: # If
8239 * the packet is identified as TCP/IPv4, then the packet is split at the
8240 * beginning of the TCP payload. # If the packet is identified as
8241 * UDP/IPv4, then the packet is split at the beginning of UDP payload. #
8242 * If the packet is identified as non-TCP and non-UDP IPv4 packet, then
8243 * the packet is split at the beginning of the upper layer protocol
8244 * header carried in the IPv4 packet.
8246 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
8248 * When this bit is '1', the VNIC shall be configured to enable Header-
8249 * Data split for IPv6 packets according to the following rules: # If
8250 * the packet is identified as TCP/IPv6, then the packet is split at the
8251 * beginning of the TCP payload. # If the packet is identified as
8252 * UDP/IPv6, then the packet is split at the beginning of UDP payload. #
8253 * If the packet is identified as non-TCP and non-UDP IPv6 packet, then
8254 * the packet is split at the beginning of the upper layer protocol
8255 * header carried in the IPv6 packet.
8257 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
8259 * When this bit is '1', the VNIC shall be configured to enable Header-
8260 * Data split for FCoE packets at the beginning of FC payload.
8262 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
8264 * When this bit is '1', the VNIC shall be configured to enable Header-
8265 * Data split for RoCE packets at the beginning of RoCE payload (after
8268 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
8271 * This bit must be '1' for the jumbo_thresh_valid field to be
8274 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
8277 * This bit must be '1' for the hds_offset_valid field to be configured.
8279 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
8282 * This bit must be '1' for the hds_threshold_valid field to be
8285 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
8288 /* Logical vnic ID */
8289 uint16_t jumbo_thresh;
8291 * When jumbo placement algorithm is enabled, this value is used to
8292 * determine the threshold for jumbo placement. Packets with length
8293 * larger than this value will be placed according to the jumbo
8294 * placement algorithm.
8296 uint16_t hds_offset;
8298 * This value is used to determine the offset into packet buffer where
8299 * the split data (payload) will be placed according to one of of HDS
8300 * placement algorithm. The lengths of packet buffers provided for split
8301 * data shall be larger than this value.
8303 uint16_t hds_threshold;
8305 * When one of the HDS placement algorithm is enabled, this value is
8306 * used to determine the threshold for HDS placement. Packets with
8307 * length larger than this value will be placed according to the HDS
8308 * placement algorithm. This value shall be in multiple of 4 bytes.
8310 uint16_t unused_0[3];
8311 } __attribute__((packed));
8313 /* Output (16 bytes) */
8314 struct hwrm_vnic_plcmodes_cfg_output {
8315 uint16_t error_code;
8317 * Pass/Fail or error type Note: receiver to verify the in parameters,
8318 * and fail the call with an error when appropriate
8321 /* This field returns the type of original request. */
8323 /* This field provides original sequence number of the command. */
8326 * This field is the length of the response in bytes. The last byte of
8327 * the response is a valid flag that will read as '1' when the command
8328 * has been completely written to memory.
8336 * This field is used in Output records to indicate that the output is
8337 * completely written to RAM. This field should be read as '1' to
8338 * indicate that the output has been completely written. When writing a
8339 * command completion or response to an internal processor, the order of
8340 * writes has to be such that this field is written last.
8342 } __attribute__((packed));
8344 /* hwrm_vnic_plcmodes_qcfg */
8346 * Description: This function can be used to query placement mode configuration
8349 /* Input (24 bytes) */
8350 struct hwrm_vnic_plcmodes_qcfg_input {
8353 * This value indicates what type of request this is. The format for the
8354 * rest of the command is determined by this field.
8358 * This value indicates the what completion ring the request will be
8359 * optionally completed on. If the value is -1, then no CR completion
8360 * will be generated. Any other value must be a valid CR ring_id value
8361 * for this function.
8364 /* This value indicates the command sequence number. */
8367 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8368 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8372 * This is the host address where the response will be written when the
8373 * request is complete. This area must be 16B aligned and must be
8374 * cleared to zero before the request is made.
8377 /* Logical vnic ID */
8379 } __attribute__((packed));
8381 /* Output (24 bytes) */
8382 struct hwrm_vnic_plcmodes_qcfg_output {
8383 uint16_t error_code;
8385 * Pass/Fail or error type Note: receiver to verify the in parameters,
8386 * and fail the call with an error when appropriate
8389 /* This field returns the type of original request. */
8391 /* This field provides original sequence number of the command. */
8394 * This field is the length of the response in bytes. The last byte of
8395 * the response is a valid flag that will read as '1' when the command
8396 * has been completely written to memory.
8400 * When this bit is '1', the VNIC is configured to use regular placement
8403 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
8406 * When this bit is '1', the VNIC is configured to use the jumbo
8407 * placement algorithm.
8409 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
8412 * When this bit is '1', the VNIC is configured to enable Header-Data
8413 * split for IPv4 packets.
8415 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
8417 * When this bit is '1', the VNIC is configured to enable Header-Data
8418 * split for IPv6 packets.
8420 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
8422 * When this bit is '1', the VNIC is configured to enable Header-Data
8423 * split for FCoE packets.
8425 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
8427 * When this bit is '1', the VNIC is configured to enable Header-Data
8428 * split for RoCE packets.
8430 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
8432 * When this bit is '1', the VNIC is configured to be the default VNIC
8433 * of the requesting function.
8435 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC UINT32_C(0x40)
8436 uint16_t jumbo_thresh;
8438 * When jumbo placement algorithm is enabled, this value is used to
8439 * determine the threshold for jumbo placement. Packets with length
8440 * larger than this value will be placed according to the jumbo
8441 * placement algorithm.
8443 uint16_t hds_offset;
8445 * This value is used to determine the offset into packet buffer where
8446 * the split data (payload) will be placed according to one of of HDS
8447 * placement algorithm. The lengths of packet buffers provided for split
8448 * data shall be larger than this value.
8450 uint16_t hds_threshold;
8452 * When one of the HDS placement algorithm is enabled, this value is
8453 * used to determine the threshold for HDS placement. Packets with
8454 * length larger than this value will be placed according to the HDS
8455 * placement algorithm. This value shall be in multiple of 4 bytes.
8464 * This field is used in Output records to indicate that the output is
8465 * completely written to RAM. This field should be read as '1' to
8466 * indicate that the output has been completely written. When writing a
8467 * command completion or response to an internal processor, the order of
8468 * writes has to be such that this field is written last.
8470 } __attribute__((packed));
8472 /* hwrm_vnic_rss_cos_lb_ctx_alloc */
8473 /* Description: This function is used to allocate COS/Load Balance context. */
8474 /* Input (16 bytes) */
8475 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
8478 * This value indicates what type of request this is. The format
8479 * for the rest of the command is determined by this field.
8483 * This value indicates the what completion ring the request
8484 * will be optionally completed on. If the value is -1, then no
8485 * CR completion will be generated. Any other value must be a
8486 * valid CR ring_id value for this function.
8489 /* This value indicates the command sequence number. */
8492 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8493 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8498 * This is the host address where the response will be written
8499 * when the request is complete. This area must be 16B aligned
8500 * and must be cleared to zero before the request is made.
8502 } __attribute__((packed));
8504 /* Output (16 bytes) */
8505 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
8506 uint16_t error_code;
8508 * Pass/Fail or error type Note: receiver to verify the in
8509 * parameters, and fail the call with an error when appropriate
8512 /* This field returns the type of original request. */
8514 /* This field provides original sequence number of the command. */
8517 * This field is the length of the response in bytes. The last
8518 * byte of the response is a valid flag that will read as '1'
8519 * when the command has been completely written to memory.
8521 uint16_t rss_cos_lb_ctx_id;
8522 /* rss_cos_lb_ctx_id is 16 b */
8530 * This field is used in Output records to indicate that the
8531 * output is completely written to RAM. This field should be
8532 * read as '1' to indicate that the output has been completely
8533 * written. When writing a command completion or response to an
8534 * internal processor, the order of writes has to be such that
8535 * this field is written last.
8537 } __attribute__((packed));
8539 /* hwrm_vnic_rss_cos_lb_ctx_free */
8540 /* Description: This function can be used to free COS/Load Balance context. */
8541 /* Input (24 bytes) */
8542 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
8545 * This value indicates what type of request this is. The format
8546 * for the rest of the command is determined by this field.
8550 * This value indicates the what completion ring the request
8551 * will be optionally completed on. If the value is -1, then no
8552 * CR completion will be generated. Any other value must be a
8553 * valid CR ring_id value for this function.
8556 /* This value indicates the command sequence number. */
8559 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8560 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8565 * This is the host address where the response will be written
8566 * when the request is complete. This area must be 16B aligned
8567 * and must be cleared to zero before the request is made.
8569 uint16_t rss_cos_lb_ctx_id;
8570 /* rss_cos_lb_ctx_id is 16 b */
8571 uint16_t unused_0[3];
8572 } __attribute__((packed));
8574 /* Output (16 bytes) */
8575 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
8576 uint16_t error_code;
8578 * Pass/Fail or error type Note: receiver to verify the in
8579 * parameters, and fail the call with an error when appropriate
8582 /* This field returns the type of original request. */
8584 /* This field provides original sequence number of the command. */
8587 * This field is the length of the response in bytes. The last
8588 * byte of the response is a valid flag that will read as '1'
8589 * when the command has been completely written to memory.
8597 * This field is used in Output records to indicate that the
8598 * output is completely written to RAM. This field should be
8599 * read as '1' to indicate that the output has been completely
8600 * written. When writing a command completion or response to an
8601 * internal processor, the order of writes has to be such that
8602 * this field is written last.
8604 } __attribute__((packed));
8606 /* hwrm_ring_alloc */
8608 * Description: This command allocates and does basic preparation for a ring.
8610 /* Input (80 bytes) */
8611 struct hwrm_ring_alloc_input {
8614 * This value indicates what type of request this is. The format
8615 * for the rest of the command is determined by this field.
8619 * This value indicates the what completion ring the request
8620 * will be optionally completed on. If the value is -1, then no
8621 * CR completion will be generated. Any other value must be a
8622 * valid CR ring_id value for this function.
8625 /* This value indicates the command sequence number. */
8628 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8629 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8634 * This is the host address where the response will be written
8635 * when the request is complete. This area must be 16B aligned
8636 * and must be cleared to zero before the request is made.
8639 /* This bit must be '1' for the Reserved1 field to be configured. */
8640 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED1 UINT32_C(0x1)
8641 /* This bit must be '1' for the ring_arb_cfg field to be configured. */
8642 #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG UINT32_C(0x2)
8643 /* This bit must be '1' for the Reserved3 field to be configured. */
8644 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED3 UINT32_C(0x4)
8646 * This bit must be '1' for the stat_ctx_id_valid field to be
8649 #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID UINT32_C(0x8)
8650 /* This bit must be '1' for the Reserved4 field to be configured. */
8651 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED4 UINT32_C(0x10)
8652 /* This bit must be '1' for the max_bw_valid field to be configured. */
8653 #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID UINT32_C(0x20)
8656 /* L2 Completion Ring (CR) */
8657 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
8659 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX UINT32_C(0x1)
8661 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX UINT32_C(0x2)
8662 /* RoCE Notification Completion Ring (ROCE_CR) */
8663 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
8666 uint64_t page_tbl_addr;
8667 /* This value is a pointer to the page table for the Ring. */
8669 /* First Byte Offset of the first entry in the first page. */
8672 * Actual page size in 2^page_size. The supported range is
8673 * increments in powers of 2 from 16 bytes to 1GB. - 4 = 16 B
8674 * Page size is 16 B. - 12 = 4 KB Page size is 4 KB. - 13 = 8 KB
8675 * Page size is 8 KB. - 16 = 64 KB Page size is 64 KB. - 21 = 2
8676 * MB Page size is 2 MB. - 22 = 4 MB Page size is 4 MB. - 30 = 1
8677 * GB Page size is 1 GB.
8679 uint8_t page_tbl_depth;
8681 * This value indicates the depth of page table. For this
8682 * version of the specification, value other than 0 or 1 shall
8683 * be considered as an invalid value. When the page_tbl_depth =
8684 * 0, then it is treated as a special case with the following.
8685 * 1. FBO and page size fields are not valid. 2. page_tbl_addr
8686 * is the physical address of the first element of the ring.
8692 * Number of 16B units in the ring. Minimum size for a ring is
8695 uint16_t logical_id;
8697 * Logical ring number for the ring to be allocated. This value
8698 * determines the position in the doorbell area where the update
8699 * to the ring will be made. For completion rings, this value is
8700 * also the MSI-X vector number for the function the completion
8701 * ring is associated with.
8703 uint16_t cmpl_ring_id;
8705 * This field is used only when ring_type is a TX ring. This
8706 * value indicates what completion ring the TX ring is
8711 * This field is used only when ring_type is a TX ring. This
8712 * value indicates what CoS queue the TX ring is associated
8718 /* This field is reserved for the future use. It shall be set to 0. */
8719 uint16_t ring_arb_cfg;
8721 * This field is used only when ring_type is a TX ring. This
8722 * field is used to configure arbitration related parameters for
8725 /* Arbitration policy used for the ring. */
8726 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK UINT32_C(0xf)
8727 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT 0
8729 * Use strict priority for the TX ring. Priority
8730 * value is specified in arb_policy_param
8732 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
8733 (UINT32_C(0x1) << 0)
8735 * Use weighted fair queue arbitration for the
8736 * TX ring. Weight is specified in
8739 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
8740 (UINT32_C(0x2) << 0)
8741 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
8742 RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
8743 /* Reserved field. */
8744 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK UINT32_C(0xf0)
8745 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT 4
8747 * Arbitration policy specific parameter. # For strict priority
8748 * arbitration policy, this field represents a priority value.
8749 * If set to 0, then the priority is not specified and the HWRM
8750 * is allowed to select any priority for this TX ring. # For
8751 * weighted fair queue arbitration policy, this field represents
8752 * a weight value. If set to 0, then the weight is not specified
8753 * and the HWRM is allowed to select any weight for this TX
8756 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
8758 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
8762 /* This field is reserved for the future use. It shall be set to 0. */
8763 uint32_t stat_ctx_id;
8765 * This field is used only when ring_type is a TX ring. This
8766 * input indicates what statistics context this ring should be
8770 /* This field is reserved for the future use. It shall be set to 0. */
8773 * This field is used only when ring_type is a TX ring to
8774 * specify maximum BW allocated to the TX ring. The HWRM will
8775 * translate this value into byte counter and time interval used
8776 * for this ring inside the device.
8778 /* The bandwidth value. */
8779 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
8780 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT 0
8781 /* The granularity of the value (bits or bytes). */
8782 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
8783 /* Value is in bits. */
8784 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
8785 /* Value is in bytes. */
8786 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
8787 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
8788 RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
8789 /* bw_value_unit is 3 b */
8790 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
8791 UINT32_C(0xe0000000)
8792 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
8793 /* Value is in Mb or MB (base 10). */
8794 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
8795 (UINT32_C(0x0) << 29)
8796 /* Value is in Kb or KB (base 10). */
8797 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
8798 (UINT32_C(0x2) << 29)
8799 /* Value is in bits or bytes. */
8800 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
8801 (UINT32_C(0x4) << 29)
8802 /* Value is in Gb or GB (base 10). */
8803 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
8804 (UINT32_C(0x6) << 29)
8805 /* Value is in 1/100th of a percentage of total bandwidth. */
8806 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
8807 (UINT32_C(0x1) << 29)
8809 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
8810 (UINT32_C(0x7) << 29)
8811 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
8812 RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
8815 * This field is used only when ring_type is a Completion ring.
8816 * This value indicates what interrupt mode should be used on
8817 * this completion ring. Note: In the legacy interrupt mode, no
8818 * more than 16 completion rings are allowed.
8821 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
8823 #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD UINT32_C(0x1)
8825 #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX UINT32_C(0x2)
8826 /* No Interrupt - Polled mode */
8827 #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL UINT32_C(0x3)
8828 uint8_t unused_8[3];
8829 } __attribute__((packed));
8831 /* Output (16 bytes) */
8832 struct hwrm_ring_alloc_output {
8833 uint16_t error_code;
8835 * Pass/Fail or error type Note: receiver to verify the in
8836 * parameters, and fail the call with an error when appropriate
8839 /* This field returns the type of original request. */
8841 /* This field provides original sequence number of the command. */
8844 * This field is the length of the response in bytes. The last
8845 * byte of the response is a valid flag that will read as '1'
8846 * when the command has been completely written to memory.
8850 * Physical number of ring allocated. This value shall be unique
8853 uint16_t logical_ring_id;
8854 /* Logical number of ring allocated. */
8860 * This field is used in Output records to indicate that the
8861 * output is completely written to RAM. This field should be
8862 * read as '1' to indicate that the output has been completely
8863 * written. When writing a command completion or response to an
8864 * internal processor, the order of writes has to be such that
8865 * this field is written last.
8867 } __attribute__((packed));
8869 /* hwrm_ring_free */
8871 * Description: This command is used to free a ring and associated resources.
8872 * With QoS and DCBx agents, it is possible the traffic classes will be moved
8873 * from one CoS queue to another. When this occurs, the driver shall call
8874 * 'hwrm_ring_free' to free the allocated rings and then call 'hwrm_ring_alloc'
8875 * to re-allocate each ring and assign it to a new CoS queue. hwrm_ring_free
8876 * shall be called on a ring only after it has been idle for 500ms or more and
8877 * no frames have been posted to the ring during this time. All frames queued
8878 * for transmission shall be completed and at least 500ms time elapsed from the
8879 * last completion before calling this command.
8881 /* Input (24 bytes) */
8882 struct hwrm_ring_free_input {
8885 * This value indicates what type of request this is. The format
8886 * for the rest of the command is determined by this field.
8890 * This value indicates the what completion ring the request
8891 * will be optionally completed on. If the value is -1, then no
8892 * CR completion will be generated. Any other value must be a
8893 * valid CR ring_id value for this function.
8896 /* This value indicates the command sequence number. */
8899 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8900 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8905 * This is the host address where the response will be written
8906 * when the request is complete. This area must be 16B aligned
8907 * and must be cleared to zero before the request is made.
8911 /* L2 Completion Ring (CR) */
8912 #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
8914 #define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1)
8916 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2)
8917 /* RoCE Notification Completion Ring (ROCE_CR) */
8918 #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
8921 /* Physical number of ring allocated. */
8923 } __attribute__((packed));
8925 /* Output (16 bytes) */
8926 struct hwrm_ring_free_output {
8927 uint16_t error_code;
8929 * Pass/Fail or error type Note: receiver to verify the in
8930 * parameters, and fail the call with an error when appropriate
8933 /* This field returns the type of original request. */
8935 /* This field provides original sequence number of the command. */
8938 * This field is the length of the response in bytes. The last
8939 * byte of the response is a valid flag that will read as '1'
8940 * when the command has been completely written to memory.
8948 * This field is used in Output records to indicate that the
8949 * output is completely written to RAM. This field should be
8950 * read as '1' to indicate that the output has been completely
8951 * written. When writing a command completion or response to an
8952 * internal processor, the order of writes has to be such that
8953 * this field is written last.
8955 } __attribute__((packed));
8957 /* hwrm_ring_grp_alloc */
8959 * Description: This API allocates and does basic preparation for a ring group.
8961 /* Input (24 bytes) */
8962 struct hwrm_ring_grp_alloc_input {
8965 * This value indicates what type of request this is. The format
8966 * for the rest of the command is determined by this field.
8970 * This value indicates the what completion ring the request
8971 * will be optionally completed on. If the value is -1, then no
8972 * CR completion will be generated. Any other value must be a
8973 * valid CR ring_id value for this function.
8976 /* This value indicates the command sequence number. */
8979 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8980 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8985 * This is the host address where the response will be written
8986 * when the request is complete. This area must be 16B aligned
8987 * and must be cleared to zero before the request is made.
8990 /* This value identifies the CR associated with the ring group. */
8992 /* This value identifies the main RR associated with the ring group. */
8995 * This value identifies the aggregation RR associated with the
8996 * ring group. If this value is 0xFF... (All Fs), then no
8997 * Aggregation ring will be set.
9001 * This value identifies the statistics context associated with
9004 } __attribute__((packed));
9006 /* Output (16 bytes) */
9007 struct hwrm_ring_grp_alloc_output {
9008 uint16_t error_code;
9010 * Pass/Fail or error type Note: receiver to verify the in
9011 * parameters, and fail the call with an error when appropriate
9014 /* This field returns the type of original request. */
9016 /* This field provides original sequence number of the command. */
9019 * This field is the length of the response in bytes. The last
9020 * byte of the response is a valid flag that will read as '1'
9021 * when the command has been completely written to memory.
9023 uint32_t ring_group_id;
9025 * This is the ring group ID value. Use this value to program
9026 * the default ring group for the VNIC or as table entries in an
9034 * This field is used in Output records to indicate that the
9035 * output is completely written to RAM. This field should be
9036 * read as '1' to indicate that the output has been completely
9037 * written. When writing a command completion or response to an
9038 * internal processor, the order of writes has to be such that
9039 * this field is written last.
9041 } __attribute__((packed));
9043 /* hwrm_ring_grp_free */
9045 * Description: This API frees a ring group and associated resources. # If a
9046 * ring in the ring group is reset or free, then the associated rings in the
9047 * ring group shall also be reset/free using hwrm_ring_free. # A function driver
9048 * shall always use hwrm_ring_grp_free after freeing all rings in a group. # As
9049 * a part of executing this command, the HWRM shall reset all associated ring
9052 /* Input (24 bytes) */
9053 struct hwrm_ring_grp_free_input {
9056 * This value indicates what type of request this is. The format
9057 * for the rest of the command is determined by this field.
9061 * This value indicates the what completion ring the request
9062 * will be optionally completed on. If the value is -1, then no
9063 * CR completion will be generated. Any other value must be a
9064 * valid CR ring_id value for this function.
9067 /* This value indicates the command sequence number. */
9070 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9071 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9076 * This is the host address where the response will be written
9077 * when the request is complete. This area must be 16B aligned
9078 * and must be cleared to zero before the request is made.
9080 uint32_t ring_group_id;
9081 /* This is the ring group ID value. */
9083 } __attribute__((packed));
9085 /* Output (16 bytes) */
9086 struct hwrm_ring_grp_free_output {
9087 uint16_t error_code;
9089 * Pass/Fail or error type Note: receiver to verify the in
9090 * parameters, and fail the call with an error when appropriate
9093 /* This field returns the type of original request. */
9095 /* This field provides original sequence number of the command. */
9098 * This field is the length of the response in bytes. The last
9099 * byte of the response is a valid flag that will read as '1'
9100 * when the command has been completely written to memory.
9108 * This field is used in Output records to indicate that the
9109 * output is completely written to RAM. This field should be
9110 * read as '1' to indicate that the output has been completely
9111 * written. When writing a command completion or response to an
9112 * internal processor, the order of writes has to be such that
9113 * this field is written last.
9115 } __attribute__((packed));
9117 /* hwrm_cfa_l2_filter_alloc */
9119 * Description: An L2 filter is a filter resource that is used to identify a
9120 * vnic or ring for a packet based on layer 2 fields. Layer 2 fields for
9121 * encapsulated packets include both outer L2 header and/or inner l2 header of
9122 * encapsulated packet. The L2 filter resource covers the following OS specific
9123 * L2 filters. Linux/FreeBSD (per function): # Broadcast enable/disable # List
9124 * of individual multicast filters # All multicast enable/disable filter #
9125 * Unicast filters # Promiscuous mode VMware: # Broadcast enable/disable (per
9126 * physical function) # All multicast enable/disable (per function) # Unicast
9127 * filters per ring or vnic # Promiscuous mode per PF Windows: # Broadcast
9128 * enable/disable (per physical function) # List of individual multicast filters
9129 * (Driver needs to advertise the maximum number of filters supported) # All
9130 * multicast enable/disable per physical function # Unicast filters per vnic #
9131 * Promiscuous mode per PF Implementation notes on the use of VNIC in this
9132 * command: # By default, these filters belong to default vnic for the function.
9133 * # Once these filters are set up, only destination VNIC can be modified. # If
9134 * the destination VNIC is not specified in this command, then the HWRM shall
9135 * only create an l2 context id. HWRM Implementation notes for multicast
9136 * filters: # The hwrm_filter_alloc command can be used to set up multicast
9137 * filters (perfect match or partial match). Each individual function driver can
9138 * set up multicast filters independently. # The HWRM needs to keep track of
9139 * multicast filters set up by function drivers and maintain multicast group
9140 * replication records to enable a subset of functions to receive traffic for a
9141 * specific multicast address. # When a specific multicast filter cannot be set,
9142 * the HWRM shall return an error. In this error case, the driver should fall
9143 * back to using one general filter (rather than specific) for all multicast
9144 * traffic. # When the SR-IOV is enabled, the HWRM needs to additionally track
9145 * source knockout per multicast group record. Examples of setting unicast
9146 * filters: For a unicast MAC based filter, one can use a combination of the
9147 * fields and masks provided in this command to set up the filter. Below are
9148 * some examples: # MAC + no VLAN filter: This filter is used to identify
9149 * traffic that does not contain any VLAN tags and matches destination (or
9150 * source) MAC address. This filter can be set up by setting only l2_addr field
9151 * to be a valid field. All other fields are not valid. The following value is
9152 * set for l2_addr. l2_addr = MAC # MAC + Any VLAN filter: This filter is used
9153 * to identify traffic that carries single VLAN tag and matches (destination or
9154 * source) MAC address. This filter can be set up by setting only l2_addr and
9155 * l2_ovlan_mask fields to be valid fields. All other fields are not valid. The
9156 * following values are set for those two valid fields. l2_addr = MAC,
9157 * l2_ovlan_mask = 0xFFFF # MAC + no VLAN or VLAN ID=0: This filter is used to
9158 * identify untagged traffic that does not contain any VLAN tags or a VLAN tag
9159 * with VLAN ID = 0 and matches destination (or source) MAC address. This filter
9160 * can be set up by setting only l2_addr and l2_ovlan fields to be valid fields.
9161 * All other fields are not valid. The following value are set for l2_addr and
9162 * l2_ovlan. l2_addr = MAC, l2_ovlan = 0x0 # MAC + no VLAN or any VLAN: This
9163 * filter is used to identify traffic that contains zero or 1 VLAN tag and
9164 * matches destination (or source) MAC address. This filter can be set up by
9165 * setting only l2_addr, l2_ovlan, and l2_mask fields to be valid fields. All
9166 * other fields are not valid. The following value are set for l2_addr,
9167 * l2_ovlan, and l2_mask fields. l2_addr = MAC, l2_ovlan = 0x0, l2_ovlan_mask =
9168 * 0xFFFF # MAC + VLAN ID filter: This filter can be set up by setting only
9169 * l2_addr, l2_ovlan, and l2_ovlan_mask fields to be valid fields. All other
9170 * fields are not valid. The following values are set for those three valid
9171 * fields. l2_addr = MAC, l2_ovlan = VLAN ID, l2_ovlan_mask = 0xF000
9173 /* Input (96 bytes) */
9174 struct hwrm_cfa_l2_filter_alloc_input {
9177 * This value indicates what type of request this is. The format
9178 * for the rest of the command is determined by this field.
9182 * This value indicates the what completion ring the request
9183 * will be optionally completed on. If the value is -1, then no
9184 * CR completion will be generated. Any other value must be a
9185 * valid CR ring_id value for this function.
9188 /* This value indicates the command sequence number. */
9191 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9192 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9197 * This is the host address where the response will be written
9198 * when the request is complete. This area must be 16B aligned
9199 * and must be cleared to zero before the request is made.
9203 * Enumeration denoting the RX, TX type of the resource. This
9204 * enumeration is used for resources that are similar for both
9205 * TX and RX paths of the chip.
9207 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
9209 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
9210 (UINT32_C(0x0) << 0)
9212 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
9213 (UINT32_C(0x1) << 0)
9214 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
9215 CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
9217 * Setting of this flag indicates the applicability to the
9220 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x2)
9222 * Setting of this flag indicates drop action. If this flag is
9223 * not set, then it should be considered accept action.
9225 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x4)
9227 * If this flag is set, all t_l2_* fields are invalid and they
9228 * should not be specified. If this flag is set, then l2_*
9229 * fields refer to fields of outermost L2 header.
9231 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST UINT32_C(0x8)
9233 /* This bit must be '1' for the l2_addr field to be configured. */
9234 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR UINT32_C(0x1)
9235 /* This bit must be '1' for the l2_addr_mask field to be configured. */
9236 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
9238 /* This bit must be '1' for the l2_ovlan field to be configured. */
9239 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN UINT32_C(0x4)
9241 * This bit must be '1' for the l2_ovlan_mask field to be
9244 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
9246 /* This bit must be '1' for the l2_ivlan field to be configured. */
9247 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN UINT32_C(0x10)
9249 * This bit must be '1' for the l2_ivlan_mask field to be
9252 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
9254 /* This bit must be '1' for the t_l2_addr field to be configured. */
9255 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR UINT32_C(0x40)
9257 * This bit must be '1' for the t_l2_addr_mask field to be
9260 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
9262 /* This bit must be '1' for the t_l2_ovlan field to be configured. */
9263 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
9266 * This bit must be '1' for the t_l2_ovlan_mask field to be
9269 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
9271 /* This bit must be '1' for the t_l2_ivlan field to be configured. */
9272 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
9275 * This bit must be '1' for the t_l2_ivlan_mask field to be
9278 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
9280 /* This bit must be '1' for the src_type field to be configured. */
9281 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE UINT32_C(0x1000)
9282 /* This bit must be '1' for the src_id field to be configured. */
9283 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID UINT32_C(0x2000)
9284 /* This bit must be '1' for the tunnel_type field to be configured. */
9285 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
9287 /* This bit must be '1' for the dst_id field to be configured. */
9288 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x8000)
9290 * This bit must be '1' for the mirror_vnic_id field to be
9293 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
9297 * This value sets the match value for the L2 MAC address.
9298 * Destination MAC address for RX path. Source MAC address for
9303 uint8_t l2_addr_mask[6];
9305 * This value sets the mask value for the L2 address. A value of
9306 * 0 will mask the corresponding bit from compare.
9309 /* This value sets VLAN ID value for outer VLAN. */
9310 uint16_t l2_ovlan_mask;
9312 * This value sets the mask value for the ovlan id. A value of 0
9313 * will mask the corresponding bit from compare.
9316 /* This value sets VLAN ID value for inner VLAN. */
9317 uint16_t l2_ivlan_mask;
9319 * This value sets the mask value for the ivlan id. A value of 0
9320 * will mask the corresponding bit from compare.
9324 uint8_t t_l2_addr[6];
9326 * This value sets the match value for the tunnel L2 MAC
9327 * address. Destination MAC address for RX path. Source MAC
9328 * address for TX path.
9332 uint8_t t_l2_addr_mask[6];
9334 * This value sets the mask value for the tunnel L2 address. A
9335 * value of 0 will mask the corresponding bit from compare.
9337 uint16_t t_l2_ovlan;
9338 /* This value sets VLAN ID value for tunnel outer VLAN. */
9339 uint16_t t_l2_ovlan_mask;
9341 * This value sets the mask value for the tunnel ovlan id. A
9342 * value of 0 will mask the corresponding bit from compare.
9344 uint16_t t_l2_ivlan;
9345 /* This value sets VLAN ID value for tunnel inner VLAN. */
9346 uint16_t t_l2_ivlan_mask;
9348 * This value sets the mask value for the tunnel ivlan id. A
9349 * value of 0 will mask the corresponding bit from compare.
9352 /* This value identifies the type of source of the packet. */
9354 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
9355 /* Physical function */
9356 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF UINT32_C(0x1)
9357 /* Virtual function */
9358 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF UINT32_C(0x2)
9359 /* Virtual NIC of a function */
9360 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC UINT32_C(0x3)
9361 /* Embedded processor for CFA management */
9362 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG UINT32_C(0x4)
9363 /* Embedded processor for OOB management */
9364 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE UINT32_C(0x5)
9365 /* Embedded processor for RoCE */
9366 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO UINT32_C(0x6)
9367 /* Embedded processor for network proxy functions */
9368 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG UINT32_C(0x7)
9372 * This value is the id of the source. For a network port, it
9373 * represents port_id. For a physical function, it represents
9374 * fid. For a virtual function, it represents vf_id. For a vnic,
9375 * it represents vnic_id. For embedded processors, this id is
9376 * not valid. Notes: 1. The function ID is implied if it src_id
9377 * is not provided for a src_type that is either
9379 uint8_t tunnel_type;
9382 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
9384 /* Virtual eXtensible Local Area Network (VXLAN) */
9385 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
9388 * Network Virtualization Generic Routing
9389 * Encapsulation (NVGRE)
9391 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
9394 * Generic Routing Encapsulation (GRE) inside
9397 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
9399 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
9400 /* Generic Network Virtualization Encapsulation (Geneve) */
9401 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
9402 /* Multi-Protocol Lable Switching (MPLS) */
9403 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
9404 /* Stateless Transport Tunnel (STT) */
9405 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
9407 * Generic Routing Encapsulation (GRE) inside IP
9410 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
9412 * IPV4 over virtual eXtensible Local Area
9413 * Network (IPV4oVXLAN)
9415 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
9417 /* Any tunneled traffic */
9418 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
9423 * If set, this value shall represent the Logical VNIC ID of the
9424 * destination VNIC for the RX path and network port id of the
9425 * destination port for the TX path.
9427 uint16_t mirror_vnic_id;
9428 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
9431 * This hint is provided to help in placing the filter in the
9435 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
9437 /* Above the given filter */
9438 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
9440 /* Below the given filter */
9441 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
9443 /* As high as possible */
9444 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX UINT32_C(0x3)
9445 /* As low as possible */
9446 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN UINT32_C(0x4)
9449 uint64_t l2_filter_id_hint;
9451 * This is the ID of the filter that goes along with the
9452 * pri_hint. This field is valid only for the following values.
9453 * 1 - Above the given filter 2 - Below the given filter
9455 } __attribute__((packed));
9457 /* Output (24 bytes) */
9458 struct hwrm_cfa_l2_filter_alloc_output {
9459 uint16_t error_code;
9461 * Pass/Fail or error type Note: receiver to verify the in
9462 * parameters, and fail the call with an error when appropriate
9465 /* This field returns the type of original request. */
9467 /* This field provides original sequence number of the command. */
9470 * This field is the length of the response in bytes. The last
9471 * byte of the response is a valid flag that will read as '1'
9472 * when the command has been completely written to memory.
9474 uint64_t l2_filter_id;
9476 * This value identifies a set of CFA data structures used for
9481 * This is the ID of the flow associated with this filter. This
9482 * value shall be used to match and associate the flow
9483 * identifier returned in completion records. A value of
9484 * 0xFFFFFFFF shall indicate no flow id.
9491 * This field is used in Output records to indicate that the
9492 * output is completely written to RAM. This field should be
9493 * read as '1' to indicate that the output has been completely
9494 * written. When writing a command completion or response to an
9495 * internal processor, the order of writes has to be such that
9496 * this field is written last.
9498 } __attribute__((packed));
9500 /* hwrm_cfa_l2_filter_free */
9502 * Description: Free a L2 filter. The HWRM shall free all associated filter
9503 * resources with the L2 filter.
9505 /* Input (24 bytes) */
9506 struct hwrm_cfa_l2_filter_free_input {
9509 * This value indicates what type of request this is. The format
9510 * for the rest of the command is determined by this field.
9514 * This value indicates the what completion ring the request
9515 * will be optionally completed on. If the value is -1, then no
9516 * CR completion will be generated. Any other value must be a
9517 * valid CR ring_id value for this function.
9520 /* This value indicates the command sequence number. */
9523 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9524 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9529 * This is the host address where the response will be written
9530 * when the request is complete. This area must be 16B aligned
9531 * and must be cleared to zero before the request is made.
9533 uint64_t l2_filter_id;
9535 * This value identifies a set of CFA data structures used for
9538 } __attribute__((packed));
9540 /* Output (16 bytes) */
9541 struct hwrm_cfa_l2_filter_free_output {
9542 uint16_t error_code;
9544 * Pass/Fail or error type Note: receiver to verify the in
9545 * parameters, and fail the call with an error when appropriate
9548 /* This field returns the type of original request. */
9550 /* This field provides original sequence number of the command. */
9553 * This field is the length of the response in bytes. The last
9554 * byte of the response is a valid flag that will read as '1'
9555 * when the command has been completely written to memory.
9563 * This field is used in Output records to indicate that the
9564 * output is completely written to RAM. This field should be
9565 * read as '1' to indicate that the output has been completely
9566 * written. When writing a command completion or response to an
9567 * internal processor, the order of writes has to be such that
9568 * this field is written last.
9570 } __attribute__((packed));
9572 /* hwrm_cfa_l2_filter_cfg */
9573 /* Description: Change the configuration of an existing L2 filter */
9574 /* Input (40 bytes) */
9575 struct hwrm_cfa_l2_filter_cfg_input {
9578 * This value indicates what type of request this is. The format
9579 * for the rest of the command is determined by this field.
9583 * This value indicates the what completion ring the request
9584 * will be optionally completed on. If the value is -1, then no
9585 * CR completion will be generated. Any other value must be a
9586 * valid CR ring_id value for this function.
9589 /* This value indicates the command sequence number. */
9592 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9593 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9598 * This is the host address where the response will be written
9599 * when the request is complete. This area must be 16B aligned
9600 * and must be cleared to zero before the request is made.
9604 * Enumeration denoting the RX, TX type of the resource. This
9605 * enumeration is used for resources that are similar for both
9606 * TX and RX paths of the chip.
9608 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
9610 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
9611 (UINT32_C(0x0) << 0)
9613 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
9614 (UINT32_C(0x1) << 0)
9615 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
9616 CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
9618 * Setting of this flag indicates drop action. If this flag is
9619 * not set, then it should be considered accept action.
9621 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP UINT32_C(0x2)
9623 /* This bit must be '1' for the dst_id field to be configured. */
9624 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID UINT32_C(0x1)
9626 * This bit must be '1' for the new_mirror_vnic_id field to be
9629 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
9631 uint64_t l2_filter_id;
9633 * This value identifies a set of CFA data structures used for
9638 * If set, this value shall represent the Logical VNIC ID of the
9639 * destination VNIC for the RX path and network port id of the
9640 * destination port for the TX path.
9642 uint32_t new_mirror_vnic_id;
9643 /* New Logical VNIC ID of the VNIC where traffic is mirrored. */
9644 } __attribute__((packed));
9646 /* Output (16 bytes) */
9647 struct hwrm_cfa_l2_filter_cfg_output {
9648 uint16_t error_code;
9650 * Pass/Fail or error type Note: receiver to verify the in
9651 * parameters, and fail the call with an error when appropriate
9654 /* This field returns the type of original request. */
9656 /* This field provides original sequence number of the command. */
9659 * This field is the length of the response in bytes. The last
9660 * byte of the response is a valid flag that will read as '1'
9661 * when the command has been completely written to memory.
9669 * This field is used in Output records to indicate that the
9670 * output is completely written to RAM. This field should be
9671 * read as '1' to indicate that the output has been completely
9672 * written. When writing a command completion or response to an
9673 * internal processor, the order of writes has to be such that
9674 * this field is written last.
9676 } __attribute__((packed));
9678 /* hwrm_cfa_l2_set_rx_mask */
9679 /* Description: This command will set rx mask of the function. */
9680 /* Input (56 bytes) */
9681 struct hwrm_cfa_l2_set_rx_mask_input {
9684 * This value indicates what type of request this is. The format
9685 * for the rest of the command is determined by this field.
9689 * This value indicates the what completion ring the request
9690 * will be optionally completed on. If the value is -1, then no
9691 * CR completion will be generated. Any other value must be a
9692 * valid CR ring_id value for this function.
9695 /* This value indicates the command sequence number. */
9698 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9699 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9704 * This is the host address where the response will be written
9705 * when the request is complete. This area must be 16B aligned
9706 * and must be cleared to zero before the request is made.
9711 /* Reserved for future use. */
9712 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_RESERVED UINT32_C(0x1)
9714 * When this bit is '1', the function is requested to accept
9715 * multi-cast packets specified by the multicast addr table.
9717 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST UINT32_C(0x2)
9719 * When this bit is '1', the function is requested to accept all
9720 * multi-cast packets.
9722 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST UINT32_C(0x4)
9724 * When this bit is '1', the function is requested to accept
9725 * broadcast packets.
9727 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST UINT32_C(0x8)
9729 * When this bit is '1', the function is requested to be put in
9730 * the promiscuous mode. The HWRM should accept any function to
9731 * set up promiscuous mode. The HWRM shall follow the semantics
9732 * below for the promiscuous mode support. # When partitioning
9733 * is not enabled on a port (i.e. single PF on the port), then
9734 * the PF shall be allowed to be in the promiscuous mode. When
9735 * the PF is in the promiscuous mode, then it shall receive all
9736 * host bound traffic on that port. # When partitioning is
9737 * enabled on a port (i.e. multiple PFs per port) and a PF on
9738 * that port is in the promiscuous mode, then the PF receives
9739 * all traffic within that partition as identified by a unique
9740 * identifier for the PF (e.g. S-Tag). If a unique outer VLAN
9741 * for the PF is specified, then the setting of promiscuous mode
9742 * on that PF shall result in the PF receiving all host bound
9743 * traffic with matching outer VLAN. # A VF shall can be set in
9744 * the promiscuous mode. In the promiscuous mode, the VF does
9745 * not receive any traffic unless a unique outer VLAN for the VF
9746 * is specified. If a unique outer VLAN for the VF is specified,
9747 * then the setting of promiscuous mode on that VF shall result
9748 * in the VF receiving all host bound traffic with the matching
9749 * outer VLAN. # The HWRM shall allow the setting of promiscuous
9750 * mode on a function independently from the promiscuous mode
9751 * settings on other functions.
9753 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS UINT32_C(0x10)
9755 * If this flag is set, the corresponding RX filters shall be
9756 * set up to cover multicast/broadcast filters for the outermost
9757 * Layer 2 destination MAC address field.
9759 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST UINT32_C(0x20)
9761 * If this flag is set, the corresponding RX filters shall be
9762 * set up to cover multicast/broadcast filters for the VLAN-
9763 * tagged packets that match the TPID and VID fields of VLAN
9764 * tags in the VLAN tag table specified in this command.
9766 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY UINT32_C(0x40)
9768 * If this flag is set, the corresponding RX filters shall be
9769 * set up to cover multicast/broadcast filters for non-VLAN
9770 * tagged packets and VLAN-tagged packets that match the TPID
9771 * and VID fields of VLAN tags in the VLAN tag table specified
9774 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN UINT32_C(0x80)
9776 * If this flag is set, the corresponding RX filters shall be
9777 * set up to cover multicast/broadcast filters for non-VLAN
9778 * tagged packets and VLAN-tagged packets matching any VLAN tag.
9779 * If this flag is set, then the HWRM shall ignore VLAN tags
9780 * specified in vlan_tag_tbl. If none of vlanonly, vlan_nonvlan,
9781 * and anyvlan_nonvlan flags is set, then the HWRM shall ignore
9782 * VLAN tags specified in vlan_tag_tbl. The HWRM client shall
9783 * set at most one flag out of vlanonly, vlan_nonvlan, and
9786 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
9788 uint64_t mc_tbl_addr;
9789 /* This is the address for mcast address tbl. */
9790 uint32_t num_mc_entries;
9792 * This value indicates how many entries in mc_tbl are valid.
9793 * Each entry is 6 bytes.
9796 uint64_t vlan_tag_tbl_addr;
9798 * This is the address for VLAN tag table. Each VLAN entry in
9799 * the table is 4 bytes of a VLAN tag including TPID, PCP, DEI,
9800 * and VID fields in network byte order.
9802 uint32_t num_vlan_tags;
9804 * This value indicates how many entries in vlan_tag_tbl are
9805 * valid. Each entry is 4 bytes.
9808 } __attribute__((packed));
9810 /* Output (16 bytes) */
9811 struct hwrm_cfa_l2_set_rx_mask_output {
9812 uint16_t error_code;
9814 * Pass/Fail or error type Note: receiver to verify the in
9815 * parameters, and fail the call with an error when appropriate
9818 /* This field returns the type of original request. */
9820 /* This field provides original sequence number of the command. */
9823 * This field is the length of the response in bytes. The last
9824 * byte of the response is a valid flag that will read as '1'
9825 * when the command has been completely written to memory.
9833 * This field is used in Output records to indicate that the
9834 * output is completely written to RAM. This field should be
9835 * read as '1' to indicate that the output has been completely
9836 * written. When writing a command completion or response to an
9837 * internal processor, the order of writes has to be such that
9838 * this field is written last.
9840 } __attribute__((packed));
9842 /* Command specific Error Codes (8 bytes) */
9843 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
9846 * command specific error codes that goes to the cmd_err field
9847 * in Common HWRM Error Response.
9850 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
9852 * Unable to complete operation due to conflict
9853 * with Ntuple Filter
9856 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
9858 uint8_t unused_0[7];
9859 } __attribute__((packed));
9861 /* hwrm_cfa_vlan_antispoof_cfg */
9862 /* Description: Configures vlan anti-spoof filters for VF. */
9863 /* Input (32 bytes) */
9864 struct hwrm_cfa_vlan_antispoof_cfg_input {
9867 * This value indicates what type of request this is. The format for the
9868 * rest of the command is determined by this field.
9872 * This value indicates the what completion ring the request will be
9873 * optionally completed on. If the value is -1, then no CR completion
9874 * will be generated. Any other value must be a valid CR ring_id value
9875 * for this function.
9878 /* This value indicates the command sequence number. */
9881 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
9882 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
9886 * This is the host address where the response will be written when the
9887 * request is complete. This area must be 16B aligned and must be
9888 * cleared to zero before the request is made.
9892 * Function ID of the function that is being configured. Only valid for
9893 * a VF FID configured by the PF.
9897 uint32_t num_vlan_entries;
9898 /* Number of VLAN entries in the vlan_tag_mask_tbl. */
9899 uint64_t vlan_tag_mask_tbl_addr;
9901 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN antispoof
9902 * table. Each table entry contains the 16-bit TPID (0x8100 or 0x88a8
9903 * only), 16-bit VLAN ID, and a 16-bit mask, all in network order to
9904 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry, the mask
9905 * value should be 0xfff for the 12-bit VLAN ID.
9909 /* Output (16 bytes) */
9910 struct hwrm_cfa_vlan_antispoof_cfg_output {
9911 uint16_t error_code;
9913 * Pass/Fail or error type Note: receiver to verify the in parameters,
9914 * and fail the call with an error when appropriate
9917 /* This field returns the type of original request. */
9919 /* This field provides original sequence number of the command. */
9922 * This field is the length of the response in bytes. The last byte of
9923 * the response is a valid flag that will read as '1' when the command
9924 * has been completely written to memory.
9932 * This field is used in Output records to indicate that the output is
9933 * completely written to RAM. This field should be read as '1' to
9934 * indicate that the output has been completely written. When writing a
9935 * command completion or response to an internal processor, the order of
9936 * writes has to be such that this field is written last.
9940 /* hwrm_cfa_ntuple_filter_alloc */
9942 * Description: This is a ntuple filter that uses fields from L4/L3 header and
9943 * optionally fields from L2. The ntuple filters apply to receive traffic only.
9944 * All L2/L3/L4 header fields are specified in network byte order. These filters
9945 * can be used for Receive Flow Steering (RFS). # For ethertype value, only
9946 * 0x0800 (IPv4) and 0x86dd (IPv6) shall be supported for ntuple filters. # If a
9947 * field specified in this command is not enabled as a valid field, then that
9948 * field shall not be used in matching packet header fields against this filter.
9950 /* Input (128 bytes) */
9951 struct hwrm_cfa_ntuple_filter_alloc_input {
9954 * This value indicates what type of request this is. The format
9955 * for the rest of the command is determined by this field.
9959 * This value indicates the what completion ring the request
9960 * will be optionally completed on. If the value is -1, then no
9961 * CR completion will be generated. Any other value must be a
9962 * valid CR ring_id value for this function.
9965 /* This value indicates the command sequence number. */
9968 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9969 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9974 * This is the host address where the response will be written
9975 * when the request is complete. This area must be 16B aligned
9976 * and must be cleared to zero before the request is made.
9980 * Setting of this flag indicates the applicability to the
9983 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
9986 * Setting of this flag indicates drop action. If this flag is
9987 * not set, then it should be considered accept action.
9989 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x2)
9991 * Setting of this flag indicates that a meter is expected to be
9992 * attached to this flow. This hint can be used when choosing
9993 * the action record format required for the flow.
9995 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER UINT32_C(0x4)
9997 /* This bit must be '1' for the l2_filter_id field to be configured. */
9998 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
10000 /* This bit must be '1' for the ethertype field to be configured. */
10001 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
10003 /* This bit must be '1' for the tunnel_type field to be configured. */
10004 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
10006 /* This bit must be '1' for the src_macaddr field to be configured. */
10007 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
10009 /* This bit must be '1' for the ipaddr_type field to be configured. */
10010 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
10012 /* This bit must be '1' for the src_ipaddr field to be configured. */
10013 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
10016 * This bit must be '1' for the src_ipaddr_mask field to be
10019 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
10021 /* This bit must be '1' for the dst_ipaddr field to be configured. */
10022 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
10025 * This bit must be '1' for the dst_ipaddr_mask field to be
10028 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
10030 /* This bit must be '1' for the ip_protocol field to be configured. */
10031 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
10033 /* This bit must be '1' for the src_port field to be configured. */
10034 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
10037 * This bit must be '1' for the src_port_mask field to be
10040 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
10042 /* This bit must be '1' for the dst_port field to be configured. */
10043 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
10046 * This bit must be '1' for the dst_port_mask field to be
10049 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
10051 /* This bit must be '1' for the pri_hint field to be configured. */
10052 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
10055 * This bit must be '1' for the ntuple_filter_id field to be
10058 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
10060 /* This bit must be '1' for the dst_id field to be configured. */
10061 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
10064 * This bit must be '1' for the mirror_vnic_id field to be
10067 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
10069 /* This bit must be '1' for the dst_macaddr field to be configured. */
10070 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
10072 uint64_t l2_filter_id;
10074 * This value identifies a set of CFA data structures used for
10077 uint8_t src_macaddr[6];
10079 * This value indicates the source MAC address in the Ethernet
10082 uint16_t ethertype;
10083 /* This value indicates the ethertype in the Ethernet header. */
10084 uint8_t ip_addr_type;
10086 * This value indicates the type of IP address. 4 - IPv4 6 -
10087 * IPv6 All others are invalid.
10090 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
10093 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
10096 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
10098 uint8_t ip_protocol;
10100 * The value of protocol filed in IP header. Applies to UDP and
10101 * TCP traffic. 6 - TCP 17 - UDP
10104 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
10107 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
10110 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
10114 * If set, this value shall represent the Logical VNIC ID of the
10115 * destination VNIC for the RX path and network port id of the
10116 * destination port for the TX path.
10118 uint16_t mirror_vnic_id;
10119 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
10120 uint8_t tunnel_type;
10122 * This value indicates the tunnel type for this filter. If this
10123 * field is not specified, then the filter shall apply to both
10124 * non-tunneled and tunneled packets. If this field conflicts
10125 * with the tunnel_type specified in the l2_filter_id, then the
10126 * HWRM shall return an error for this command.
10129 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
10131 /* Virtual eXtensible Local Area Network (VXLAN) */
10132 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
10135 * Network Virtualization Generic Routing
10136 * Encapsulation (NVGRE)
10138 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
10141 * Generic Routing Encapsulation (GRE) inside
10144 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
10147 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
10149 /* Generic Network Virtualization Encapsulation (Geneve) */
10150 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
10152 /* Multi-Protocol Lable Switching (MPLS) */
10153 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
10155 /* Stateless Transport Tunnel (STT) */
10156 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
10158 * Generic Routing Encapsulation (GRE) inside IP
10161 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
10163 /* Any tunneled traffic */
10164 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
10168 * This hint is provided to help in placing the filter in the
10171 /* No preference */
10172 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
10174 /* Above the given filter */
10175 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE UINT32_C(0x1)
10176 /* Below the given filter */
10177 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW UINT32_C(0x2)
10178 /* As high as possible */
10179 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
10181 /* As low as possible */
10182 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST UINT32_C(0x4)
10183 uint32_t src_ipaddr[4];
10185 * The value of source IP address to be used in filtering. For
10186 * IPv4, first four bytes represent the IP address.
10188 uint32_t src_ipaddr_mask[4];
10190 * The value of source IP address mask to be used in filtering.
10191 * For IPv4, first four bytes represent the IP address mask.
10193 uint32_t dst_ipaddr[4];
10195 * The value of destination IP address to be used in filtering.
10196 * For IPv4, first four bytes represent the IP address.
10198 uint32_t dst_ipaddr_mask[4];
10200 * The value of destination IP address mask to be used in
10201 * filtering. For IPv4, first four bytes represent the IP
10206 * The value of source port to be used in filtering. Applies to
10207 * UDP and TCP traffic.
10209 uint16_t src_port_mask;
10211 * The value of source port mask to be used in filtering.
10212 * Applies to UDP and TCP traffic.
10216 * The value of destination port to be used in filtering.
10217 * Applies to UDP and TCP traffic.
10219 uint16_t dst_port_mask;
10221 * The value of destination port mask to be used in filtering.
10222 * Applies to UDP and TCP traffic.
10224 uint64_t ntuple_filter_id_hint;
10225 /* This is the ID of the filter that goes along with the pri_hint. */
10226 } __attribute__((packed));
10228 /* Output (24 bytes) */
10229 struct hwrm_cfa_ntuple_filter_alloc_output {
10230 uint16_t error_code;
10232 * Pass/Fail or error type Note: receiver to verify the in
10233 * parameters, and fail the call with an error when appropriate
10236 /* This field returns the type of original request. */
10238 /* This field provides original sequence number of the command. */
10241 * This field is the length of the response in bytes. The last
10242 * byte of the response is a valid flag that will read as '1'
10243 * when the command has been completely written to memory.
10245 uint64_t ntuple_filter_id;
10246 /* This value is an opaque id into CFA data structures. */
10249 * This is the ID of the flow associated with this filter. This
10250 * value shall be used to match and associate the flow
10251 * identifier returned in completion records. A value of
10252 * 0xFFFFFFFF shall indicate no flow id.
10259 * This field is used in Output records to indicate that the
10260 * output is completely written to RAM. This field should be
10261 * read as '1' to indicate that the output has been completely
10262 * written. When writing a command completion or response to an
10263 * internal processor, the order of writes has to be such that
10264 * this field is written last.
10266 } __attribute__((packed));
10268 /* Command specific Error Codes (8 bytes) */
10269 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
10272 * command specific error codes that goes to the cmd_err field
10273 * in Common HWRM Error Response.
10275 /* Unknown error */
10276 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
10278 * Unable to complete operation due to conflict
10279 * with Rx Mask VLAN
10282 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
10284 uint8_t unused_0[7];
10285 } __attribute__((packed));
10287 /* hwrm_cfa_ntuple_filter_free */
10288 /* Description: Free an ntuple filter */
10289 /* Input (24 bytes) */
10290 struct hwrm_cfa_ntuple_filter_free_input {
10293 * This value indicates what type of request this is. The format
10294 * for the rest of the command is determined by this field.
10296 uint16_t cmpl_ring;
10298 * This value indicates the what completion ring the request
10299 * will be optionally completed on. If the value is -1, then no
10300 * CR completion will be generated. Any other value must be a
10301 * valid CR ring_id value for this function.
10304 /* This value indicates the command sequence number. */
10305 uint16_t target_id;
10307 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10308 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10311 uint64_t resp_addr;
10313 * This is the host address where the response will be written
10314 * when the request is complete. This area must be 16B aligned
10315 * and must be cleared to zero before the request is made.
10317 uint64_t ntuple_filter_id;
10318 /* This value is an opaque id into CFA data structures. */
10319 } __attribute__((packed));
10321 /* Output (16 bytes) */
10322 struct hwrm_cfa_ntuple_filter_free_output {
10323 uint16_t error_code;
10325 * Pass/Fail or error type Note: receiver to verify the in
10326 * parameters, and fail the call with an error when appropriate
10329 /* This field returns the type of original request. */
10331 /* This field provides original sequence number of the command. */
10334 * This field is the length of the response in bytes. The last
10335 * byte of the response is a valid flag that will read as '1'
10336 * when the command has been completely written to memory.
10344 * This field is used in Output records to indicate that the
10345 * output is completely written to RAM. This field should be
10346 * read as '1' to indicate that the output has been completely
10347 * written. When writing a command completion or response to an
10348 * internal processor, the order of writes has to be such that
10349 * this field is written last.
10351 } __attribute__((packed));
10353 /* hwrm_cfa_ntuple_filter_cfg */
10355 * Description: Configure an ntuple filter with a new destination VNIC and/or
10358 /* Input (48 bytes) */
10359 struct hwrm_cfa_ntuple_filter_cfg_input {
10362 * This value indicates what type of request this is. The format
10363 * for the rest of the command is determined by this field.
10365 uint16_t cmpl_ring;
10367 * This value indicates the what completion ring the request
10368 * will be optionally completed on. If the value is -1, then no
10369 * CR completion will be generated. Any other value must be a
10370 * valid CR ring_id value for this function.
10373 /* This value indicates the command sequence number. */
10374 uint16_t target_id;
10376 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10377 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10380 uint64_t resp_addr;
10382 * This is the host address where the response will be written
10383 * when the request is complete. This area must be 16B aligned
10384 * and must be cleared to zero before the request is made.
10387 /* This bit must be '1' for the new_dst_id field to be configured. */
10388 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
10391 * This bit must be '1' for the new_mirror_vnic_id field to be
10394 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
10397 * This bit must be '1' for the new_meter_instance_id field to
10400 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
10403 uint64_t ntuple_filter_id;
10404 /* This value is an opaque id into CFA data structures. */
10405 uint32_t new_dst_id;
10407 * If set, this value shall represent the new Logical VNIC ID of
10408 * the destination VNIC for the RX path and new network port id
10409 * of the destination port for the TX path.
10411 uint32_t new_mirror_vnic_id;
10412 /* New Logical VNIC ID of the VNIC where traffic is mirrored. */
10413 uint16_t new_meter_instance_id;
10415 * New meter to attach to the flow. Specifying the invalid
10416 * instance ID is used to remove any existing meter from the
10420 * A value of 0xfff is considered invalid and
10421 * implies the instance is not configured.
10423 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
10425 uint16_t unused_1[3];
10426 } __attribute__((packed));
10428 /* Output (16 bytes) */
10429 struct hwrm_cfa_ntuple_filter_cfg_output {
10430 uint16_t error_code;
10432 * Pass/Fail or error type Note: receiver to verify the in
10433 * parameters, and fail the call with an error when appropriate
10436 /* This field returns the type of original request. */
10438 /* This field provides original sequence number of the command. */
10441 * This field is the length of the response in bytes. The last
10442 * byte of the response is a valid flag that will read as '1'
10443 * when the command has been completely written to memory.
10451 * This field is used in Output records to indicate that the
10452 * output is completely written to RAM. This field should be
10453 * read as '1' to indicate that the output has been completely
10454 * written. When writing a command completion or response to an
10455 * internal processor, the order of writes has to be such that
10456 * this field is written last.
10458 } __attribute__((packed));
10460 /* hwrm_cfa_em_flow_alloc */
10462 * Description: This is a generic Exact Match (EM) flow that uses fields from
10463 * L4/L3/L2 headers. The EM flows apply to transmit and receive traffic. All
10464 * L2/L3/L4 header fields are specified in network byte order. For each EM flow,
10465 * there is an associated set of actions specified. For tunneled packets, all
10466 * L2/L3/L4 fields specified are fields of inner headers unless otherwise
10467 * specified. # If a field specified in this command is not enabled as a valid
10468 * field, then that field shall not be used in matching packet header fields
10469 * against this EM flow entry.
10471 /* Input (112 bytes) */
10472 struct hwrm_cfa_em_flow_alloc_input {
10475 * This value indicates what type of request this is. The format
10476 * for the rest of the command is determined by this field.
10478 uint16_t cmpl_ring;
10480 * This value indicates the what completion ring the request
10481 * will be optionally completed on. If the value is -1, then no
10482 * CR completion will be generated. Any other value must be a
10483 * valid CR ring_id value for this function.
10486 /* This value indicates the command sequence number. */
10487 uint16_t target_id;
10489 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10490 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10493 uint64_t resp_addr;
10495 * This is the host address where the response will be written
10496 * when the request is complete. This area must be 16B aligned
10497 * and must be cleared to zero before the request is made.
10501 * Enumeration denoting the RX, TX type of the resource. This
10502 * enumeration is used for resources that are similar for both
10503 * TX and RX paths of the chip.
10505 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
10507 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
10508 (UINT32_C(0x0) << 0)
10510 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
10511 (UINT32_C(0x1) << 0)
10512 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
10513 CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
10515 * Setting of this flag indicates enabling of a byte counter for
10518 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR UINT32_C(0x2)
10520 * Setting of this flag indicates enabling of a packet counter
10521 * for a given flow.
10523 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR UINT32_C(0x4)
10525 * Setting of this flag indicates de-capsulation action for the
10528 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP UINT32_C(0x8)
10530 * Setting of this flag indicates encapsulation action for the
10533 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP UINT32_C(0x10)
10535 * Setting of this flag indicates drop action. If this flag is
10536 * not set, then it should be considered accept action.
10538 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x20)
10540 * Setting of this flag indicates that a meter is expected to be
10541 * attached to this flow. This hint can be used when choosing
10542 * the action record format required for the flow.
10544 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER UINT32_C(0x40)
10546 /* This bit must be '1' for the l2_filter_id field to be configured. */
10547 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID UINT32_C(0x1)
10548 /* This bit must be '1' for the tunnel_type field to be configured. */
10549 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x2)
10550 /* This bit must be '1' for the tunnel_id field to be configured. */
10551 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID UINT32_C(0x4)
10552 /* This bit must be '1' for the src_macaddr field to be configured. */
10553 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR UINT32_C(0x8)
10554 /* This bit must be '1' for the dst_macaddr field to be configured. */
10555 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR UINT32_C(0x10)
10556 /* This bit must be '1' for the ovlan_vid field to be configured. */
10557 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID UINT32_C(0x20)
10558 /* This bit must be '1' for the ivlan_vid field to be configured. */
10559 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID UINT32_C(0x40)
10560 /* This bit must be '1' for the ethertype field to be configured. */
10561 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE UINT32_C(0x80)
10562 /* This bit must be '1' for the src_ipaddr field to be configured. */
10563 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR UINT32_C(0x100)
10564 /* This bit must be '1' for the dst_ipaddr field to be configured. */
10565 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR UINT32_C(0x200)
10566 /* This bit must be '1' for the ipaddr_type field to be configured. */
10567 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE UINT32_C(0x400)
10568 /* This bit must be '1' for the ip_protocol field to be configured. */
10569 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL UINT32_C(0x800)
10570 /* This bit must be '1' for the src_port field to be configured. */
10571 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT UINT32_C(0x1000)
10572 /* This bit must be '1' for the dst_port field to be configured. */
10573 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT UINT32_C(0x2000)
10574 /* This bit must be '1' for the dst_id field to be configured. */
10575 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x4000)
10577 * This bit must be '1' for the mirror_vnic_id field to be
10580 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
10583 * This bit must be '1' for the encap_record_id field to be
10586 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
10589 * This bit must be '1' for the meter_instance_id field to be
10592 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
10594 uint64_t l2_filter_id;
10596 * This value identifies a set of CFA data structures used for
10599 uint8_t tunnel_type;
10602 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
10604 /* Virtual eXtensible Local Area Network (VXLAN) */
10605 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
10607 * Network Virtualization Generic Routing
10608 * Encapsulation (NVGRE)
10610 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
10612 * Generic Routing Encapsulation (GRE) inside
10615 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
10617 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
10618 /* Generic Network Virtualization Encapsulation (Geneve) */
10619 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
10620 /* Multi-Protocol Lable Switching (MPLS) */
10621 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
10622 /* Stateless Transport Tunnel (STT) */
10623 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
10625 * Generic Routing Encapsulation (GRE) inside IP
10628 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
10630 * IPV4 over virtual eXtensible Local Area
10631 * Network (IPV4oVXLAN)
10633 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9)
10634 /* Any tunneled traffic */
10635 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
10639 uint32_t tunnel_id;
10641 * Tunnel identifier. Virtual Network Identifier (VNI). Only
10642 * valid with tunnel_types VXLAN, NVGRE, and Geneve. Only lower
10643 * 24-bits of VNI field are used in setting up the filter.
10645 uint8_t src_macaddr[6];
10647 * This value indicates the source MAC address in the Ethernet
10650 uint16_t meter_instance_id;
10651 /* The meter instance to attach to the flow. */
10653 * A value of 0xfff is considered invalid and
10654 * implies the instance is not configured.
10656 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
10658 uint8_t dst_macaddr[6];
10660 * This value indicates the destination MAC address in the
10663 uint16_t ovlan_vid;
10665 * This value indicates the VLAN ID of the outer VLAN tag in the
10668 uint16_t ivlan_vid;
10670 * This value indicates the VLAN ID of the inner VLAN tag in the
10673 uint16_t ethertype;
10674 /* This value indicates the ethertype in the Ethernet header. */
10675 uint8_t ip_addr_type;
10677 * This value indicates the type of IP address. 4 - IPv4 6 -
10678 * IPv6 All others are invalid.
10681 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
10683 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4)
10685 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6)
10686 uint8_t ip_protocol;
10688 * The value of protocol filed in IP header. Applies to UDP and
10689 * TCP traffic. 6 - TCP 17 - UDP
10692 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
10694 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6)
10696 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11)
10699 uint32_t src_ipaddr[4];
10701 * The value of source IP address to be used in filtering. For
10702 * IPv4, first four bytes represent the IP address.
10704 uint32_t dst_ipaddr[4];
10706 * big_endian = True The value of destination IP address to be
10707 * used in filtering. For IPv4, first four bytes represent the
10712 * The value of source port to be used in filtering. Applies to
10713 * UDP and TCP traffic.
10717 * The value of destination port to be used in filtering.
10718 * Applies to UDP and TCP traffic.
10722 * If set, this value shall represent the Logical VNIC ID of the
10723 * destination VNIC for the RX path and network port id of the
10724 * destination port for the TX path.
10726 uint16_t mirror_vnic_id;
10727 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
10728 uint32_t encap_record_id;
10729 /* Logical ID of the encapsulation record. */
10731 } __attribute__((packed));
10733 /* Output (24 bytes) */
10734 struct hwrm_cfa_em_flow_alloc_output {
10735 uint16_t error_code;
10737 * Pass/Fail or error type Note: receiver to verify the in
10738 * parameters, and fail the call with an error when appropriate
10741 /* This field returns the type of original request. */
10743 /* This field provides original sequence number of the command. */
10746 * This field is the length of the response in bytes. The last
10747 * byte of the response is a valid flag that will read as '1'
10748 * when the command has been completely written to memory.
10750 uint64_t em_filter_id;
10751 /* This value is an opaque id into CFA data structures. */
10754 * This is the ID of the flow associated with this filter. This
10755 * value shall be used to match and associate the flow
10756 * identifier returned in completion records. A value of
10757 * 0xFFFFFFFF shall indicate no flow id.
10764 * This field is used in Output records to indicate that the
10765 * output is completely written to RAM. This field should be
10766 * read as '1' to indicate that the output has been completely
10767 * written. When writing a command completion or response to an
10768 * internal processor, the order of writes has to be such that
10769 * this field is written last.
10771 } __attribute__((packed));
10773 /* hwrm_cfa_em_flow_free */
10774 /* Description: Free an EM flow table entry */
10775 /* Input (24 bytes) */
10776 struct hwrm_cfa_em_flow_free_input {
10779 * This value indicates what type of request this is. The format
10780 * for the rest of the command is determined by this field.
10782 uint16_t cmpl_ring;
10784 * This value indicates the what completion ring the request
10785 * will be optionally completed on. If the value is -1, then no
10786 * CR completion will be generated. Any other value must be a
10787 * valid CR ring_id value for this function.
10790 /* This value indicates the command sequence number. */
10791 uint16_t target_id;
10793 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10794 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10797 uint64_t resp_addr;
10799 * This is the host address where the response will be written
10800 * when the request is complete. This area must be 16B aligned
10801 * and must be cleared to zero before the request is made.
10803 uint64_t em_filter_id;
10804 /* This value is an opaque id into CFA data structures. */
10805 } __attribute__((packed));
10807 /* Output (16 bytes) */
10808 struct hwrm_cfa_em_flow_free_output {
10809 uint16_t error_code;
10811 * Pass/Fail or error type Note: receiver to verify the in
10812 * parameters, and fail the call with an error when appropriate
10815 /* This field returns the type of original request. */
10817 /* This field provides original sequence number of the command. */
10820 * This field is the length of the response in bytes. The last
10821 * byte of the response is a valid flag that will read as '1'
10822 * when the command has been completely written to memory.
10830 * This field is used in Output records to indicate that the
10831 * output is completely written to RAM. This field should be
10832 * read as '1' to indicate that the output has been completely
10833 * written. When writing a command completion or response to an
10834 * internal processor, the order of writes has to be such that
10835 * this field is written last.
10837 } __attribute__((packed));
10839 /* hwrm_cfa_em_flow_cfg */
10841 * Description: Configure an EM flow with a new destination VNIC and/or meter.
10843 /* Input (48 bytes) */
10844 struct hwrm_cfa_em_flow_cfg_input {
10847 * This value indicates what type of request this is. The format
10848 * for the rest of the command is determined by this field.
10850 uint16_t cmpl_ring;
10852 * This value indicates the what completion ring the request
10853 * will be optionally completed on. If the value is -1, then no
10854 * CR completion will be generated. Any other value must be a
10855 * valid CR ring_id value for this function.
10858 /* This value indicates the command sequence number. */
10859 uint16_t target_id;
10861 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10862 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10865 uint64_t resp_addr;
10867 * This is the host address where the response will be written
10868 * when the request is complete. This area must be 16B aligned
10869 * and must be cleared to zero before the request is made.
10872 /* This bit must be '1' for the new_dst_id field to be configured. */
10873 #define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_DST_ID UINT32_C(0x1)
10875 * This bit must be '1' for the new_mirror_vnic_id field to be
10878 #define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
10881 * This bit must be '1' for the new_meter_instance_id field to
10884 #define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
10887 uint64_t em_filter_id;
10888 /* This value is an opaque id into CFA data structures. */
10889 uint32_t new_dst_id;
10891 * If set, this value shall represent the new Logical VNIC ID of
10892 * the destination VNIC for the RX path and network port id of
10893 * the destination port for the TX path.
10895 uint32_t new_mirror_vnic_id;
10896 /* New Logical VNIC ID of the VNIC where traffic is mirrored. */
10897 uint16_t new_meter_instance_id;
10899 * New meter to attach to the flow. Specifying the invalid
10900 * instance ID is used to remove any existing meter from the
10904 * A value of 0xfff is considered invalid and
10905 * implies the instance is not configured.
10907 #define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
10909 uint16_t unused_1[3];
10910 } __attribute__((packed));
10912 /* Output (16 bytes) */
10913 struct hwrm_cfa_em_flow_cfg_output {
10914 uint16_t error_code;
10916 * Pass/Fail or error type Note: receiver to verify the in
10917 * parameters, and fail the call with an error when appropriate
10920 /* This field returns the type of original request. */
10922 /* This field provides original sequence number of the command. */
10925 * This field is the length of the response in bytes. The last
10926 * byte of the response is a valid flag that will read as '1'
10927 * when the command has been completely written to memory.
10935 * This field is used in Output records to indicate that the
10936 * output is completely written to RAM. This field should be
10937 * read as '1' to indicate that the output has been completely
10938 * written. When writing a command completion or response to an
10939 * internal processor, the order of writes has to be such that
10940 * this field is written last.
10942 } __attribute__((packed));
10944 /* hwrm_tunnel_dst_port_query */
10946 * Description: This function is called by a driver to query tunnel type
10947 * specific destination port configuration.
10949 /* Input (24 bytes) */
10950 struct hwrm_tunnel_dst_port_query_input {
10953 * This value indicates what type of request this is. The format
10954 * for the rest of the command is determined by this field.
10956 uint16_t cmpl_ring;
10958 * This value indicates the what completion ring the request
10959 * will be optionally completed on. If the value is -1, then no
10960 * CR completion will be generated. Any other value must be a
10961 * valid CR ring_id value for this function.
10964 /* This value indicates the command sequence number. */
10965 uint16_t target_id;
10967 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10968 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10971 uint64_t resp_addr;
10973 * This is the host address where the response will be written
10974 * when the request is complete. This area must be 16B aligned
10975 * and must be cleared to zero before the request is made.
10977 uint8_t tunnel_type;
10979 /* Virtual eXtensible Local Area Network (VXLAN) */
10980 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
10982 /* Generic Network Virtualization Encapsulation (Geneve) */
10983 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
10986 * IPV4 over virtual eXtensible Local Area
10987 * Network (IPV4oVXLAN)
10989 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
10991 uint8_t unused_0[7];
10992 } __attribute__((packed));
10994 /* Output (16 bytes) */
10995 struct hwrm_tunnel_dst_port_query_output {
10996 uint16_t error_code;
10998 * Pass/Fail or error type Note: receiver to verify the in
10999 * parameters, and fail the call with an error when appropriate
11002 /* This field returns the type of original request. */
11004 /* This field provides original sequence number of the command. */
11007 * This field is the length of the response in bytes. The last
11008 * byte of the response is a valid flag that will read as '1'
11009 * when the command has been completely written to memory.
11011 uint16_t tunnel_dst_port_id;
11013 * This field represents the identifier of L4 destination port
11014 * used for the given tunnel type. This field is valid for
11015 * specific tunnel types that use layer 4 (e.g. UDP) transports
11018 uint16_t tunnel_dst_port_val;
11020 * This field represents the value of L4 destination port
11021 * identified by tunnel_dst_port_id. This field is valid for
11022 * specific tunnel types that use layer 4 (e.g. UDP) transports
11023 * for tunneling. This field is in network byte order. A value
11024 * of 0 means that the destination port is not configured.
11031 * This field is used in Output records to indicate that the
11032 * output is completely written to RAM. This field should be
11033 * read as '1' to indicate that the output has been completely
11034 * written. When writing a command completion or response to an
11035 * internal processor, the order of writes has to be such that
11036 * this field is written last.
11038 } __attribute__((packed));
11040 /* hwrm_tunnel_dst_port_alloc */
11042 * Description: This function is called by a driver to allocate l4 destination
11043 * port for a specific tunnel type. The destination port value is provided in
11044 * the input. If the HWRM supports only one global destination port for a tunnel
11045 * type, then the HWRM shall keep track of its usage as described below. # The
11046 * first caller that allocates a destination port shall always succeed and the
11047 * HWRM shall save the destination port configuration for that tunnel type and
11048 * increment the usage count to 1. # Subsequent callers allocating the same
11049 * destination port for that tunnel type shall succeed and the HWRM shall
11050 * increment the usage count for that port for each subsequent caller that
11051 * succeeds. # Any subsequent caller trying to allocate a different destination
11052 * port for that tunnel type shall fail until the usage count for the original
11053 * destination port goes to zero. # A caller that frees a port will cause the
11054 * usage count for that port to decrement.
11056 /* Input (24 bytes) */
11057 struct hwrm_tunnel_dst_port_alloc_input {
11060 * This value indicates what type of request this is. The format
11061 * for the rest of the command is determined by this field.
11063 uint16_t cmpl_ring;
11065 * This value indicates the what completion ring the request
11066 * will be optionally completed on. If the value is -1, then no
11067 * CR completion will be generated. Any other value must be a
11068 * valid CR ring_id value for this function.
11071 /* This value indicates the command sequence number. */
11072 uint16_t target_id;
11074 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11075 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11078 uint64_t resp_addr;
11080 * This is the host address where the response will be written
11081 * when the request is complete. This area must be 16B aligned
11082 * and must be cleared to zero before the request is made.
11084 uint8_t tunnel_type;
11086 /* Virtual eXtensible Local Area Network (VXLAN) */
11087 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
11088 /* Generic Network Virtualization Encapsulation (Geneve) */
11089 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
11092 * IPV4 over virtual eXtensible Local Area
11093 * Network (IPV4oVXLAN)
11095 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
11098 uint16_t tunnel_dst_port_val;
11100 * This field represents the value of L4 destination port used
11101 * for the given tunnel type. This field is valid for specific
11102 * tunnel types that use layer 4 (e.g. UDP) transports for
11103 * tunneling. This field is in network byte order. A value of 0
11104 * shall fail the command.
11107 } __attribute__((packed));
11109 /* Output (16 bytes) */
11110 struct hwrm_tunnel_dst_port_alloc_output {
11111 uint16_t error_code;
11113 * Pass/Fail or error type Note: receiver to verify the in
11114 * parameters, and fail the call with an error when appropriate
11117 /* This field returns the type of original request. */
11119 /* This field provides original sequence number of the command. */
11122 * This field is the length of the response in bytes. The last
11123 * byte of the response is a valid flag that will read as '1'
11124 * when the command has been completely written to memory.
11126 uint16_t tunnel_dst_port_id;
11128 * Identifier of a tunnel L4 destination port value. Only
11129 * applies to tunnel types that has l4 destination port
11139 * This field is used in Output records to indicate that the
11140 * output is completely written to RAM. This field should be
11141 * read as '1' to indicate that the output has been completely
11142 * written. When writing a command completion or response to an
11143 * internal processor, the order of writes has to be such that
11144 * this field is written last.
11146 } __attribute__((packed));
11148 /* hwrm_tunnel_dst_port_free */
11150 * Description: This function is called by a driver to free l4 destination port
11151 * for a specific tunnel type.
11153 /* Input (24 bytes) */
11154 struct hwrm_tunnel_dst_port_free_input {
11157 * This value indicates what type of request this is. The format
11158 * for the rest of the command is determined by this field.
11160 uint16_t cmpl_ring;
11162 * This value indicates the what completion ring the request
11163 * will be optionally completed on. If the value is -1, then no
11164 * CR completion will be generated. Any other value must be a
11165 * valid CR ring_id value for this function.
11168 /* This value indicates the command sequence number. */
11169 uint16_t target_id;
11171 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11172 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11175 uint64_t resp_addr;
11177 * This is the host address where the response will be written
11178 * when the request is complete. This area must be 16B aligned
11179 * and must be cleared to zero before the request is made.
11181 uint8_t tunnel_type;
11183 /* Virtual eXtensible Local Area Network (VXLAN) */
11184 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
11185 /* Generic Network Virtualization Encapsulation (Geneve) */
11186 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
11188 * IPV4 over virtual eXtensible Local Area
11189 * Network (IPV4oVXLAN)
11191 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
11194 uint16_t tunnel_dst_port_id;
11196 * Identifier of a tunnel L4 destination port value. Only
11197 * applies to tunnel types that has l4 destination port
11201 } __attribute__((packed));
11203 /* Output (16 bytes) */
11204 struct hwrm_tunnel_dst_port_free_output {
11205 uint16_t error_code;
11207 * Pass/Fail or error type Note: receiver to verify the in
11208 * parameters, and fail the call with an error when appropriate
11211 /* This field returns the type of original request. */
11213 /* This field provides original sequence number of the command. */
11216 * This field is the length of the response in bytes. The last
11217 * byte of the response is a valid flag that will read as '1'
11218 * when the command has been completely written to memory.
11226 * This field is used in Output records to indicate that the
11227 * output is completely written to RAM. This field should be
11228 * read as '1' to indicate that the output has been completely
11229 * written. When writing a command completion or response to an
11230 * internal processor, the order of writes has to be such that
11231 * this field is written last.
11233 } __attribute__((packed));
11235 /* hwrm_stat_ctx_alloc */
11237 * Description: This command allocates and does basic preparation for a stat
11240 /* Input (32 bytes) */
11241 struct hwrm_stat_ctx_alloc_input {
11244 * This value indicates what type of request this is. The format
11245 * for the rest of the command is determined by this field.
11247 uint16_t cmpl_ring;
11249 * This value indicates the what completion ring the request
11250 * will be optionally completed on. If the value is -1, then no
11251 * CR completion will be generated. Any other value must be a
11252 * valid CR ring_id value for this function.
11255 /* This value indicates the command sequence number. */
11256 uint16_t target_id;
11258 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11259 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11262 uint64_t resp_addr;
11264 * This is the host address where the response will be written
11265 * when the request is complete. This area must be 16B aligned
11266 * and must be cleared to zero before the request is made.
11268 uint64_t stats_dma_addr;
11269 /* This is the address for statistic block. */
11270 uint32_t update_period_ms;
11272 * The statistic block update period in ms. e.g. 250ms, 500ms,
11273 * 750ms, 1000ms. If update_period_ms is 0, then the stats
11274 * update shall be never done and the DMA address shall not be
11275 * used. In this case, the stat block can only be read by
11276 * hwrm_stat_ctx_query command.
11278 uint8_t stat_ctx_flags;
11280 * This field is used to specify statistics context specific
11281 * configuration flags.
11284 * When this bit is set to '1', the statistics context shall be
11285 * allocated for RoCE traffic only. In this case, traffic other
11286 * than offloaded RoCE traffic shall not be included in this
11287 * statistic context. When this bit is set to '0', the
11288 * statistics context shall be used for the network traffic
11289 * other than offloaded RoCE traffic.
11291 #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE UINT32_C(0x1)
11292 uint8_t unused_0[3];
11293 } __attribute__((packed));
11295 /* Output (16 bytes) */
11296 struct hwrm_stat_ctx_alloc_output {
11297 uint16_t error_code;
11299 * Pass/Fail or error type Note: receiver to verify the in
11300 * parameters, and fail the call with an error when appropriate
11303 /* This field returns the type of original request. */
11305 /* This field provides original sequence number of the command. */
11308 * This field is the length of the response in bytes. The last
11309 * byte of the response is a valid flag that will read as '1'
11310 * when the command has been completely written to memory.
11312 uint32_t stat_ctx_id;
11313 /* This is the statistics context ID value. */
11319 * This field is used in Output records to indicate that the
11320 * output is completely written to RAM. This field should be
11321 * read as '1' to indicate that the output has been completely
11322 * written. When writing a command completion or response to an
11323 * internal processor, the order of writes has to be such that
11324 * this field is written last.
11326 } __attribute__((packed));
11328 /* hwrm_stat_ctx_free */
11329 /* Description: This command is used to free a stat context. */
11330 /* Input (24 bytes) */
11331 struct hwrm_stat_ctx_free_input {
11334 * This value indicates what type of request this is. The format
11335 * for the rest of the command is determined by this field.
11337 uint16_t cmpl_ring;
11339 * This value indicates the what completion ring the request
11340 * will be optionally completed on. If the value is -1, then no
11341 * CR completion will be generated. Any other value must be a
11342 * valid CR ring_id value for this function.
11345 /* This value indicates the command sequence number. */
11346 uint16_t target_id;
11348 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11349 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11352 uint64_t resp_addr;
11354 * This is the host address where the response will be written
11355 * when the request is complete. This area must be 16B aligned
11356 * and must be cleared to zero before the request is made.
11358 uint32_t stat_ctx_id;
11359 /* ID of the statistics context that is being queried. */
11361 } __attribute__((packed));
11363 /* Output (16 bytes) */
11364 struct hwrm_stat_ctx_free_output {
11365 uint16_t error_code;
11367 * Pass/Fail or error type Note: receiver to verify the in
11368 * parameters, and fail the call with an error when appropriate
11371 /* This field returns the type of original request. */
11373 /* This field provides original sequence number of the command. */
11376 * This field is the length of the response in bytes. The last
11377 * byte of the response is a valid flag that will read as '1'
11378 * when the command has been completely written to memory.
11380 uint32_t stat_ctx_id;
11381 /* This is the statistics context ID value. */
11387 * This field is used in Output records to indicate that the
11388 * output is completely written to RAM. This field should be
11389 * read as '1' to indicate that the output has been completely
11390 * written. When writing a command completion or response to an
11391 * internal processor, the order of writes has to be such that
11392 * this field is written last.
11394 } __attribute__((packed));
11396 /* hwrm_stat_ctx_query */
11397 /* Description: This command returns statistics of a context. */
11398 /* Input (24 bytes) */
11399 struct hwrm_stat_ctx_query_input {
11402 * This value indicates what type of request this is. The format for the
11403 * rest of the command is determined by this field.
11405 uint16_t cmpl_ring;
11407 * This value indicates the what completion ring the request will be
11408 * optionally completed on. If the value is -1, then no CR completion
11409 * will be generated. Any other value must be a valid CR ring_id value
11410 * for this function.
11413 /* This value indicates the command sequence number. */
11414 uint16_t target_id;
11416 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
11417 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
11419 uint64_t resp_addr;
11421 * This is the host address where the response will be written when the
11422 * request is complete. This area must be 16B aligned and must be
11423 * cleared to zero before the request is made.
11425 uint32_t stat_ctx_id;
11426 /* ID of the statistics context that is being queried. */
11428 } __attribute__((packed));
11430 /* Output (176 bytes) */
11431 struct hwrm_stat_ctx_query_output {
11432 uint16_t error_code;
11434 * Pass/Fail or error type Note: receiver to verify the in parameters,
11435 * and fail the call with an error when appropriate
11438 /* This field returns the type of original request. */
11440 /* This field provides original sequence number of the command. */
11443 * This field is the length of the response in bytes. The last byte of
11444 * the response is a valid flag that will read as '1' when the command
11445 * has been completely written to memory.
11447 uint64_t tx_ucast_pkts;
11448 /* Number of transmitted unicast packets */
11449 uint64_t tx_mcast_pkts;
11450 /* Number of transmitted multicast packets */
11451 uint64_t tx_bcast_pkts;
11452 /* Number of transmitted broadcast packets */
11453 uint64_t tx_err_pkts;
11454 /* Number of transmitted packets with error */
11455 uint64_t tx_drop_pkts;
11456 /* Number of dropped packets on transmit path */
11457 uint64_t tx_ucast_bytes;
11458 /* Number of transmitted bytes for unicast traffic */
11459 uint64_t tx_mcast_bytes;
11460 /* Number of transmitted bytes for multicast traffic */
11461 uint64_t tx_bcast_bytes;
11462 /* Number of transmitted bytes for broadcast traffic */
11463 uint64_t rx_ucast_pkts;
11464 /* Number of received unicast packets */
11465 uint64_t rx_mcast_pkts;
11466 /* Number of received multicast packets */
11467 uint64_t rx_bcast_pkts;
11468 /* Number of received broadcast packets */
11469 uint64_t rx_err_pkts;
11470 /* Number of received packets with error */
11471 uint64_t rx_drop_pkts;
11472 /* Number of dropped packets on received path */
11473 uint64_t rx_ucast_bytes;
11474 /* Number of received bytes for unicast traffic */
11475 uint64_t rx_mcast_bytes;
11476 /* Number of received bytes for multicast traffic */
11477 uint64_t rx_bcast_bytes;
11478 /* Number of received bytes for broadcast traffic */
11479 uint64_t rx_agg_pkts;
11480 /* Number of aggregated unicast packets */
11481 uint64_t rx_agg_bytes;
11482 /* Number of aggregated unicast bytes */
11483 uint64_t rx_agg_events;
11484 /* Number of aggregation events */
11485 uint64_t rx_agg_aborts;
11486 /* Number of aborted aggregations */
11493 * This field is used in Output records to indicate that the output is
11494 * completely written to RAM. This field should be read as '1' to
11495 * indicate that the output has been completely written. When writing a
11496 * command completion or response to an internal processor, the order of
11497 * writes has to be such that this field is written last.
11499 } __attribute__((packed));
11501 /* hwrm_stat_ctx_clr_stats */
11502 /* Description: This command clears statistics of a context. */
11503 /* Input (24 bytes) */
11504 struct hwrm_stat_ctx_clr_stats_input {
11507 * This value indicates what type of request this is. The format
11508 * for the rest of the command is determined by this field.
11510 uint16_t cmpl_ring;
11512 * This value indicates the what completion ring the request
11513 * will be optionally completed on. If the value is -1, then no
11514 * CR completion will be generated. Any other value must be a
11515 * valid CR ring_id value for this function.
11518 /* This value indicates the command sequence number. */
11519 uint16_t target_id;
11521 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11522 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11525 uint64_t resp_addr;
11527 * This is the host address where the response will be written
11528 * when the request is complete. This area must be 16B aligned
11529 * and must be cleared to zero before the request is made.
11531 uint32_t stat_ctx_id;
11532 /* ID of the statistics context that is being queried. */
11534 } __attribute__((packed));
11536 /* Output (16 bytes) */
11537 struct hwrm_stat_ctx_clr_stats_output {
11538 uint16_t error_code;
11540 * Pass/Fail or error type Note: receiver to verify the in
11541 * parameters, and fail the call with an error when appropriate
11544 /* This field returns the type of original request. */
11546 /* This field provides original sequence number of the command. */
11549 * This field is the length of the response in bytes. The last
11550 * byte of the response is a valid flag that will read as '1'
11551 * when the command has been completely written to memory.
11559 * This field is used in Output records to indicate that the
11560 * output is completely written to RAM. This field should be
11561 * read as '1' to indicate that the output has been completely
11562 * written. When writing a command completion or response to an
11563 * internal processor, the order of writes has to be such that
11564 * this field is written last.
11566 } __attribute__((packed));
11568 /* hwrm_exec_fwd_resp */
11570 * Description: This command is used to send an encapsulated request to the
11571 * HWRM. This command instructs the HWRM to execute the request and forward the
11572 * response of the encapsulated request to the location specified in the
11573 * original request that is encapsulated. The target id of this command shall be
11574 * set to 0xFFFF (HWRM). The response location in this command shall be used to
11575 * acknowledge the receipt of the encapsulated request and forwarding of the
11578 /* Input (128 bytes) */
11579 struct hwrm_exec_fwd_resp_input {
11582 * This value indicates what type of request this is. The format
11583 * for the rest of the command is determined by this field.
11585 uint16_t cmpl_ring;
11587 * This value indicates the what completion ring the request
11588 * will be optionally completed on. If the value is -1, then no
11589 * CR completion will be generated. Any other value must be a
11590 * valid CR ring_id value for this function.
11593 /* This value indicates the command sequence number. */
11594 uint16_t target_id;
11596 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11597 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11600 uint64_t resp_addr;
11602 * This is the host address where the response will be written
11603 * when the request is complete. This area must be 16B aligned
11604 * and must be cleared to zero before the request is made.
11606 uint32_t encap_request[26];
11608 * This is an encapsulated request. This request should be
11609 * executed by the HWRM and the response should be provided in
11610 * the response buffer inside the encapsulated request.
11612 uint16_t encap_resp_target_id;
11614 * This value indicates the target id of the response to the
11615 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids
11616 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
11619 uint16_t unused_0[3];
11620 } __attribute__((packed));
11622 /* Output (16 bytes) */
11623 struct hwrm_exec_fwd_resp_output {
11624 uint16_t error_code;
11626 * Pass/Fail or error type Note: receiver to verify the in
11627 * parameters, and fail the call with an error when appropriate
11630 /* This field returns the type of original request. */
11632 /* This field provides original sequence number of the command. */
11635 * This field is the length of the response in bytes. The last
11636 * byte of the response is a valid flag that will read as '1'
11637 * when the command has been completely written to memory.
11645 * This field is used in Output records to indicate that the
11646 * output is completely written to RAM. This field should be
11647 * read as '1' to indicate that the output has been completely
11648 * written. When writing a command completion or response to an
11649 * internal processor, the order of writes has to be such that
11650 * this field is written last.
11652 } __attribute__((packed));
11654 /* hwrm_reject_fwd_resp */
11656 * Description: This command is used to send an encapsulated request to the
11657 * HWRM. This command instructs the HWRM to reject the request and forward the
11658 * error response of the encapsulated request to the location specified in the
11659 * original request that is encapsulated. The target id of this command shall be
11660 * set to 0xFFFF (HWRM). The response location in this command shall be used to
11661 * acknowledge the receipt of the encapsulated request and forwarding of the
11664 /* Input (128 bytes) */
11665 struct hwrm_reject_fwd_resp_input {
11668 * This value indicates what type of request this is. The format
11669 * for the rest of the command is determined by this field.
11671 uint16_t cmpl_ring;
11673 * This value indicates the what completion ring the request
11674 * will be optionally completed on. If the value is -1, then no
11675 * CR completion will be generated. Any other value must be a
11676 * valid CR ring_id value for this function.
11679 /* This value indicates the command sequence number. */
11680 uint16_t target_id;
11682 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11683 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11686 uint64_t resp_addr;
11688 * This is the host address where the response will be written
11689 * when the request is complete. This area must be 16B aligned
11690 * and must be cleared to zero before the request is made.
11692 uint32_t encap_request[26];
11694 * This is an encapsulated request. This request should be
11695 * rejected by the HWRM and the error response should be
11696 * provided in the response buffer inside the encapsulated
11699 uint16_t encap_resp_target_id;
11701 * This value indicates the target id of the response to the
11702 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids
11703 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
11706 uint16_t unused_0[3];
11707 } __attribute__((packed));
11709 /* Output (16 bytes) */
11710 struct hwrm_reject_fwd_resp_output {
11711 uint16_t error_code;
11713 * Pass/Fail or error type Note: receiver to verify the in
11714 * parameters, and fail the call with an error when appropriate
11717 /* This field returns the type of original request. */
11719 /* This field provides original sequence number of the command. */
11722 * This field is the length of the response in bytes. The last
11723 * byte of the response is a valid flag that will read as '1'
11724 * when the command has been completely written to memory.
11732 * This field is used in Output records to indicate that the
11733 * output is completely written to RAM. This field should be
11734 * read as '1' to indicate that the output has been completely
11735 * written. When writing a command completion or response to an
11736 * internal processor, the order of writes has to be such that
11737 * this field is written last.
11739 } __attribute__((packed));
11741 /* hwrm_nvm_get_dir_entries */
11742 /* Input (24 bytes) */
11743 struct hwrm_nvm_get_dir_entries_input {
11745 uint16_t cmpl_ring;
11747 uint16_t target_id;
11748 uint64_t resp_addr;
11749 uint64_t host_dest_addr;
11750 } __attribute__((packed));
11752 /* Output (16 bytes) */
11753 struct hwrm_nvm_get_dir_entries_output {
11754 uint16_t error_code;
11763 } __attribute__((packed));
11766 /* hwrm_nvm_erase_dir_entry */
11767 /* Input (24 bytes) */
11768 struct hwrm_nvm_erase_dir_entry_input {
11770 uint16_t cmpl_ring;
11772 uint16_t target_id;
11773 uint64_t resp_addr;
11775 uint16_t unused_0[3];
11778 /* Output (16 bytes) */
11779 struct hwrm_nvm_erase_dir_entry_output {
11780 uint16_t error_code;
11791 /* hwrm_nvm_get_dir_info */
11792 /* Input (16 bytes) */
11793 struct hwrm_nvm_get_dir_info_input {
11795 uint16_t cmpl_ring;
11797 uint16_t target_id;
11798 uint64_t resp_addr;
11799 } __attribute__((packed));
11801 /* Output (24 bytes) */
11802 struct hwrm_nvm_get_dir_info_output {
11803 uint16_t error_code;
11805 * Pass/Fail or error type Note: receiver to verify the in
11806 * parameters, and fail the call with an error when appropriate
11809 /* This field returns the type of original request. */
11811 /* This field provides original sequence number of the command. */
11814 * This field is the length of the response in bytes. The last
11815 * byte of the response is a valid flag that will read as '1'
11816 * when the command has been completely written to memory.
11819 /* Number of directory entries in the directory. */
11820 uint32_t entry_length;
11821 /* Size of each directory entry, in bytes. */
11828 * This field is used in Output records to indicate that the
11829 * output is completely written to RAM. This field should be
11830 * read as '1' to indicate that the output has been completely
11831 * written. When writing a command completion or response to an
11832 * internal processor, the order of writes has to be such that
11833 * this field is written last.
11835 } __attribute__((packed));
11837 /* hwrm_nvm_write */
11839 * Note: Write to the allocated NVRAM of an item referenced by an existing
11842 /* Input (48 bytes) */
11843 struct hwrm_nvm_write_input {
11846 * This value indicates what type of request this is. The format
11847 * for the rest of the command is determined by this field.
11849 uint16_t cmpl_ring;
11851 * This value indicates the what completion ring the request
11852 * will be optionally completed on. If the value is -1, then no
11853 * CR completion will be generated. Any other value must be a
11854 * valid CR ring_id value for this function.
11857 /* This value indicates the command sequence number. */
11858 uint16_t target_id;
11860 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11861 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11864 uint64_t resp_addr;
11866 * This is the host address where the response will be written
11867 * when the request is complete. This area must be 16B aligned
11868 * and must be cleared to zero before the request is made.
11870 uint64_t host_src_addr;
11871 /* 64-bit Host Source Address. This is where the source data is. */
11874 * The Directory Entry Type (valid values are defined in the
11875 * bnxnvm_directory_type enum defined in the file
11878 uint16_t dir_ordinal;
11880 * Directory ordinal. The 0-based instance of the combined
11881 * Directory Entry Type and Extension.
11885 * The Directory Entry Extension flags (see BNX_DIR_EXT_* in the
11886 * file bnxnvm_defs.h).
11890 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the
11891 * file bnxnvm_defs.h).
11893 uint32_t dir_data_length;
11895 * Length of data to write, in bytes. May be less than or equal
11896 * to the allocated size for the directory entry. The data
11897 * length stored in the directory entry will be updated to
11898 * reflect this value once the write is complete.
11904 * When this bit is '1', the original active image will not be
11905 * removed. TBD: what purpose is this?
11907 #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG UINT32_C(0x1)
11908 uint32_t dir_item_length;
11910 * The requested length of the allocated NVM for the item, in
11911 * bytes. This value may be greater than or equal to the
11912 * specified data length (dir_data_length). If this value is
11913 * less than the specified data length, it will be ignored. The
11914 * response will contain the actual allocated item length, which
11915 * may be greater than the requested item length. The purpose
11916 * for allocating more than the required number of bytes for an
11917 * item's data is to pre-allocate extra storage (padding) to
11918 * accommodate the potential future growth of an item (e.g.
11919 * upgraded firmware with a size increase, log growth, expanded
11920 * configuration data).
11923 } __attribute__((packed));
11925 /* Output (16 bytes) */
11926 struct hwrm_nvm_write_output {
11927 uint16_t error_code;
11929 * Pass/Fail or error type Note: receiver to verify the in
11930 * parameters, and fail the call with an error when appropriate
11933 /* This field returns the type of original request. */
11935 /* This field provides original sequence number of the command. */
11938 * This field is the length of the response in bytes. The last
11939 * byte of the response is a valid flag that will read as '1'
11940 * when the command has been completely written to memory.
11942 uint32_t dir_item_length;
11944 * Length of the allocated NVM for the item, in bytes. The value
11945 * may be greater than or equal to the specified data length or
11946 * the requested item length. The actual item length used when
11947 * creating a new directory entry will be a multiple of an NVM
11951 /* The directory index of the created or modified item. */
11955 * This field is used in Output records to indicate that the
11956 * output is completely written to RAM. This field should be
11957 * read as '1' to indicate that the output has been completely
11958 * written. When writing a command completion or response to an
11959 * internal processor, the order of writes has to be such that
11960 * this field is written last.
11962 } __attribute__((packed));
11964 /* hwrm_nvm_read */
11966 * Note: Read the contents of an NVRAM item as referenced (indexed) by an
11967 * existing directory entry.
11969 /* Input (40 bytes) */
11970 struct hwrm_nvm_read_input {
11973 * This value indicates what type of request this is. The format
11974 * for the rest of the command is determined by this field.
11976 uint16_t cmpl_ring;
11978 * This value indicates the what completion ring the request
11979 * will be optionally completed on. If the value is -1, then no
11980 * CR completion will be generated. Any other value must be a
11981 * valid CR ring_id value for this function.
11984 /* This value indicates the command sequence number. */
11985 uint16_t target_id;
11987 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
11988 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
11991 uint64_t resp_addr;
11993 * This is the host address where the response will be written
11994 * when the request is complete. This area must be 16B aligned
11995 * and must be cleared to zero before the request is made.
11997 uint64_t host_dest_addr;
11999 * 64-bit Host Destination Address. This is the host address
12000 * where the data will be written to.
12003 /* The 0-based index of the directory entry. */
12007 /* The NVRAM byte-offset to read from. */
12009 /* The length of the data to be read, in bytes. */
12011 } __attribute__((packed));
12013 /* Output (16 bytes) */
12014 struct hwrm_nvm_read_output {
12015 uint16_t error_code;
12017 * Pass/Fail or error type Note: receiver to verify the in
12018 * parameters, and fail the call with an error when appropriate
12021 /* This field returns the type of original request. */
12023 /* This field provides original sequence number of the command. */
12026 * This field is the length of the response in bytes. The last
12027 * byte of the response is a valid flag that will read as '1'
12028 * when the command has been completely written to memory.
12036 * This field is used in Output records to indicate that the
12037 * output is completely written to RAM. This field should be
12038 * read as '1' to indicate that the output has been completely
12039 * written. When writing a command completion or response to an
12040 * internal processor, the order of writes has to be such that
12041 * this field is written last.
12043 } __attribute__((packed));
12045 /* Hardware Resource Manager Specification */
12046 /* Description: This structure is used to specify port description. */
12048 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
12049 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
12050 * processors inside the chip. This firmware service is vital part of the chip.
12051 * The chip can not be used by a driver or HWRM client without the HWRM.
12053 /* Input (16 bytes) */
12057 * This value indicates what type of request this is. The format
12058 * for the rest of the command is determined by this field.
12060 uint16_t cmpl_ring;
12062 * This value indicates the what completion ring the request
12063 * will be optionally completed on. If the value is -1, then no
12064 * CR completion will be generated. Any other value must be a
12065 * valid CR ring_id value for this function.
12068 /* This value indicates the command sequence number. */
12069 uint16_t target_id;
12071 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
12072 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
12075 uint64_t resp_addr;
12077 * This is the host address where the response will be written
12078 * when the request is complete. This area must be 16B aligned
12079 * and must be cleared to zero before the request is made.
12081 } __attribute__((packed));
12083 /* Output (8 bytes) */
12085 uint16_t error_code;
12087 * Pass/Fail or error type Note: receiver to verify the in
12088 * parameters, and fail the call with an error when appropriate
12091 /* This field returns the type of original request. */
12093 /* This field provides original sequence number of the command. */
12096 * This field is the length of the response in bytes. The last
12097 * byte of the response is a valid flag that will read as '1'
12098 * when the command has been completely written to memory.
12100 } __attribute__((packed));
12102 /* Short Command Structure (16 bytes) */
12103 struct hwrm_short_input {
12106 * This field indicates the type of request in the request
12107 * buffer. The format for the rest of the command (request) is
12108 * determined by this field.
12110 uint16_t signature;
12112 * This field indicates a signature that is used to identify
12113 * short form of the command listed here. This field shall be
12114 * set to 17185 (0x4321).
12116 /* Signature indicating this is a short form of HWRM command */
12117 #define HWRM_SHORT_REQ_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
12119 /* Reserved for future use. */
12121 /* This value indicates the length of the request. */
12124 * This is the host address where the request was written. This
12125 * area must be 16B aligned.
12127 } __attribute__((packed));
12129 #define HWRM_GET_HWRM_ERROR_CODE(arg) \
12131 typeof(arg) x = (arg); \
12132 ((x) == 0xf ? "HWRM_ERROR" : \
12133 ((x) == 0xffff ? "CMD_NOT_SUPPORTED" : \
12134 ((x) == 0xfffe ? "UNKNOWN_ERR" : \
12135 ((x) == 0x4 ? "RESOURCE_ALLOC_ERROR" : \
12136 ((x) == 0x5 ? "INVALID_FLAGS" : \
12137 ((x) == 0x6 ? "INVALID_ENABLES" : \
12138 ((x) == 0x0 ? "SUCCESS" : \
12139 ((x) == 0x1 ? "FAIL" : \
12140 ((x) == 0x2 ? "INVALID_PARAMS" : \
12141 ((x) == 0x3 ? "RESOURCE_ACCESS_DENIED" : \
12142 "Unknown error_code")))))))))) \
12145 /* Return Codes (8 bytes) */
12147 uint16_t error_code;
12148 /* These are numbers assigned to return/error codes. */
12149 /* Request was successfully executed by the HWRM. */
12150 #define HWRM_ERR_CODE_SUCCESS (UINT32_C(0x0))
12151 /* THe HWRM failed to execute the request. */
12152 #define HWRM_ERR_CODE_FAIL (UINT32_C(0x1))
12154 * The request contains invalid argument(s) or
12155 * input parameters.
12157 #define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
12159 * The requester is not allowed to access the
12160 * requested resource. This error code shall be
12161 * provided in a response to a request to query
12162 * or modify an existing resource that is not
12163 * accessible by the requester.
12165 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
12167 * The HWRM is unable to allocate the requested
12168 * resource. This code only applies to requests
12169 * for HWRM resource allocations.
12171 #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR (UINT32_C(0x4))
12172 /* Invalid combination of flags is specified in the request. */
12173 #define HWRM_ERR_CODE_INVALID_FLAGS (UINT32_C(0x5))
12175 * Invalid combination of enables fields is
12176 * specified in the request.
12178 #define HWRM_ERR_CODE_INVALID_ENABLES (UINT32_C(0x6))
12180 * Generic HWRM execution error that represents
12181 * an internal error.
12183 #define HWRM_ERR_CODE_HWRM_ERROR (UINT32_C(0xf))
12184 /* Unknown error */
12185 #define HWRM_ERR_CODE_UNKNOWN_ERR (UINT32_C(0xfffe))
12186 /* Unsupported or invalid command */
12187 #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED (UINT32_C(0xffff))
12188 uint16_t unused_0[3];
12189 } __attribute__((packed));
12191 /* Output (16 bytes) */
12192 struct hwrm_err_output {
12193 uint16_t error_code;
12195 * Pass/Fail or error type Note: receiver to verify the in
12196 * parameters, and fail the call with an error when appropriate
12199 /* This field returns the type of original request. */
12201 /* This field provides original sequence number of the command. */
12204 * This field is the length of the response in bytes. The last
12205 * byte of the response is a valid flag that will read as '1'
12206 * when the command has been completely written to memory.
12209 /* debug info for this error response. */
12211 /* debug info for this error response. */
12214 * In the case of an error response, command specific error code
12215 * is returned in this field.
12219 * This field is used in Output records to indicate that the
12220 * output is completely written to RAM. This field should be
12221 * read as '1' to indicate that the output has been completely
12222 * written. When writing a command completion or response to an
12223 * internal processor, the order of writes has to be such that
12224 * this field is written last.
12226 } __attribute__((packed));
12228 /* Port Tx Statistics Formats (408 bytes) */
12229 struct tx_port_stats {
12230 uint64_t tx_64b_frames;
12231 /* Total Number of 64 Bytes frames transmitted */
12232 uint64_t tx_65b_127b_frames;
12233 /* Total Number of 65-127 Bytes frames transmitted */
12234 uint64_t tx_128b_255b_frames;
12235 /* Total Number of 128-255 Bytes frames transmitted */
12236 uint64_t tx_256b_511b_frames;
12237 /* Total Number of 256-511 Bytes frames transmitted */
12238 uint64_t tx_512b_1023b_frames;
12239 /* Total Number of 512-1023 Bytes frames transmitted */
12240 uint64_t tx_1024b_1518_frames;
12241 /* Total Number of 1024-1518 Bytes frames transmitted */
12242 uint64_t tx_good_vlan_frames;
12244 * Total Number of each good VLAN (exludes FCS errors) frame
12245 * transmitted which is 1519 to 1522 bytes in length inclusive
12246 * (excluding framing bits but including FCS bytes).
12248 uint64_t tx_1519b_2047_frames;
12249 /* Total Number of 1519-2047 Bytes frames transmitted */
12250 uint64_t tx_2048b_4095b_frames;
12251 /* Total Number of 2048-4095 Bytes frames transmitted */
12252 uint64_t tx_4096b_9216b_frames;
12253 /* Total Number of 4096-9216 Bytes frames transmitted */
12254 uint64_t tx_9217b_16383b_frames;
12255 /* Total Number of 9217-16383 Bytes frames transmitted */
12256 uint64_t tx_good_frames;
12257 /* Total Number of good frames transmitted */
12258 uint64_t tx_total_frames;
12259 /* Total Number of frames transmitted */
12260 uint64_t tx_ucast_frames;
12261 /* Total number of unicast frames transmitted */
12262 uint64_t tx_mcast_frames;
12263 /* Total number of multicast frames transmitted */
12264 uint64_t tx_bcast_frames;
12265 /* Total number of broadcast frames transmitted */
12266 uint64_t tx_pause_frames;
12267 /* Total number of PAUSE control frames transmitted */
12268 uint64_t tx_pfc_frames;
12269 /* Total number of PFC/per-priority PAUSE control frames transmitted */
12270 uint64_t tx_jabber_frames;
12271 /* Total number of jabber frames transmitted */
12272 uint64_t tx_fcs_err_frames;
12273 /* Total number of frames transmitted with FCS error */
12274 uint64_t tx_control_frames;
12275 /* Total number of control frames transmitted */
12276 uint64_t tx_oversz_frames;
12277 /* Total number of over-sized frames transmitted */
12278 uint64_t tx_single_dfrl_frames;
12279 /* Total number of frames with single deferral */
12280 uint64_t tx_multi_dfrl_frames;
12281 /* Total number of frames with multiple deferrals */
12282 uint64_t tx_single_coll_frames;
12283 /* Total number of frames with single collision */
12284 uint64_t tx_multi_coll_frames;
12285 /* Total number of frames with multiple collisions */
12286 uint64_t tx_late_coll_frames;
12287 /* Total number of frames with late collisions */
12288 uint64_t tx_excessive_coll_frames;
12289 /* Total number of frames with excessive collisions */
12290 uint64_t tx_frag_frames;
12291 /* Total number of fragmented frames transmitted */
12293 /* Total number of transmit errors */
12294 uint64_t tx_tagged_frames;
12295 /* Total number of single VLAN tagged frames transmitted */
12296 uint64_t tx_dbl_tagged_frames;
12297 /* Total number of double VLAN tagged frames transmitted */
12298 uint64_t tx_runt_frames;
12299 /* Total number of runt frames transmitted */
12300 uint64_t tx_fifo_underruns;
12301 /* Total number of TX FIFO under runs */
12302 uint64_t tx_pfc_ena_frames_pri0;
12304 * Total number of PFC frames with PFC enabled bit for Pri 0
12307 uint64_t tx_pfc_ena_frames_pri1;
12309 * Total number of PFC frames with PFC enabled bit for Pri 1
12312 uint64_t tx_pfc_ena_frames_pri2;
12314 * Total number of PFC frames with PFC enabled bit for Pri 2
12317 uint64_t tx_pfc_ena_frames_pri3;
12319 * Total number of PFC frames with PFC enabled bit for Pri 3
12322 uint64_t tx_pfc_ena_frames_pri4;
12324 * Total number of PFC frames with PFC enabled bit for Pri 4
12327 uint64_t tx_pfc_ena_frames_pri5;
12329 * Total number of PFC frames with PFC enabled bit for Pri 5
12332 uint64_t tx_pfc_ena_frames_pri6;
12334 * Total number of PFC frames with PFC enabled bit for Pri 6
12337 uint64_t tx_pfc_ena_frames_pri7;
12339 * Total number of PFC frames with PFC enabled bit for Pri 7
12342 uint64_t tx_eee_lpi_events;
12343 /* Total number of EEE LPI Events on TX */
12344 uint64_t tx_eee_lpi_duration;
12345 /* EEE LPI Duration Counter on TX */
12346 uint64_t tx_llfc_logical_msgs;
12348 * Total number of Link Level Flow Control (LLFC) messages
12351 uint64_t tx_hcfc_msgs;
12352 /* Total number of HCFC messages transmitted */
12353 uint64_t tx_total_collisions;
12354 /* Total number of TX collisions */
12356 /* Total number of transmitted bytes */
12357 uint64_t tx_xthol_frames;
12358 /* Total number of end-to-end HOL frames */
12359 uint64_t tx_stat_discard;
12360 /* Total Tx Drops per Port reported by STATS block */
12361 uint64_t tx_stat_error;
12362 /* Total Tx Error Drops per Port reported by STATS block */
12363 } __attribute__((packed));
12365 /* Port Rx Statistics Formats (528 bytes) */
12366 struct rx_port_stats {
12367 uint64_t rx_64b_frames;
12368 /* Total Number of 64 Bytes frames received */
12369 uint64_t rx_65b_127b_frames;
12370 /* Total Number of 65-127 Bytes frames received */
12371 uint64_t rx_128b_255b_frames;
12372 /* Total Number of 128-255 Bytes frames received */
12373 uint64_t rx_256b_511b_frames;
12374 /* Total Number of 256-511 Bytes frames received */
12375 uint64_t rx_512b_1023b_frames;
12376 /* Total Number of 512-1023 Bytes frames received */
12377 uint64_t rx_1024b_1518_frames;
12378 /* Total Number of 1024-1518 Bytes frames received */
12379 uint64_t rx_good_vlan_frames;
12381 * Total Number of each good VLAN (exludes FCS errors) frame
12382 * received which is 1519 to 1522 bytes in length inclusive
12383 * (excluding framing bits but including FCS bytes).
12385 uint64_t rx_1519b_2047b_frames;
12386 /* Total Number of 1519-2047 Bytes frames received */
12387 uint64_t rx_2048b_4095b_frames;
12388 /* Total Number of 2048-4095 Bytes frames received */
12389 uint64_t rx_4096b_9216b_frames;
12390 /* Total Number of 4096-9216 Bytes frames received */
12391 uint64_t rx_9217b_16383b_frames;
12392 /* Total Number of 9217-16383 Bytes frames received */
12393 uint64_t rx_total_frames;
12394 /* Total number of frames received */
12395 uint64_t rx_ucast_frames;
12396 /* Total number of unicast frames received */
12397 uint64_t rx_mcast_frames;
12398 /* Total number of multicast frames received */
12399 uint64_t rx_bcast_frames;
12400 /* Total number of broadcast frames received */
12401 uint64_t rx_fcs_err_frames;
12402 /* Total number of received frames with FCS error */
12403 uint64_t rx_ctrl_frames;
12404 /* Total number of control frames received */
12405 uint64_t rx_pause_frames;
12406 /* Total number of PAUSE frames received */
12407 uint64_t rx_pfc_frames;
12408 /* Total number of PFC frames received */
12409 uint64_t rx_unsupported_opcode_frames;
12410 /* Total number of frames received with an unsupported opcode */
12411 uint64_t rx_unsupported_da_pausepfc_frames;
12413 * Total number of frames received with an unsupported DA for
12416 uint64_t rx_wrong_sa_frames;
12417 /* Total number of frames received with an unsupported SA */
12418 uint64_t rx_align_err_frames;
12419 /* Total number of received packets with alignment error */
12420 uint64_t rx_oor_len_frames;
12421 /* Total number of received frames with out-of-range length */
12422 uint64_t rx_code_err_frames;
12423 /* Total number of received frames with error termination */
12424 uint64_t rx_false_carrier_frames;
12426 * Total number of received frames with a false carrier is
12427 * detected during idle, as defined by RX_ER samples active and
12428 * RXD is 0xE. The event is reported along with the statistics
12429 * generated on the next received frame. Only one false carrier
12430 * condition can be detected and logged between frames. Carrier
12431 * event, valid for 10M/100M speed modes only.
12433 uint64_t rx_ovrsz_frames;
12434 /* Total number of over-sized frames received */
12435 uint64_t rx_jbr_frames;
12436 /* Total number of jabber packets received */
12437 uint64_t rx_mtu_err_frames;
12438 /* Total number of received frames with MTU error */
12439 uint64_t rx_match_crc_frames;
12440 /* Total number of received frames with CRC match */
12441 uint64_t rx_promiscuous_frames;
12442 /* Total number of frames received promiscuously */
12443 uint64_t rx_tagged_frames;
12444 /* Total number of received frames with one or two VLAN tags */
12445 uint64_t rx_double_tagged_frames;
12446 /* Total number of received frames with two VLAN tags */
12447 uint64_t rx_trunc_frames;
12448 /* Total number of truncated frames received */
12449 uint64_t rx_good_frames;
12450 /* Total number of good frames (without errors) received */
12451 uint64_t rx_pfc_xon2xoff_frames_pri0;
12453 * Total number of received PFC frames with transition from XON
12456 uint64_t rx_pfc_xon2xoff_frames_pri1;
12458 * Total number of received PFC frames with transition from XON
12461 uint64_t rx_pfc_xon2xoff_frames_pri2;
12463 * Total number of received PFC frames with transition from XON
12466 uint64_t rx_pfc_xon2xoff_frames_pri3;
12468 * Total number of received PFC frames with transition from XON
12471 uint64_t rx_pfc_xon2xoff_frames_pri4;
12473 * Total number of received PFC frames with transition from XON
12476 uint64_t rx_pfc_xon2xoff_frames_pri5;
12478 * Total number of received PFC frames with transition from XON
12481 uint64_t rx_pfc_xon2xoff_frames_pri6;
12483 * Total number of received PFC frames with transition from XON
12486 uint64_t rx_pfc_xon2xoff_frames_pri7;
12488 * Total number of received PFC frames with transition from XON
12491 uint64_t rx_pfc_ena_frames_pri0;
12493 * Total number of received PFC frames with PFC enabled bit for
12496 uint64_t rx_pfc_ena_frames_pri1;
12498 * Total number of received PFC frames with PFC enabled bit for
12501 uint64_t rx_pfc_ena_frames_pri2;
12503 * Total number of received PFC frames with PFC enabled bit for
12506 uint64_t rx_pfc_ena_frames_pri3;
12508 * Total number of received PFC frames with PFC enabled bit for
12511 uint64_t rx_pfc_ena_frames_pri4;
12513 * Total number of received PFC frames with PFC enabled bit for
12516 uint64_t rx_pfc_ena_frames_pri5;
12518 * Total number of received PFC frames with PFC enabled bit for
12521 uint64_t rx_pfc_ena_frames_pri6;
12523 * Total number of received PFC frames with PFC enabled bit for
12526 uint64_t rx_pfc_ena_frames_pri7;
12528 * Total number of received PFC frames with PFC enabled bit for
12531 uint64_t rx_sch_crc_err_frames;
12532 /* Total Number of frames received with SCH CRC error */
12533 uint64_t rx_undrsz_frames;
12534 /* Total Number of under-sized frames received */
12535 uint64_t rx_frag_frames;
12536 /* Total Number of fragmented frames received */
12537 uint64_t rx_eee_lpi_events;
12538 /* Total number of RX EEE LPI Events */
12539 uint64_t rx_eee_lpi_duration;
12540 /* EEE LPI Duration Counter on RX */
12541 uint64_t rx_llfc_physical_msgs;
12543 * Total number of physical type Link Level Flow Control (LLFC)
12544 * messages received
12546 uint64_t rx_llfc_logical_msgs;
12548 * Total number of logical type Link Level Flow Control (LLFC)
12549 * messages received
12551 uint64_t rx_llfc_msgs_with_crc_err;
12553 * Total number of logical type Link Level Flow Control (LLFC)
12554 * messages received with CRC error
12556 uint64_t rx_hcfc_msgs;
12557 /* Total number of HCFC messages received */
12558 uint64_t rx_hcfc_msgs_with_crc_err;
12559 /* Total number of HCFC messages received with CRC error */
12561 /* Total number of received bytes */
12562 uint64_t rx_runt_bytes;
12563 /* Total number of bytes received in runt frames */
12564 uint64_t rx_runt_frames;
12565 /* Total number of runt frames received */
12566 uint64_t rx_stat_discard;
12567 /* Total Rx Discards per Port reported by STATS block */
12568 uint64_t rx_stat_err;
12569 /* Total Rx Error Drops per Port reported by STATS block */
12570 } __attribute__((packed));
12572 /* Periodic Statistics Context DMA to host (160 bytes) */
12574 * per-context HW statistics -- chip view
12577 struct ctx_hw_stats64 {
12578 uint64_t rx_ucast_pkts;
12579 uint64_t rx_mcast_pkts;
12580 uint64_t rx_bcast_pkts;
12581 uint64_t rx_drop_pkts;
12582 uint64_t rx_discard_pkts;
12583 uint64_t rx_ucast_bytes;
12584 uint64_t rx_mcast_bytes;
12585 uint64_t rx_bcast_bytes;
12587 uint64_t tx_ucast_pkts;
12588 uint64_t tx_mcast_pkts;
12589 uint64_t tx_bcast_pkts;
12590 uint64_t tx_drop_pkts;
12591 uint64_t tx_discard_pkts;
12592 uint64_t tx_ucast_bytes;
12593 uint64_t tx_mcast_bytes;
12594 uint64_t tx_bcast_bytes;
12597 uint64_t tpa_bytes;
12598 uint64_t tpa_events;
12599 uint64_t tpa_aborts;
12600 } __attribute__((packed));
12602 #endif /* _HSI_STRUCT_DEF_DPDK_ */