4 * Copyright(c) 2001-2017 Broadcom Limited.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Broadcom Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _HSI_STRUCT_DEF_DPDK_
35 #define _HSI_STRUCT_DEF_DPDK_
36 /* HSI and HWRM Specification 1.7.7 */
37 #define HWRM_VERSION_MAJOR 1
38 #define HWRM_VERSION_MINOR 7
39 #define HWRM_VERSION_UPDATE 7
41 #define HWRM_VERSION_STR "1.7.7"
43 * Following is the signature for HWRM message field that indicates not
44 * applicable (All F's). Need to cast it the size of the field if needed.
46 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
47 #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
48 #define HWRM_MAX_RESP_LEN (248) /* hwrm_selftest_qlist */
49 #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
50 #define HW_HASH_KEY_SIZE 40
51 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
52 #define HWRM_ROCE_SP_HSI_VERSION_MAJOR 1
53 #define HWRM_ROCE_SP_HSI_VERSION_MINOR 7
54 #define HWRM_ROCE_SP_HSI_VERSION_UPDATE 4
59 #define HWRM_VER_GET (UINT32_C(0x0))
60 #define HWRM_FUNC_BUF_UNRGTR (UINT32_C(0xe))
61 #define HWRM_FUNC_VF_CFG (UINT32_C(0xf))
62 /* Reserved for future use */
63 #define RESERVED1 (UINT32_C(0x10))
64 #define HWRM_FUNC_RESET (UINT32_C(0x11))
65 #define HWRM_FUNC_GETFID (UINT32_C(0x12))
66 #define HWRM_FUNC_VF_ALLOC (UINT32_C(0x13))
67 #define HWRM_FUNC_VF_FREE (UINT32_C(0x14))
68 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
69 #define HWRM_FUNC_QCFG (UINT32_C(0x16))
70 #define HWRM_FUNC_CFG (UINT32_C(0x17))
71 #define HWRM_FUNC_QSTATS (UINT32_C(0x18))
72 #define HWRM_FUNC_CLR_STATS (UINT32_C(0x19))
73 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
74 #define HWRM_FUNC_VF_RESC_FREE (UINT32_C(0x1b))
75 #define HWRM_FUNC_VF_VNIC_IDS_QUERY (UINT32_C(0x1c))
76 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
77 #define HWRM_FUNC_DRV_QVER (UINT32_C(0x1e))
78 #define HWRM_FUNC_BUF_RGTR (UINT32_C(0x1f))
79 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
80 #define HWRM_PORT_MAC_CFG (UINT32_C(0x21))
81 #define HWRM_PORT_QSTATS (UINT32_C(0x23))
82 #define HWRM_PORT_LPBK_QSTATS (UINT32_C(0x24))
83 #define HWRM_PORT_CLR_STATS (UINT32_C(0x25))
84 #define HWRM_PORT_PHY_QCFG (UINT32_C(0x27))
85 #define HWRM_PORT_MAC_QCFG (UINT32_C(0x28))
86 #define HWRM_PORT_PHY_QCAPS (UINT32_C(0x2a))
87 #define HWRM_PORT_LED_CFG (UINT32_C(0x2d))
88 #define HWRM_PORT_LED_QCFG (UINT32_C(0x2e))
89 #define HWRM_PORT_LED_QCAPS (UINT32_C(0x2f))
90 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
91 #define HWRM_QUEUE_QCFG (UINT32_C(0x31))
92 #define HWRM_QUEUE_CFG (UINT32_C(0x32))
93 #define HWRM_FUNC_VLAN_CFG (UINT32_C(0x33))
94 #define HWRM_FUNC_VLAN_QCFG (UINT32_C(0x34))
95 #define HWRM_QUEUE_PFCENABLE_QCFG (UINT32_C(0x35))
96 #define HWRM_QUEUE_PFCENABLE_CFG (UINT32_C(0x36))
97 #define HWRM_QUEUE_PRI2COS_QCFG (UINT32_C(0x37))
98 #define HWRM_QUEUE_PRI2COS_CFG (UINT32_C(0x38))
99 #define HWRM_QUEUE_COS2BW_QCFG (UINT32_C(0x39))
100 #define HWRM_QUEUE_COS2BW_CFG (UINT32_C(0x3a))
101 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
102 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
103 #define HWRM_VNIC_FREE (UINT32_C(0x41))
104 #define HWRM_VNIC_CFG (UINT32_C(0x42))
105 #define HWRM_VNIC_QCFG (UINT32_C(0x43))
106 #define HWRM_VNIC_TPA_CFG (UINT32_C(0x44))
107 #define HWRM_VNIC_RSS_CFG (UINT32_C(0x46))
108 #define HWRM_VNIC_RSS_QCFG (UINT32_C(0x47))
109 #define HWRM_VNIC_PLCMODES_CFG (UINT32_C(0x48))
110 #define HWRM_VNIC_PLCMODES_QCFG (UINT32_C(0x49))
111 #define HWRM_RING_ALLOC (UINT32_C(0x50))
112 #define HWRM_RING_FREE (UINT32_C(0x51))
113 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAM (UINT32_C(0x53))
114 #define HWRM_RING_RESET (UINT32_C(0x5e))
115 #define HWRM_RING_GRP_ALLOC (UINT32_C(0x60))
116 #define HWRM_RING_GRP_ALLOC (UINT32_C(0x60))
117 #define HWRM_RING_GRP_FREE (UINT32_C(0x61))
118 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (UINT32_C(0x70))
119 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE (UINT32_C(0x71))
120 #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
121 #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
122 #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
123 #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
124 /* Reserved for future use */
125 #define RESERVED4 (UINT32_C(0x94))
126 #define HWRM_CFA_TUNNEL_FILTER_ALLOC (UINT32_C(0x95))
127 #define HWRM_CFA_TUNNEL_FILTER_FREE (UINT32_C(0x96))
128 #define HWRM_CFA_NTUPLE_FILTER_ALLOC (UINT32_C(0x99))
129 #define HWRM_CFA_NTUPLE_FILTER_FREE (UINT32_C(0x9a))
130 #define HWRM_CFA_NTUPLE_FILTER_CFG (UINT32_C(0x9b))
131 #define HWRM_TUNNEL_DST_PORT_QUERY (UINT32_C(0xa0))
132 #define HWRM_TUNNEL_DST_PORT_ALLOC (UINT32_C(0xa1))
133 #define HWRM_TUNNEL_DST_PORT_FREE (UINT32_C(0xa2))
134 #define HWRM_STAT_CTX_ALLOC (UINT32_C(0xb0))
135 #define HWRM_STAT_CTX_FREE (UINT32_C(0xb1))
136 #define HWRM_STAT_CTX_QUERY (UINT32_C(0xb2))
137 #define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3))
138 #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
139 #define HWRM_REJECT_FWD_RESP (UINT32_C(0xd1))
140 #define HWRM_FWD_RESP (UINT32_C(0xd2))
141 #define HWRM_FWD_ASYNC_EVENT_CMPL (UINT32_C(0xd3))
142 #define HWRM_TEMP_MONITOR_QUERY (UINT32_C(0xe0))
143 #define HWRM_WOL_FILTER_ALLOC (UINT32_C(0xf0))
144 #define HWRM_WOL_FILTER_FREE (UINT32_C(0xf1))
145 #define HWRM_WOL_FILTER_QCFG (UINT32_C(0xf2))
146 #define HWRM_WOL_REASON_QCFG (UINT32_C(0xf3))
147 #define HWRM_DBG_DUMP (UINT32_C(0xff14))
148 #define HWRM_NVM_VALIDATE_OPTION (UINT32_C(0xffef))
149 #define HWRM_NVM_FLUSH (UINT32_C(0xfff0))
150 #define HWRM_NVM_GET_VARIABLE (UINT32_C(0xfff1))
151 #define HWRM_NVM_SET_VARIABLE (UINT32_C(0xfff2))
152 #define HWRM_NVM_INSTALL_UPDATE (UINT32_C(0xfff3))
153 #define HWRM_NVM_MODIFY (UINT32_C(0xfff4))
154 #define HWRM_NVM_VERIFY_UPDATE (UINT32_C(0xfff5))
155 #define HWRM_NVM_GET_DEV_INFO (UINT32_C(0xfff6))
156 #define HWRM_NVM_ERASE_DIR_ENTRY (UINT32_C(0xfff7))
157 #define HWRM_NVM_MOD_DIR_ENTRY (UINT32_C(0xfff8))
158 #define HWRM_NVM_FIND_DIR_ENTRY (UINT32_C(0xfff9))
159 #define HWRM_NVM_GET_DIR_ENTRIES (UINT32_C(0xfffa))
160 #define HWRM_NVM_GET_DIR_INFO (UINT32_C(0xfffb))
161 #define HWRM_NVM_RAW_DUMP (UINT32_C(0xfffc))
162 #define HWRM_NVM_READ (UINT32_C(0xfffd))
163 #define HWRM_NVM_WRITE (UINT32_C(0xfffe))
164 #define HWRM_NVM_RAW_WRITE_BLK (UINT32_C(0xffff))
167 * Note: The Host Software Interface (HSI) and Hardware Resource Manager (HWRM)
168 * specification describes the data structures used in Ethernet packet or RDMA
169 * message data transfers as well as an abstract interface for managing Ethernet
170 * NIC hardware resources.
172 /* Ethernet Data path Host Structures */
174 * Description: The following three sections document the host structures used
175 * between device and software drivers for communicating Ethernet packets.
177 /* BD Ring Structures */
179 * Description: This structure is used to inform the NIC of a location for and
180 * an aggregation buffer that will be used for packet data that is received. An
181 * aggregation buffer creates a different kind of completion operation for a
182 * packet where a variable number of BDs may be used to place the packet in the
183 * host. RX Rings that have aggregation buffers are known as aggregation rings
184 * and must contain only aggregation buffers.
186 /* Short TX BD (16 bytes) */
190 * All bits in this field must be valid on the first BD of a
191 * packet. Only the packet_end bit must be valid for the
192 * remaining BDs of a packet.
194 /* This value identifies the type of buffer descriptor. */
195 #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f)
196 #define TX_BD_SHORT_TYPE_SFT 0
198 * Indicates that this BD is 16B long and is
199 * used for normal L2 packet transmission.
201 #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0)
203 * If set to 1, the packet ends with the data in the buffer
204 * pointed to by this descriptor. This flag must be valid on
207 #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40)
209 * If set to 1, the device will not generate a completion for
210 * this transmit packet unless there is an error in it's
211 * processing. If this bit is set to 0, then the packet will be
212 * completed normally. This bit must be valid only on the first
215 #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80)
217 * This value indicates how many 16B BD locations are consumed
218 * in the ring by this packet. A value of 1 indicates that this
219 * BD is the only BD (and that the it is a short BD). A value of
220 * 3 indicates either 3 short BDs or 1 long BD and one short BD
221 * in the packet. A value of 0 indicates that there are 32 BD
222 * locations in the packet (the maximum). This field is valid
223 * only on the first BD of a packet.
225 #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
226 #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8
228 * This value is a hint for the length of the entire packet. It
229 * is used by the chip to optimize internal processing. The
230 * packet will be dropped if the hint is too short. This field
231 * is valid only on the first BD of a packet.
233 #define TX_BD_SHORT_FLAGS_LHINT_MASK UINT32_C(0x6000)
234 #define TX_BD_SHORT_FLAGS_LHINT_SFT 13
235 /* indicates packet length < 512B */
236 #define TX_BD_SHORT_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
237 /* indicates 512 <= packet length < 1KB */
238 #define TX_BD_SHORT_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
239 /* indicates 1KB <= packet length < 2KB */
240 #define TX_BD_SHORT_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
241 /* indicates packet length >= 2KB */
242 #define TX_BD_SHORT_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
243 #define TX_BD_SHORT_FLAGS_LHINT_LAST \
244 TX_BD_SHORT_FLAGS_LHINT_GTE2K
246 * If set to 1, the device immediately updates the Send Consumer
247 * Index after the buffer associated with this descriptor has
248 * been transferred via DMA to NIC memory from host memory. An
249 * interrupt may or may not be generated according to the state
250 * of the interrupt avoidance mechanisms. If this bit is set to
251 * 0, then the Consumer Index is only updated as soon as one of
252 * the host interrupt coalescing conditions has been met. This
253 * bit must be valid on the first BD of a packet.
255 #define TX_BD_SHORT_FLAGS_COAL_NOW UINT32_C(0x8000)
257 * All bits in this field must be valid on the first BD of a
258 * packet. Only the packet_end bit must be valid for the
259 * remaining BDs of a packet.
261 #define TX_BD_SHORT_FLAGS_MASK UINT32_C(0xffc0)
262 #define TX_BD_SHORT_FLAGS_SFT 6
265 * This is the length of the host physical buffer this BD
266 * describes in bytes. This field must be valid on all BDs of a
271 * The opaque data field is pass through to the completion and
272 * can be used for any data that the driver wants to associate
273 * with the transmit BD. This field must be valid on the first
278 * This is the host physical address for the portion of the
279 * packet described by this TX BD. This value must be valid on
280 * all BDs of a packet.
282 } __attribute__((packed));
284 /* Long TX BD (32 bytes split to 2 16-byte struct) */
288 * All bits in this field must be valid on the first BD of a
289 * packet. Only the packet_end bit must be valid for the
290 * remaining BDs of a packet.
292 /* This value identifies the type of buffer descriptor. */
293 #define TX_BD_LONG_TYPE_MASK UINT32_C(0x3f)
294 #define TX_BD_LONG_TYPE_SFT 0
296 * Indicates that this BD is 32B long and is
297 * used for normal L2 packet transmission.
299 #define TX_BD_LONG_TYPE_TX_BD_LONG UINT32_C(0x10)
301 * If set to 1, the packet ends with the data in the buffer
302 * pointed to by this descriptor. This flag must be valid on
305 #define TX_BD_LONG_FLAGS_PACKET_END UINT32_C(0x40)
307 * If set to 1, the device will not generate a completion for
308 * this transmit packet unless there is an error in it's
309 * processing. If this bit is set to 0, then the packet will be
310 * completed normally. This bit must be valid only on the first
313 #define TX_BD_LONG_FLAGS_NO_CMPL UINT32_C(0x80)
315 * This value indicates how many 16B BD locations are consumed
316 * in the ring by this packet. A value of 1 indicates that this
317 * BD is the only BD (and that the it is a short BD). A value of
318 * 3 indicates either 3 short BDs or 1 long BD and one short BD
319 * in the packet. A value of 0 indicates that there are 32 BD
320 * locations in the packet (the maximum). This field is valid
321 * only on the first BD of a packet.
323 #define TX_BD_LONG_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
324 #define TX_BD_LONG_FLAGS_BD_CNT_SFT 8
326 * This value is a hint for the length of the entire packet. It
327 * is used by the chip to optimize internal processing. The
328 * packet will be dropped if the hint is too short. This field
329 * is valid only on the first BD of a packet.
331 #define TX_BD_LONG_FLAGS_LHINT_MASK UINT32_C(0x6000)
332 #define TX_BD_LONG_FLAGS_LHINT_SFT 13
333 /* indicates packet length < 512B */
334 #define TX_BD_LONG_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
335 /* indicates 512 <= packet length < 1KB */
336 #define TX_BD_LONG_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
337 /* indicates 1KB <= packet length < 2KB */
338 #define TX_BD_LONG_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
339 /* indicates packet length >= 2KB */
340 #define TX_BD_LONG_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
341 #define TX_BD_LONG_FLAGS_LHINT_LAST \
342 TX_BD_LONG_FLAGS_LHINT_GTE2K
344 * If set to 1, the device immediately updates the Send Consumer
345 * Index after the buffer associated with this descriptor has
346 * been transferred via DMA to NIC memory from host memory. An
347 * interrupt may or may not be generated according to the state
348 * of the interrupt avoidance mechanisms. If this bit is set to
349 * 0, then the Consumer Index is only updated as soon as one of
350 * the host interrupt coalescing conditions has been met. This
351 * bit must be valid on the first BD of a packet.
353 #define TX_BD_LONG_FLAGS_COAL_NOW UINT32_C(0x8000)
355 * All bits in this field must be valid on the first BD of a
356 * packet. Only the packet_end bit must be valid for the
357 * remaining BDs of a packet.
359 #define TX_BD_LONG_FLAGS_MASK UINT32_C(0xffc0)
360 #define TX_BD_LONG_FLAGS_SFT 6
363 * This is the length of the host physical buffer this BD
364 * describes in bytes. This field must be valid on all BDs of a
369 * The opaque data field is pass through to the completion and
370 * can be used for any data that the driver wants to associate
371 * with the transmit BD. This field must be valid on the first
376 * This is the host physical address for the portion of the
377 * packet described by this TX BD. This value must be valid on
378 * all BDs of a packet.
380 } __attribute__((packed));
382 /* last 16 bytes of Long TX BD */
383 struct tx_bd_long_hi {
386 * All bits in this field must be valid on the first BD of a
387 * packet. Their value on other BDs of the packet will be
391 * If set to 1, the controller replaces the TCP/UPD checksum
392 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
393 * checksum field of the encapsulated TCP/UDP packets with the
394 * hardware calculated TCP/UDP checksum for the packet
395 * associated with this descriptor. The flag is ignored if the
396 * LSO flag is set. This bit must be valid on the first BD of a
399 #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
401 * If set to 1, the controller replaces the IP checksum of the
402 * normal packets, or the inner IP checksum of the encapsulated
403 * packets with the hardware calculated IP checksum for the
404 * packet associated with this descriptor. This bit must be
405 * valid on the first BD of a packet.
407 #define TX_BD_LONG_LFLAGS_IP_CHKSUM UINT32_C(0x2)
409 * If set to 1, the controller will not append an Ethernet CRC
410 * to the end of the frame. This bit must be valid on the first
411 * BD of a packet. Packet must be 64B or longer when this flag
412 * is set. It is not useful to use this bit with any form of TX
413 * offload such as CSO or LSO. The intent is that the packet
414 * from the host already has a valid Ethernet CRC on the packet.
416 #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4)
418 * If set to 1, the device will record the time at which the
419 * packet was actually transmitted at the TX MAC. This bit must
420 * be valid on the first BD of a packet.
422 #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8)
424 * If set to 1, The controller replaces the tunnel IP checksum
425 * field with hardware calculated IP checksum for the IP header
426 * of the packet associated with this descriptor. For outer UDP
427 * checksum, global outer UDP checksum TE_NIC register needs to
428 * be enabled. If the global outer UDP checksum TE_NIC register
429 * bit is set, outer UDP checksum will be calculated for the
430 * following cases: 1. Packets with tcp_udp_chksum flag set to
431 * offload checksum for inner packet AND the inner packet is
432 * TCP/UDP. If the inner packet is ICMP for example (non-
433 * TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
434 * checksum will not be calculated. 2. Packets with lso flag set
435 * which implies inner TCP checksum calculation as part of LSO
438 #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
440 * If set to 1, the device will treat this packet with LSO(Large
441 * Send Offload) processing for both normal or encapsulated
442 * packets, which is a form of TCP segmentation. When this bit
443 * is 1, the hdr_size and mss fields must be valid. The driver
444 * doesn't need to set t_ip_chksum, ip_chksum, and
445 * tcp_udp_chksum flags since the controller will replace the
446 * appropriate checksum fields for segmented packets. When this
447 * bit is 1, the hdr_size and mss fields must be valid.
449 #define TX_BD_LONG_LFLAGS_LSO UINT32_C(0x20)
451 * If set to zero when LSO is '1', then the IPID will be treated
452 * as a 16b number and will be wrapped if it exceeds a value of
453 * 0xffff. If set to one when LSO is '1', then the IPID will be
454 * treated as a 15b number and will be wrapped if it exceeds a
457 #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40)
459 * If set to zero when LSO is '1', then the IPID of the tunnel
460 * IP header will not be modified during LSO operations. If set
461 * to one when LSO is '1', then the IPID of the tunnel IP header
462 * will be incremented for each subsequent segment of an LSO
463 * operation. The flag is ignored if the LSO packet is a normal
464 * (non-tunneled) TCP packet.
466 #define TX_BD_LONG_LFLAGS_T_IPID UINT32_C(0x80)
468 * If set to '1', then the RoCE ICRC will be appended to the
469 * packet. Packet must be a valid RoCE format packet.
471 #define TX_BD_LONG_LFLAGS_ROCE_CRC UINT32_C(0x100)
473 * If set to '1', then the FCoE CRC will be appended to the
474 * packet. Packet must be a valid FCoE format packet.
476 #define TX_BD_LONG_LFLAGS_FCOE_CRC UINT32_C(0x200)
479 * When LSO is '1', this field must contain the offset of the
480 * TCP payload from the beginning of the packet in as 16b words.
481 * In case of encapsulated/tunneling packet, this field contains
482 * the offset of the inner TCP payload from beginning of the
483 * packet as 16-bit words. This value must be valid on the first
486 #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
487 #define TX_BD_LONG_HDR_SIZE_SFT 0
490 * This is the MSS value that will be used to do the LSO
491 * processing. The value is the length in bytes of the TCP
492 * payload for each segment generated by the LSO operation. This
493 * value must be valid on the first BD of a packet.
495 #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
496 #define TX_BD_LONG_MSS_SFT 0
500 * This value selects a CFA action to perform on the packet. Set
501 * this value to zero if no CFA action is desired. This value
502 * must be valid on the first BD of a packet.
506 * This value is action meta-data that defines CFA edit
507 * operations that are done in addition to any action editing.
509 /* When key=1, This is the VLAN tag VID value. */
510 #define TX_BD_LONG_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
511 #define TX_BD_LONG_CFA_META_VLAN_VID_SFT 0
512 /* When key=1, This is the VLAN tag DE value. */
513 #define TX_BD_LONG_CFA_META_VLAN_DE UINT32_C(0x1000)
514 /* When key=1, This is the VLAN tag PRI value. */
515 #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
516 #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT 13
517 /* When key=1, This is the VLAN tag TPID select value. */
518 #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
519 #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT 16
521 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
523 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
525 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
527 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
529 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
530 /* Value programmed in CFA VLANTPID register. */
531 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
532 #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
533 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
534 /* When key=1, This is the VLAN tag TPID select value. */
535 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
536 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
538 * This field identifies the type of edit to be performed on the
539 * packet. This value must be valid on the first BD of a packet.
541 #define TX_BD_LONG_CFA_META_KEY_MASK UINT32_C(0xf0000000)
542 #define TX_BD_LONG_CFA_META_KEY_SFT 28
544 #define TX_BD_LONG_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
546 * - meta[17:16] - TPID select value (0 =
547 * 0x8100). - meta[15:12] - PRI/DE value. -
548 * meta[11:0] - VID value.
550 #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
551 #define TX_BD_LONG_CFA_META_KEY_LAST \
552 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
553 } __attribute__((packed));
555 /* RX Producer Packet BD (16 bytes) */
556 struct rx_prod_pkt_bd {
558 /* This value identifies the type of buffer descriptor. */
559 #define RX_PROD_PKT_BD_TYPE_MASK UINT32_C(0x3f)
560 #define RX_PROD_PKT_BD_TYPE_SFT 0
562 * Indicates that this BD is 16B long and is an
563 * RX Producer (ie. empty) buffer descriptor.
565 #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT UINT32_C(0x4)
567 * If set to 1, the packet will be placed at the address plus
568 * 2B. The 2 Bytes of padding will be written as zero.
571 * This is intended to be used when the host buffer is cache-
572 * line aligned to produce packets that are easy to parse in
573 * host memory while still allowing writes to be cache line
576 #define RX_PROD_PKT_BD_FLAGS_SOP_PAD UINT32_C(0x40)
578 * If set to 1, the packet write will be padded out to the
579 * nearest cache-line with zero value padding.
582 * If receive buffers start/end on cache-line boundaries, this
583 * feature will ensure that all data writes on the PCI bus
584 * start/end on cache line boundaries.
586 #define RX_PROD_PKT_BD_FLAGS_EOP_PAD UINT32_C(0x80)
588 * This value is the number of additional buffers in the ring
589 * that describe the buffer space to be consumed for the this
590 * packet. If the value is zero, then the packet must fit within
591 * the space described by this BD. If this value is 1 or more,
592 * it indicates how many additional "buffer" BDs are in the ring
593 * immediately following this BD to be used for the same network
594 * packet. Even if the packet to be placed does not need all the
595 * additional buffers, they will be consumed anyway.
597 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
598 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT 8
599 #define RX_PROD_PKT_BD_FLAGS_MASK UINT32_C(0xffc0)
600 #define RX_PROD_PKT_BD_FLAGS_SFT 6
603 * This is the length in Bytes of the host physical buffer where
604 * data for the packet may be placed in host memory.
607 * While this is a Byte resolution value, it is often
608 * advantageous to ensure that the buffers provided end on a
613 * The opaque data field is pass through to the completion and
614 * can be used for any data that the driver wants to associate
615 * with this receive buffer set.
619 * This is the host physical address where data for the packet
620 * may by placed in host memory.
623 * While this is a Byte resolution value, it is often
624 * advantageous to ensure that the buffers provide start on a
627 } __attribute__((packed));
629 /* Completion Ring Structures */
630 /* Note: This structure is used by the HWRM to communicate HWRM Error. */
631 /* Base Completion Record (16 bytes) */
636 * This field indicates the exact type of the completion. By
637 * convention, the LSB identifies the length of the record in
638 * 16B units. Even values indicate 16B records. Odd values
639 * indicate 32B records.
641 #define CMPL_BASE_TYPE_MASK UINT32_C(0x3f)
642 #define CMPL_BASE_TYPE_SFT 0
643 /* TX L2 completion: Completion of TX packet. Length = 16B */
644 #define CMPL_BASE_TYPE_TX_L2 UINT32_C(0x0)
646 * RX L2 completion: Completion of and L2 RX
647 * packet. Length = 32B
649 #define CMPL_BASE_TYPE_RX_L2 UINT32_C(0x11)
651 * RX Aggregation Buffer completion : Completion
652 * of an L2 aggregation buffer in support of
653 * TPA, HDS, or Jumbo packet completion. Length
656 #define CMPL_BASE_TYPE_RX_AGG UINT32_C(0x12)
658 * RX L2 TPA Start Completion: Completion at the
659 * beginning of a TPA operation. Length = 32B
661 #define CMPL_BASE_TYPE_RX_TPA_START UINT32_C(0x13)
663 * RX L2 TPA End Completion: Completion at the
664 * end of a TPA operation. Length = 32B
666 #define CMPL_BASE_TYPE_RX_TPA_END UINT32_C(0x15)
668 * Statistics Ejection Completion: Completion of
669 * statistics data ejection buffer. Length = 16B
671 #define CMPL_BASE_TYPE_STAT_EJECT UINT32_C(0x1a)
672 /* HWRM Command Completion: Completion of an HWRM command. */
673 #define CMPL_BASE_TYPE_HWRM_DONE UINT32_C(0x20)
674 /* Forwarded HWRM Request */
675 #define CMPL_BASE_TYPE_HWRM_FWD_REQ UINT32_C(0x22)
676 /* Forwarded HWRM Response */
677 #define CMPL_BASE_TYPE_HWRM_FWD_RESP UINT32_C(0x24)
678 /* HWRM Asynchronous Event Information */
679 #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
680 /* CQ Notification */
681 #define CMPL_BASE_TYPE_CQ_NOTIFICATION UINT32_C(0x30)
682 /* SRQ Threshold Event */
683 #define CMPL_BASE_TYPE_SRQ_EVENT UINT32_C(0x32)
684 /* DBQ Threshold Event */
685 #define CMPL_BASE_TYPE_DBQ_EVENT UINT32_C(0x34)
686 /* QP Async Notification */
687 #define CMPL_BASE_TYPE_QP_EVENT UINT32_C(0x38)
688 /* Function Async Notification */
689 #define CMPL_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a)
698 * This value is written by the NIC such that it will be
699 * different for each pass through the completion queue. The
700 * even passes will write 1. The odd passes will write 0.
702 #define CMPL_BASE_V UINT32_C(0x1)
704 #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
705 #define CMPL_BASE_INFO3_SFT 1
708 } __attribute__((packed));
710 /* TX Completion Record (16 bytes) */
714 * This field indicates the exact type of the completion. By
715 * convention, the LSB identifies the length of the record in
716 * 16B units. Even values indicate 16B records. Odd values
717 * indicate 32B records.
719 #define TX_CMPL_TYPE_MASK UINT32_C(0x3f)
720 #define TX_CMPL_TYPE_SFT 0
721 /* TX L2 completion: Completion of TX packet. Length = 16B */
722 #define TX_CMPL_TYPE_TX_L2 UINT32_C(0x0)
724 * When this bit is '1', it indicates a packet that has an error
725 * of some type. Type of error is indicated in error_flags.
727 #define TX_CMPL_FLAGS_ERROR UINT32_C(0x40)
729 * When this bit is '1', it indicates that the packet completed
730 * was transmitted using the push acceleration data provided by
731 * the driver. When this bit is '0', it indicates that the
732 * packet had not push acceleration data written or was executed
733 * as a normal packet even though push data was provided.
735 #define TX_CMPL_FLAGS_PUSH UINT32_C(0x80)
736 #define TX_CMPL_FLAGS_MASK UINT32_C(0xffc0)
737 #define TX_CMPL_FLAGS_SFT 6
739 /* unused1 is 16 b */
742 * This is a copy of the opaque field from the first TX BD of
743 * this transmitted packet.
747 * This value is written by the NIC such that it will be
748 * different for each pass through the completion queue. The
749 * even passes will write 1. The odd passes will write 0.
751 #define TX_CMPL_V UINT32_C(0x1)
753 * This error indicates that there was some sort of problem with
754 * the BDs for the packet.
756 #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
757 #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1
759 #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
760 /* Bad Format: BDs were not formatted correctly. */
761 #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
762 #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
763 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
765 * When this bit is '1', it indicates that the length of the
766 * packet was zero. No packet was transmitted.
768 #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
770 * When this bit is '1', it indicates that the packet was longer
771 * than the programmed limit in TDI. No packet was transmitted.
773 #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
775 * When this bit is '1', it indicates that one or more of the
776 * BDs associated with this packet generated a PCI error. This
777 * probably means the address was not valid.
779 #define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40)
781 * When this bit is '1', it indicates that the packet was longer
782 * than indicated by the hint. No packet was transmitted.
784 #define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
786 * When this bit is '1', it indicates that the packet was
787 * dropped due to Poison TLP error on one or more of the TLPs in
788 * the PXP completion.
790 #define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
791 #define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe)
792 #define TX_CMPL_ERRORS_SFT 1
794 /* unused2 is 16 b */
796 /* unused3 is 32 b */
797 } __attribute__((packed));
799 /* RX Packet Completion Record (32 bytes split to 2 16-byte struct) */
803 * This field indicates the exact type of the completion. By
804 * convention, the LSB identifies the length of the record in
805 * 16B units. Even values indicate 16B records. Odd values
806 * indicate 32B records.
808 #define RX_PKT_CMPL_TYPE_MASK UINT32_C(0x3f)
809 #define RX_PKT_CMPL_TYPE_SFT 0
811 * RX L2 completion: Completion of and L2 RX
812 * packet. Length = 32B
814 #define RX_PKT_CMPL_TYPE_RX_L2 UINT32_C(0x11)
815 #define RX_PKT_CMPL_TYPE_RX_L2_TPA_START UINT32_C(0x13)
816 #define RX_PKT_CMPL_TYPE_RX_L2_TPA_END UINT32_C(0x15)
818 * When this bit is '1', it indicates a packet that has an error
819 * of some type. Type of error is indicated in error_flags.
821 #define RX_PKT_CMPL_FLAGS_ERROR UINT32_C(0x40)
822 /* This field indicates how the packet was placed in the buffer. */
823 #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
824 #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT 7
825 /* Normal: Packet was placed using normal algorithm. */
826 #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7)
827 /* Jumbo: Packet was placed using jumbo algorithm. */
828 #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
830 * Header/Data Separation: Packet was placed
831 * using Header/Data separation algorithm. The
832 * separation location is indicated by the itype
835 #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
836 #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
837 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
838 /* This bit is '1' if the RSS field in this completion is valid. */
839 #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
841 #define RX_PKT_CMPL_FLAGS_UNUSED UINT32_C(0x800)
843 * This value indicates what the inner packet determined for the
846 #define RX_PKT_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
847 #define RX_PKT_CMPL_FLAGS_ITYPE_SFT 12
848 /* Not Known: Indicates that the packet type was not known. */
849 #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 12)
851 * IP Packet: Indicates that the packet was an
852 * IP packet, but further classification was not
855 #define RX_PKT_CMPL_FLAGS_ITYPE_IP (UINT32_C(0x1) << 12)
857 * TCP Packet: Indicates that the packet was IP
858 * and TCP. This indicates that the
859 * payload_offset field is valid.
861 #define RX_PKT_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
863 * UDP Packet: Indicates that the packet was IP
864 * and UDP. This indicates that the
865 * payload_offset field is valid.
867 #define RX_PKT_CMPL_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 12)
869 * FCoE Packet: Indicates that the packet was
870 * recognized as a FCoE. This also indicates
871 * that the payload_offset field is valid.
873 #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 12)
875 * RoCE Packet: Indicates that the packet was
876 * recognized as a RoCE. This also indicates
877 * that the payload_offset field is valid.
879 #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 12)
881 * ICMP Packet: Indicates that the packet was
882 * recognized as ICMP. This indicates that the
883 * payload_offset field is valid.
885 #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 12)
887 * PtP packet wo/timestamp: Indicates that the
888 * packet was recognized as a PtP packet.
890 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 12)
892 * PtP packet w/timestamp: Indicates that the
893 * packet was recognized as a PtP packet and
894 * that a timestamp was taken for the packet.
896 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 12)
897 #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
898 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
899 #define RX_PKT_CMPL_FLAGS_MASK UINT32_C(0xffc0)
900 #define RX_PKT_CMPL_FLAGS_SFT 6
903 * This is the length of the data for the packet stored in the
904 * buffer(s) identified by the opaque value. This includes the
905 * packet BD and any associated buffer BDs. This does not
906 * include the the length of any data places in aggregation BDs.
910 * This is a copy of the opaque field from the RX BD this
911 * completion corresponds to.
916 * This value is written by the NIC such that it will be
917 * different for each pass through the completion queue. The
918 * even passes will write 1. The odd passes will write 0.
920 #define RX_PKT_CMPL_V1 UINT32_C(0x1)
922 * This value is the number of aggregation buffers that follow
923 * this entry in the completion ring that are a part of this
924 * packet. If the value is zero, then the packet is completely
925 * contained in the buffer space provided for the packet in the
928 #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
929 #define RX_PKT_CMPL_AGG_BUFS_SFT 1
931 uint8_t rss_hash_type;
933 * This is the RSS hash type for the packet. The value is packed
934 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}
935 * . The value of tuple_extrac_op provides the information about
936 * what fields the hash was computed on. * 0: The RSS hash was
937 * computed over source IP address, destination IP address,
938 * source port, and destination port of inner IP and TCP or UDP
939 * headers. Note: For non-tunneled packets, the packet headers
940 * are considered inner packet headers for the RSS hash
941 * computation purpose. * 1: The RSS hash was computed over
942 * source IP address and destination IP address of inner IP
943 * header. Note: For non-tunneled packets, the packet headers
944 * are considered inner packet headers for the RSS hash
945 * computation purpose. * 2: The RSS hash was computed over
946 * source IP address, destination IP address, source port, and
947 * destination port of IP and TCP or UDP headers of outer tunnel
948 * headers. Note: For non-tunneled packets, this value is not
949 * applicable. * 3: The RSS hash was computed over source IP
950 * address and destination IP address of IP header of outer
951 * tunnel headers. Note: For non-tunneled packets, this value is
952 * not applicable. Note that 4-tuples values listed above are
953 * applicable for layer 4 protocols supported and enabled for
954 * RSS in the hardware, HWRM firmware, and drivers. For example,
955 * if RSS hash is supported and enabled for TCP traffic only,
956 * then the values of tuple_extract_op corresponding to 4-tuples
957 * are only valid for TCP traffic.
959 uint8_t payload_offset;
961 * This value indicates the offset in bytes from the beginning
962 * of the packet where the inner payload starts. This value is
963 * valid for TCP, UDP, FCoE, and RoCE packets. A value of zero
964 * indicates that header is 256B into the packet.
970 * This value is the RSS hash value calculated for the packet
971 * based on the mode bits and key value in the VNIC.
973 } __attribute__((packed));
975 /* last 16 bytes of RX Packet Completion Record */
976 struct rx_pkt_cmpl_hi {
979 * This indicates that the ip checksum was calculated for the
980 * inner packet and that the ip_cs_error field indicates if
981 * there was an error.
983 #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
985 * This indicates that the TCP, UDP or ICMP checksum was
986 * calculated for the inner packet and that the l4_cs_error
987 * field indicates if there was an error.
989 #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
991 * This indicates that the ip checksum was calculated for the
992 * tunnel header and that the t_ip_cs_error field indicates if
993 * there was an error.
995 #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
997 * This indicates that the UDP checksum was calculated for the
998 * tunnel packet and that the t_l4_cs_error field indicates if
999 * there was an error.
1001 #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
1002 /* This value indicates what format the metadata field is. */
1003 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
1004 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT 4
1005 /* No metadata informtaion. Value is zero. */
1006 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
1008 * The metadata field contains the VLAN tag and
1009 * TPID value. - metadata[11:0] contains the
1010 * vlan VID value. - metadata[12] contains the
1011 * vlan DE value. - metadata[15:13] contains the
1012 * vlan PRI value. - metadata[31:16] contains
1013 * the vlan TPID value.
1015 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
1016 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
1017 RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
1019 * This field indicates the IP type for the inner-most IP
1020 * header. A value of '0' indicates IPv4. A value of '1'
1021 * indicates IPv6. This value is only valid if itype indicates a
1022 * packet with an IP header.
1024 #define RX_PKT_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
1027 * This is data from the CFA block as indicated by the
1028 * meta_format field.
1030 /* When meta_format=1, this value is the VLAN VID. */
1031 #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
1032 #define RX_PKT_CMPL_METADATA_VID_SFT 0
1033 /* When meta_format=1, this value is the VLAN DE. */
1034 #define RX_PKT_CMPL_METADATA_DE UINT32_C(0x1000)
1035 /* When meta_format=1, this value is the VLAN PRI. */
1036 #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
1037 #define RX_PKT_CMPL_METADATA_PRI_SFT 13
1038 /* When meta_format=1, this value is the VLAN TPID. */
1039 #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
1040 #define RX_PKT_CMPL_METADATA_TPID_SFT 16
1043 * This value is written by the NIC such that it will be
1044 * different for each pass through the completion queue. The
1045 * even passes will write 1. The odd passes will write 0.
1047 #define RX_PKT_CMPL_V2 UINT32_C(0x1)
1049 * This error indicates that there was some sort of problem with
1050 * the BDs for the packet that was found after part of the
1051 * packet was already placed. The packet should be treated as
1054 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
1055 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT 1
1056 /* No buffer error */
1057 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
1059 * Did Not Fit: Packet did not fit into packet
1060 * buffer provided. For regular placement, this
1061 * means the packet did not fit in the buffer
1062 * provided. For HDS and jumbo placement, this
1063 * means that the packet could not be placed
1064 * into 7 physical buffers or less.
1066 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
1067 (UINT32_C(0x1) << 1)
1069 * Not On Chip: All BDs needed for the packet
1070 * were not on-chip when the packet arrived.
1072 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
1073 (UINT32_C(0x2) << 1)
1074 /* Bad Format: BDs were not formatted correctly. */
1075 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
1076 (UINT32_C(0x3) << 1)
1077 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
1078 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT
1079 /* This indicates that there was an error in the IP header checksum. */
1080 #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR UINT32_C(0x10)
1082 * This indicates that there was an error in the TCP, UDP or
1085 #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR UINT32_C(0x20)
1087 * This indicates that there was an error in the tunnel IP
1090 #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
1092 * This indicates that there was an error in the tunnel UDP
1095 #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
1097 * This indicates that there was a CRC error on either an FCoE
1098 * or RoCE packet. The itype indicates the packet type.
1100 #define RX_PKT_CMPL_ERRORS_CRC_ERROR UINT32_C(0x100)
1102 * This indicates that there was an error in the tunnel portion
1103 * of the packet when this field is non-zero.
1105 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
1106 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT 9
1108 * No additional error occurred on the tunnel
1109 * portion of the packet of the packet does not
1112 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
1114 * Indicates that IP header version does not
1115 * match expectation from L2 Ethertype for IPv4
1116 * and IPv6 in the tunnel header.
1118 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
1119 (UINT32_C(0x1) << 9)
1121 * Indicates that header length is out of range
1122 * in the tunnel header. Valid for IPv4.
1124 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
1125 (UINT32_C(0x2) << 9)
1127 * Indicates that the physical packet is shorter
1128 * than that claimed by the PPPoE header length
1129 * for a tunnel PPPoE packet.
1131 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
1132 (UINT32_C(0x3) << 9)
1134 * Indicates that physical packet is shorter
1135 * than that claimed by the tunnel l3 header
1136 * length. Valid for IPv4, or IPv6 tunnel packet
1139 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
1140 (UINT32_C(0x4) << 9)
1142 * Indicates that the physical packet is shorter
1143 * than that claimed by the tunnel UDP header
1144 * length for a tunnel UDP packet that is not
1147 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
1148 (UINT32_C(0x5) << 9)
1150 * indicates that the IPv4 TTL or IPv6 hop limit
1151 * check have failed (e.g. TTL = 0) in the
1152 * tunnel header. Valid for IPv4, and IPv6.
1154 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
1155 (UINT32_C(0x6) << 9)
1156 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
1157 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
1159 * This indicates that there was an error in the inner portion
1160 * of the packet when this field is non-zero.
1162 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
1163 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT 12
1165 * No additional error occurred on the tunnel
1166 * portion of the packet of the packet does not
1169 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
1171 * Indicates that IP header version does not
1172 * match expectation from L2 Ethertype for IPv4
1173 * and IPv6 or that option other than VFT was
1174 * parsed on FCoE packet.
1176 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
1177 (UINT32_C(0x1) << 12)
1179 * indicates that header length is out of range.
1180 * Valid for IPv4 and RoCE
1182 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
1183 (UINT32_C(0x2) << 12)
1185 * indicates that the IPv4 TTL or IPv6 hop limit
1186 * check have failed (e.g. TTL = 0). Valid for
1189 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
1191 * Indicates that physical packet is shorter
1192 * than that claimed by the l3 header length.
1193 * Valid for IPv4, IPv6 packet or RoCE packets.
1195 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
1196 (UINT32_C(0x4) << 12)
1198 * Indicates that the physical packet is shorter
1199 * than that claimed by the UDP header length
1200 * for a UDP packet that is not fragmented.
1202 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
1203 (UINT32_C(0x5) << 12)
1205 * Indicates that TCP header length > IP
1206 * payload. Valid for TCP packets only.
1208 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
1209 (UINT32_C(0x6) << 12)
1210 /* Indicates that TCP header length < 5. Valid for TCP. */
1211 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
1212 (UINT32_C(0x7) << 12)
1214 * Indicates that TCP option headers result in a
1215 * TCP header size that does not match data
1216 * offset in TCP header. Valid for TCP.
1218 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
1219 (UINT32_C(0x8) << 12)
1220 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
1221 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
1222 #define RX_PKT_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1223 #define RX_PKT_CMPL_ERRORS_SFT 1
1226 * This field identifies the CFA action rule that was used for
1231 * This value holds the reordering sequence number for the
1232 * packet. If the reordering sequence is not valid, then this
1233 * value is zero. The reordering domain for the packet is in the
1234 * bottom 8 to 10b of the rss_hash value. The bottom 20b of this
1235 * value contain the ordering domain value for the packet.
1237 #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
1238 #define RX_PKT_CMPL_REORDER_SFT 0
1239 } __attribute__((packed));
1241 /* RX L2 TPA Start Completion Record (32 bytes split to 2 16-byte struct) */
1242 struct rx_tpa_start_cmpl {
1243 uint16_t flags_type;
1245 * This field indicates the exact type of the completion. By
1246 * convention, the LSB identifies the length of the record in
1247 * 16B units. Even values indicate 16B records. Odd values
1248 * indicate 32B records.
1250 #define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f)
1251 #define RX_TPA_START_CMPL_TYPE_SFT 0
1253 * RX L2 TPA Start Completion: Completion at the
1254 * beginning of a TPA operation. Length = 32B
1256 #define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13)
1257 /* This bit will always be '0' for TPA start completions. */
1258 #define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40)
1259 /* This field indicates how the packet was placed in the buffer. */
1260 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
1261 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7
1263 * Jumbo: TPA Packet was placed using jumbo
1264 * algorithm. This means that the first buffer
1265 * will be filled with data before moving to
1266 * aggregation buffers. Each aggregation buffer
1267 * will be filled before moving to the next
1268 * aggregation buffer.
1270 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
1272 * Header/Data Separation: Packet was placed
1273 * using Header/Data separation algorithm. The
1274 * separation location is indicated by the itype
1277 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
1279 * GRO/Jumbo: Packet will be placed using
1280 * GRO/Jumbo where the first packet is filled
1281 * with data. Subsequent packets will be placed
1282 * such that any one packet does not span two
1283 * aggregation buffers unless it starts at the
1284 * beginning of an aggregation buffer.
1286 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
1287 (UINT32_C(0x5) << 7)
1289 * GRO/Header-Data Separation: Packet will be
1290 * placed using GRO/HDS where the header is in
1291 * the first packet. Payload of each packet will
1292 * be placed such that any one packet does not
1293 * span two aggregation buffers unless it starts
1294 * at the beginning of an aggregation buffer.
1296 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
1297 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
1298 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
1299 /* This bit is '1' if the RSS field in this completion is valid. */
1300 #define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
1302 #define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800)
1304 * This value indicates what the inner packet determined for the
1307 #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
1308 #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12
1309 /* TCP Packet: Indicates that the packet was IP and TCP. */
1310 #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
1311 #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
1312 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
1313 #define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0)
1314 #define RX_TPA_START_CMPL_FLAGS_SFT 6
1317 * This value indicates the amount of packet data written to the
1318 * buffer the opaque field in this completion corresponds to.
1322 * This is a copy of the opaque field from the RX BD this
1323 * completion corresponds to.
1326 /* unused1 is 7 b */
1328 * This value is written by the NIC such that it will be
1329 * different for each pass through the completion queue. The
1330 * even passes will write 1. The odd passes will write 0.
1332 #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
1333 /* unused1 is 7 b */
1334 uint8_t rss_hash_type;
1336 * This is the RSS hash type for the packet. The value is packed
1337 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}
1338 * . The value of tuple_extrac_op provides the information about
1339 * what fields the hash was computed on. * 0: The RSS hash was
1340 * computed over source IP address, destination IP address,
1341 * source port, and destination port of inner IP and TCP or UDP
1342 * headers. Note: For non-tunneled packets, the packet headers
1343 * are considered inner packet headers for the RSS hash
1344 * computation purpose. * 1: The RSS hash was computed over
1345 * source IP address and destination IP address of inner IP
1346 * header. Note: For non-tunneled packets, the packet headers
1347 * are considered inner packet headers for the RSS hash
1348 * computation purpose. * 2: The RSS hash was computed over
1349 * source IP address, destination IP address, source port, and
1350 * destination port of IP and TCP or UDP headers of outer tunnel
1351 * headers. Note: For non-tunneled packets, this value is not
1352 * applicable. * 3: The RSS hash was computed over source IP
1353 * address and destination IP address of IP header of outer
1354 * tunnel headers. Note: For non-tunneled packets, this value is
1355 * not applicable. Note that 4-tuples values listed above are
1356 * applicable for layer 4 protocols supported and enabled for
1357 * RSS in the hardware, HWRM firmware, and drivers. For example,
1358 * if RSS hash is supported and enabled for TCP traffic only,
1359 * then the values of tuple_extract_op corresponding to 4-tuples
1360 * are only valid for TCP traffic.
1364 * This is the aggregation ID that the completion is associated
1365 * with. Use this number to correlate the TPA start completion
1366 * with the TPA end completion.
1368 /* unused2 is 9 b */
1370 * This is the aggregation ID that the completion is associated
1371 * with. Use this number to correlate the TPA start completion
1372 * with the TPA end completion.
1374 #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
1375 #define RX_TPA_START_CMPL_AGG_ID_SFT 9
1378 * This value is the RSS hash value calculated for the packet
1379 * based on the mode bits and key value in the VNIC.
1381 } __attribute__((packed));
1383 /* last 16 bytes of RX L2 TPA Start Completion Record */
1384 struct rx_tpa_start_cmpl_hi {
1387 * This indicates that the ip checksum was calculated for the
1388 * inner packet and that the sum passed for all segments
1389 * included in the aggregation.
1391 #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
1393 * This indicates that the TCP, UDP or ICMP checksum was
1394 * calculated for the inner packet and that the sum passed for
1395 * all segments included in the aggregation.
1397 #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
1399 * This indicates that the ip checksum was calculated for the
1400 * tunnel header and that the sum passed for all segments
1401 * included in the aggregation.
1403 #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
1405 * This indicates that the UDP checksum was calculated for the
1406 * tunnel packet and that the sum passed for all segments
1407 * included in the aggregation.
1409 #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
1410 /* This value indicates what format the metadata field is. */
1411 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
1412 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT 4
1413 /* No metadata informtaion. Value is zero. */
1414 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
1416 * The metadata field contains the VLAN tag and
1417 * TPID value. - metadata[11:0] contains the
1418 * vlan VID value. - metadata[12] contains the
1419 * vlan DE value. - metadata[15:13] contains the
1420 * vlan PRI value. - metadata[31:16] contains
1421 * the vlan TPID value.
1423 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
1424 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
1425 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
1427 * This field indicates the IP type for the inner-most IP
1428 * header. A value of '0' indicates IPv4. A value of '1'
1431 #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
1434 * This is data from the CFA block as indicated by the
1435 * meta_format field.
1437 /* When meta_format=1, this value is the VLAN VID. */
1438 #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
1439 #define RX_TPA_START_CMPL_METADATA_VID_SFT 0
1440 /* When meta_format=1, this value is the VLAN DE. */
1441 #define RX_TPA_START_CMPL_METADATA_DE UINT32_C(0x1000)
1442 /* When meta_format=1, this value is the VLAN PRI. */
1443 #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
1444 #define RX_TPA_START_CMPL_METADATA_PRI_SFT 13
1445 /* When meta_format=1, this value is the VLAN TPID. */
1446 #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
1447 #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
1449 /* unused4 is 15 b */
1451 * This value is written by the NIC such that it will be
1452 * different for each pass through the completion queue. The
1453 * even passes will write 1. The odd passes will write 0.
1455 #define RX_TPA_START_CMPL_V2 UINT32_C(0x1)
1456 /* unused4 is 15 b */
1459 * This field identifies the CFA action rule that was used for
1462 uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
1464 * This is the size in bytes of the inner most L4 header. This
1465 * can be subtracted from the payload_offset to determine the
1466 * start of the inner most L4 header.
1469 * This is the offset from the beginning of the packet in bytes
1470 * for the outer L3 header. If there is no outer L3 header, then
1471 * this value is zero.
1473 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
1474 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
1476 * This is the offset from the beginning of the packet in bytes
1477 * for the inner most L2 header.
1479 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
1480 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
1482 * This is the offset from the beginning of the packet in bytes
1483 * for the inner most L3 header.
1485 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
1486 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
1488 * This is the size in bytes of the inner most L4 header. This
1489 * can be subtracted from the payload_offset to determine the
1490 * start of the inner most L4 header.
1492 #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK UINT32_C(0xf8000000)
1493 #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT 27
1494 } __attribute__((packed));
1496 /* RX TPA End Completion Record (32 bytes split to 2 16-byte struct) */
1497 struct rx_tpa_end_cmpl {
1498 uint16_t flags_type;
1500 * This field indicates the exact type of the completion. By
1501 * convention, the LSB identifies the length of the record in
1502 * 16B units. Even values indicate 16B records. Odd values
1503 * indicate 32B records.
1505 #define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f)
1506 #define RX_TPA_END_CMPL_TYPE_SFT 0
1508 * RX L2 TPA End Completion: Completion at the
1509 * end of a TPA operation. Length = 32B
1511 #define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15)
1513 * When this bit is '1', it indicates a packet that has an error
1514 * of some type. Type of error is indicated in error_flags.
1516 #define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40)
1517 /* This field indicates how the packet was placed in the buffer. */
1518 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
1519 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7
1521 * Jumbo: TPA Packet was placed using jumbo
1522 * algorithm. This means that the first buffer
1523 * will be filled with data before moving to
1524 * aggregation buffers. Each aggregation buffer
1525 * will be filled before moving to the next
1526 * aggregation buffer.
1528 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
1530 * Header/Data Separation: Packet was placed
1531 * using Header/Data separation algorithm. The
1532 * separation location is indicated by the itype
1535 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
1537 * GRO/Jumbo: Packet will be placed using
1538 * GRO/Jumbo where the first packet is filled
1539 * with data. Subsequent packets will be placed
1540 * such that any one packet does not span two
1541 * aggregation buffers unless it starts at the
1542 * beginning of an aggregation buffer.
1544 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
1546 * GRO/Header-Data Separation: Packet will be
1547 * placed using GRO/HDS where the header is in
1548 * the first packet. Payload of each packet will
1549 * be placed such that any one packet does not
1550 * span two aggregation buffers unless it starts
1551 * at the beginning of an aggregation buffer.
1553 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
1554 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
1555 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
1557 #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK UINT32_C(0xc00)
1558 #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT 10
1560 * This value indicates what the inner packet determined for the
1561 * packet was. - 2 TCP Packet Indicates that the packet was IP
1562 * and TCP. This indicates that the ip_cs field is valid and
1563 * that the tcp_udp_cs field is valid and contains the TCP
1564 * checksum. This also indicates that the payload_offset field
1567 #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
1568 #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12
1569 #define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0)
1570 #define RX_TPA_END_CMPL_FLAGS_SFT 6
1573 * This value is zero for TPA End completions. There is no data
1574 * in the buffer that corresponds to the opaque value in this
1579 * This is a copy of the opaque field from the RX BD this
1580 * completion corresponds to.
1582 uint8_t agg_bufs_v1;
1583 /* unused1 is 1 b */
1585 * This value is written by the NIC such that it will be
1586 * different for each pass through the completion queue. The
1587 * even passes will write 1. The odd passes will write 0.
1589 #define RX_TPA_END_CMPL_V1 UINT32_C(0x1)
1591 * This value is the number of aggregation buffers that follow
1592 * this entry in the completion ring that are a part of this
1593 * aggregation packet. If the value is zero, then the packet is
1594 * completely contained in the buffer space provided in the
1595 * aggregation start completion.
1597 #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
1598 #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
1599 /* unused1 is 1 b */
1601 /* This value is the number of segments in the TPA operation. */
1602 uint8_t payload_offset;
1604 * This value indicates the offset in bytes from the beginning
1605 * of the packet where the inner payload starts. This value is
1606 * valid for TCP, UDP, FCoE, and RoCE packets. A value of zero
1607 * indicates an offset of 256 bytes.
1611 * This is the aggregation ID that the completion is associated
1612 * with. Use this number to correlate the TPA start completion
1613 * with the TPA end completion.
1615 /* unused2 is 1 b */
1617 * This is the aggregation ID that the completion is associated
1618 * with. Use this number to correlate the TPA start completion
1619 * with the TPA end completion.
1621 #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
1622 #define RX_TPA_END_CMPL_AGG_ID_SFT 1
1625 * For non-GRO packets, this value is the timestamp delta
1626 * between earliest and latest timestamp values for TPA packet.
1627 * If packets were not time stamped, then delta will be zero.
1628 * For GRO packets, this field is zero except for the following
1629 * sub-fields. - tsdelta[31] Timestamp present indication. When
1630 * '0', no Timestamp option is in the packet. When '1', then a
1631 * Timestamp option is present in the packet.
1633 } __attribute__((packed));
1635 /* last 16 bytes of RX TPA End Completion Record */
1636 struct rx_tpa_end_cmpl_hi {
1637 uint32_t tpa_dup_acks;
1638 /* unused3 is 28 b */
1640 * This value is the number of duplicate ACKs that have been
1641 * received as part of the TPA operation.
1643 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
1644 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
1645 /* unused3 is 28 b */
1646 uint16_t tpa_seg_len;
1648 * This value is the valid when TPA completion is active. It
1649 * indicates the length of the longest segment of the TPA
1650 * operation for LRO mode and the length of the first segment in
1651 * GRO mode. This value may be used by GRO software to re-
1652 * construct the original packet stream from the TPA packet.
1653 * This is the length of all but the last segment for GRO. In
1654 * LRO mode this value may be used to indicate MSS size to the
1658 /* unused4 is 16 b */
1661 * This value is written by the NIC such that it will be
1662 * different for each pass through the completion queue. The
1663 * even passes will write 1. The odd passes will write 0.
1665 #define RX_TPA_END_CMPL_V2 UINT32_C(0x1)
1667 * This error indicates that there was some sort of problem with
1668 * the BDs for the packet that was found after part of the
1669 * packet was already placed. The packet should be treated as
1672 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
1673 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT 1
1675 * This error occurs when there is a fatal HW
1676 * problem in the chip only. It indicates that
1677 * there were not BDs on chip but that there was
1678 * adequate reservation. provided by the TPA
1681 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
1682 (UINT32_C(0x2) << 1)
1684 * This error occurs when TPA block was not
1685 * configured to reserve adequate BDs for TPA
1686 * operations on this RX ring. All data for the
1687 * TPA operation was not placed. This error can
1688 * also be generated when the number of segments
1689 * is not programmed correctly in TPA and the 33
1690 * total aggregation buffers allowed for the TPA
1691 * operation has been exceeded.
1693 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
1694 (UINT32_C(0x4) << 1)
1695 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
1696 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
1697 #define RX_TPA_END_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1698 #define RX_TPA_END_CMPL_ERRORS_SFT 1
1700 /* unused5 is 16 b */
1701 uint32_t start_opaque;
1703 * This is the opaque value that was completed for the TPA start
1704 * completion that corresponds to this TPA end completion.
1706 } __attribute__((packed));
1708 /* HWRM Forwarded Request (16 bytes) */
1709 struct hwrm_fwd_req_cmpl {
1710 uint16_t req_len_type;
1711 /* Length of forwarded request in bytes. */
1713 * This field indicates the exact type of the completion. By
1714 * convention, the LSB identifies the length of the record in
1715 * 16B units. Even values indicate 16B records. Odd values
1716 * indicate 32B records.
1718 #define HWRM_FWD_INPUT_CMPL_TYPE_MASK UINT32_C(0x3f)
1719 #define HWRM_FWD_INPUT_CMPL_TYPE_SFT 0
1720 /* Forwarded HWRM Request */
1721 #define HWRM_FWD_INPUT_CMPL_TYPE_HWRM_FWD_INPUT UINT32_C(0x22)
1722 /* Length of forwarded request in bytes. */
1723 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
1724 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
1727 * Source ID of this request. Typically used in forwarding
1728 * requests and responses. 0x0 - 0xFFF8 - Used for function ids
1729 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
1733 /* unused1 is 32 b */
1734 uint32_t req_buf_addr_v[2];
1735 /* Address of forwarded request. */
1737 * This value is written by the NIC such that it will be
1738 * different for each pass through the completion queue. The
1739 * even passes will write 1. The odd passes will write 0.
1741 #define HWRM_FWD_INPUT_CMPL_V UINT32_C(0x1)
1742 /* Address of forwarded request. */
1743 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
1744 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
1745 } __attribute__((packed));
1747 /* HWRM Asynchronous Event Completion Record (16 bytes) */
1748 struct hwrm_async_event_cmpl {
1750 /* unused1 is 10 b */
1752 * This field indicates the exact type of the completion. By
1753 * convention, the LSB identifies the length of the record in
1754 * 16B units. Even values indicate 16B records. Odd values
1755 * indicate 32B records.
1757 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
1758 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
1759 /* HWRM Asynchronous Event Information */
1760 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
1761 /* unused1 is 10 b */
1763 /* Identifiers of events. */
1764 /* Link status changed */
1765 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
1766 /* Link MTU changed */
1767 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
1768 /* Link speed changed */
1769 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
1770 /* DCB Configuration changed */
1771 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
1772 /* Port connection not allowed */
1773 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
1774 /* Link speed configuration was not allowed */
1775 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
1777 /* Link speed configuration change */
1778 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
1779 /* Port PHY configuration change */
1780 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
1781 /* Function driver unloaded */
1782 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
1783 /* Function driver loaded */
1784 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
1785 /* Function FLR related processing has completed */
1786 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
1787 /* PF driver unloaded */
1788 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
1789 /* PF driver loaded */
1790 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
1791 /* VF Function Level Reset (FLR) */
1792 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR UINT32_C(0x30)
1793 /* VF MAC Address Change */
1794 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
1795 /* PF-VF communication channel status change. */
1796 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
1798 /* VF Configuration Change */
1799 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
1801 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
1802 uint32_t event_data2;
1803 /* Event specific data */
1807 * This value is written by the NIC such that it will be
1808 * different for each pass through the completion queue. The
1809 * even passes will write 1. The odd passes will write 0.
1811 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
1813 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
1814 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
1815 uint8_t timestamp_lo;
1816 /* 8-lsb timestamp from POR (100-msec resolution) */
1817 uint16_t timestamp_hi;
1818 /* 16-lsb timestamp from POR (100-msec resolution) */
1819 uint32_t event_data1;
1820 /* Event specific data */
1821 } __attribute__((packed));
1825 * Description: This function is called by a driver to determine the HWRM
1826 * interface version supported by the HWRM firmware, the version of HWRM
1827 * firmware implementation, the name of HWRM firmware, the versions of other
1828 * embedded firmwares, and the names of other embedded firmwares, etc. Any
1829 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
1830 * be considered an invalid version.
1832 /* Input (24 bytes) */
1833 struct hwrm_ver_get_input {
1836 * This value indicates what type of request this is. The format
1837 * for the rest of the command is determined by this field.
1841 * This value indicates the what completion ring the request
1842 * will be optionally completed on. If the value is -1, then no
1843 * CR completion will be generated. Any other value must be a
1844 * valid CR ring_id value for this function.
1847 /* This value indicates the command sequence number. */
1850 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
1851 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
1856 * This is the host address where the response will be written
1857 * when the request is complete. This area must be 16B aligned
1858 * and must be cleared to zero before the request is made.
1860 uint8_t hwrm_intf_maj;
1862 * This field represents the major version of HWRM interface
1863 * specification supported by the driver HWRM implementation.
1864 * The interface major version is intended to change only when
1865 * non backward compatible changes are made to the HWRM
1866 * interface specification.
1868 uint8_t hwrm_intf_min;
1870 * This field represents the minor version of HWRM interface
1871 * specification supported by the driver HWRM implementation. A
1872 * change in interface minor version is used to reflect
1873 * significant backward compatible modification to HWRM
1874 * interface specification. This can be due to addition or
1875 * removal of functionality. HWRM interface specifications with
1876 * the same major version but different minor versions are
1879 uint8_t hwrm_intf_upd;
1881 * This field represents the update version of HWRM interface
1882 * specification supported by the driver HWRM implementation.
1883 * The interface update version is used to reflect minor changes
1884 * or bug fixes to a released HWRM interface specification.
1886 uint8_t unused_0[5];
1887 } __attribute__((packed));
1889 /* Output (128 bytes) */
1890 struct hwrm_ver_get_output {
1891 uint16_t error_code;
1893 * Pass/Fail or error type Note: receiver to verify the in
1894 * parameters, and fail the call with an error when appropriate
1897 /* This field returns the type of original request. */
1899 /* This field provides original sequence number of the command. */
1902 * This field is the length of the response in bytes. The last
1903 * byte of the response is a valid flag that will read as '1'
1904 * when the command has been completely written to memory.
1906 uint8_t hwrm_intf_maj;
1908 * This field represents the major version of HWRM interface
1909 * specification supported by the HWRM implementation. The
1910 * interface major version is intended to change only when non
1911 * backward compatible changes are made to the HWRM interface
1912 * specification. A HWRM implementation that is compliant with
1913 * this specification shall provide value of 1 in this field.
1915 uint8_t hwrm_intf_min;
1917 * This field represents the minor version of HWRM interface
1918 * specification supported by the HWRM implementation. A change
1919 * in interface minor version is used to reflect significant
1920 * backward compatible modification to HWRM interface
1921 * specification. This can be due to addition or removal of
1922 * functionality. HWRM interface specifications with the same
1923 * major version but different minor versions are compatible. A
1924 * HWRM implementation that is compliant with this specification
1925 * shall provide value of 2 in this field.
1927 uint8_t hwrm_intf_upd;
1929 * This field represents the update version of HWRM interface
1930 * specification supported by the HWRM implementation. The
1931 * interface update version is used to reflect minor changes or
1932 * bug fixes to a released HWRM interface specification. A HWRM
1933 * implementation that is compliant with this specification
1934 * shall provide value of 2 in this field.
1936 uint8_t hwrm_intf_rsvd;
1937 uint8_t hwrm_fw_maj;
1939 * This field represents the major version of HWRM firmware. A
1940 * change in firmware major version represents a major firmware
1943 uint8_t hwrm_fw_min;
1945 * This field represents the minor version of HWRM firmware. A
1946 * change in firmware minor version represents significant
1947 * firmware functionality changes.
1949 uint8_t hwrm_fw_bld;
1951 * This field represents the build version of HWRM firmware. A
1952 * change in firmware build version represents bug fixes to a
1953 * released firmware.
1955 uint8_t hwrm_fw_rsvd;
1957 * This field is a reserved field. This field can be used to
1958 * represent firmware branches or customer specific releases
1959 * tied to a specific (major,minor,update) version of the HWRM
1962 uint8_t mgmt_fw_maj;
1964 * This field represents the major version of mgmt firmware. A
1965 * change in major version represents a major release.
1967 uint8_t mgmt_fw_min;
1969 * This field represents the minor version of mgmt firmware. A
1970 * change in minor version represents significant functionality
1973 uint8_t mgmt_fw_bld;
1975 * This field represents the build version of mgmt firmware. A
1976 * change in update version represents bug fixes.
1978 uint8_t mgmt_fw_rsvd;
1980 * This field is a reserved field. This field can be used to
1981 * represent firmware branches or customer specific releases
1982 * tied to a specific (major,minor,update) version
1984 uint8_t netctrl_fw_maj;
1986 * This field represents the major version of network control
1987 * firmware. A change in major version represents a major
1990 uint8_t netctrl_fw_min;
1992 * This field represents the minor version of network control
1993 * firmware. A change in minor version represents significant
1994 * functionality changes.
1996 uint8_t netctrl_fw_bld;
1998 * This field represents the build version of network control
1999 * firmware. A change in update version represents bug fixes.
2001 uint8_t netctrl_fw_rsvd;
2003 * This field is a reserved field. This field can be used to
2004 * represent firmware branches or customer specific releases
2005 * tied to a specific (major,minor,update) version
2007 uint32_t dev_caps_cfg;
2009 * This field is used to indicate device's capabilities and
2013 * If set to 1, then secure firmware update behavior is
2014 * supported. If set to 0, then secure firmware update behavior
2017 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
2020 * If set to 1, then firmware based DCBX agent is supported. If
2021 * set to 0, then firmware based DCBX agent capability is not
2022 * supported on this device.
2024 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
2027 * If set to 1, then HWRM short command format is supported. If
2028 * set to 0, then HWRM short command format is not supported.
2030 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
2033 * If set to 1, then HWRM short command format is required. If
2034 * set to 0, then HWRM short command format is not required.
2036 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_INPUTUIRED \
2038 uint8_t roce_fw_maj;
2040 * This field represents the major version of RoCE firmware. A
2041 * change in major version represents a major release.
2043 uint8_t roce_fw_min;
2045 * This field represents the minor version of RoCE firmware. A
2046 * change in minor version represents significant functionality
2049 uint8_t roce_fw_bld;
2051 * This field represents the build version of RoCE firmware. A
2052 * change in update version represents bug fixes.
2054 uint8_t roce_fw_rsvd;
2056 * This field is a reserved field. This field can be used to
2057 * represent firmware branches or customer specific releases
2058 * tied to a specific (major,minor,update) version
2060 char hwrm_fw_name[16];
2062 * This field represents the name of HWRM FW (ASCII chars with
2065 char mgmt_fw_name[16];
2067 * This field represents the name of mgmt FW (ASCII chars with
2070 char netctrl_fw_name[16];
2072 * This field represents the name of network control firmware
2073 * (ASCII chars with NULL at the end).
2075 uint32_t reserved2[4];
2077 * This field is reserved for future use. The responder should
2078 * set it to 0. The requester should ignore this field.
2080 char roce_fw_name[16];
2082 * This field represents the name of RoCE FW (ASCII chars with
2086 /* This field returns the chip number. */
2088 /* This field returns the revision of chip. */
2090 /* This field returns the chip metal number. */
2091 uint8_t chip_bond_id;
2092 /* This field returns the bond id of the chip. */
2093 uint8_t chip_platform_type;
2095 * This value indicates the type of platform used for chip
2099 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC UINT32_C(0x0)
2100 /* FPGA platform of the chip. */
2101 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA UINT32_C(0x1)
2102 /* Palladium platform of the chip. */
2103 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
2104 uint16_t max_req_win_len;
2106 * This field returns the maximum value of request window that
2107 * is supported by the HWRM. The request window is mapped into
2108 * device address space using MMIO.
2110 uint16_t max_resp_len;
2111 /* This field returns the maximum value of response buffer in bytes. */
2112 uint16_t def_req_timeout;
2114 * This field returns the default request timeout value in
2122 * This field is used in Output records to indicate that the
2123 * output is completely written to RAM. This field should be
2124 * read as '1' to indicate that the output has been completely
2125 * written. When writing a command completion or response to an
2126 * internal processor, the order of writes has to be such that
2127 * this field is written last.
2129 } __attribute__((packed));
2131 /* hwrm_func_reset */
2133 * Description: This command resets a hardware function (PCIe function) and
2134 * frees any resources used by the function. This command shall be initiated by
2135 * the driver after an FLR has occurred to prepare the function for re-use. This
2136 * command may also be initiated by a driver prior to doing it's own
2137 * configuration. This command puts the function into the reset state. In the
2138 * reset state, global and port related features of the chip are not available.
2141 * Note: This command will reset a function that has already been disabled or
2142 * idled. The command returns all the resources owned by the function so a new
2143 * driver may allocate and configure resources normally.
2145 /* Input (24 bytes) */
2146 struct hwrm_func_reset_input {
2149 * This value indicates what type of request this is. The format
2150 * for the rest of the command is determined by this field.
2154 * This value indicates the what completion ring the request
2155 * will be optionally completed on. If the value is -1, then no
2156 * CR completion will be generated. Any other value must be a
2157 * valid CR ring_id value for this function.
2160 /* This value indicates the command sequence number. */
2163 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2164 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2169 * This is the host address where the response will be written
2170 * when the request is complete. This area must be 16B aligned
2171 * and must be cleared to zero before the request is made.
2174 /* This bit must be '1' for the vf_id_valid field to be configured. */
2175 #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
2178 * The ID of the VF that this PF is trying to reset. Only the
2179 * parent PF shall be allowed to reset a child VF. A parent PF
2180 * driver shall use this field only when a specific child VF is
2181 * requested to be reset.
2183 uint8_t func_reset_level;
2184 /* This value indicates the level of a function reset. */
2186 * Reset the caller function and its children
2187 * VFs (if any). If no children functions exist,
2188 * then reset the caller function only.
2190 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL UINT32_C(0x0)
2191 /* Reset the caller function only */
2192 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME UINT32_C(0x1)
2194 * Reset all children VFs of the caller function
2195 * driver if the caller is a PF driver. It is an
2196 * error to specify this level by a VF driver.
2197 * It is an error to specify this level by a PF
2198 * driver with no children VFs.
2200 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
2203 * Reset a specific VF of the caller function
2204 * driver if the caller is the parent PF driver.
2205 * It is an error to specify this level by a VF
2206 * driver. It is an error to specify this level
2207 * by a PF driver that is not the parent of the
2208 * VF that is being requested to reset.
2210 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF UINT32_C(0x3)
2212 } __attribute__((packed));
2214 /* Output (16 bytes) */
2215 struct hwrm_func_reset_output {
2216 uint16_t error_code;
2218 * Pass/Fail or error type Note: receiver to verify the in
2219 * parameters, and fail the call with an error when appropriate
2222 /* This field returns the type of original request. */
2224 /* This field provides original sequence number of the command. */
2227 * This field is the length of the response in bytes. The last
2228 * byte of the response is a valid flag that will read as '1'
2229 * when the command has been completely written to memory.
2237 * This field is used in Output records to indicate that the
2238 * output is completely written to RAM. This field should be
2239 * read as '1' to indicate that the output has been completely
2240 * written. When writing a command completion or response to an
2241 * internal processor, the order of writes has to be such that
2242 * this field is written last.
2244 } __attribute__((packed));
2246 /* hwrm_func_qcaps */
2248 * Description: This command returns capabilities of a function. The input FID
2249 * value is used to indicate what function is being queried. This allows a
2250 * physical function driver to query virtual functions that are children of the
2251 * physical function. The output FID value is needed to configure Rings and
2252 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
2254 /* Input (24 bytes) */
2255 struct hwrm_func_qcaps_input {
2258 * This value indicates what type of request this is. The format
2259 * for the rest of the command is determined by this field.
2263 * This value indicates the what completion ring the request
2264 * will be optionally completed on. If the value is -1, then no
2265 * CR completion will be generated. Any other value must be a
2266 * valid CR ring_id value for this function.
2269 /* This value indicates the command sequence number. */
2272 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2273 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2278 * This is the host address where the response will be written
2279 * when the request is complete. This area must be 16B aligned
2280 * and must be cleared to zero before the request is made.
2284 * Function ID of the function that is being queried. 0xFF...
2285 * (All Fs) if the query is for the requesting function.
2287 uint16_t unused_0[3];
2288 } __attribute__((packed));
2290 /* Output (80 bytes) */
2291 struct hwrm_func_qcaps_output {
2292 uint16_t error_code;
2294 * Pass/Fail or error type Note: receiver to verify the in
2295 * parameters, and fail the call with an error when appropriate
2298 /* This field returns the type of original request. */
2300 /* This field provides original sequence number of the command. */
2303 * This field is the length of the response in bytes. The last
2304 * byte of the response is a valid flag that will read as '1'
2305 * when the command has been completely written to memory.
2309 * FID value. This value is used to identify operations on the
2310 * PCI bus as belonging to a particular PCI function.
2314 * Port ID of port that this function is associated with. Valid
2315 * only for the PF. 0xFF... (All Fs) if this function is not
2316 * associated with any port. 0xFF... (All Fs) if this function
2317 * is called from a VF.
2320 /* If 1, then Push mode is supported on this function. */
2321 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
2323 * If 1, then the global MSI-X auto-masking is enabled for the
2326 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
2329 * If 1, then the Precision Time Protocol (PTP) processing is
2330 * supported on this function. The HWRM should enable PTP on
2331 * only a single Physical Function (PF) per port.
2333 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
2335 * If 1, then RDMA over Converged Ethernet (RoCE) v1 is
2336 * supported on this function.
2338 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED UINT32_C(0x8)
2340 * If 1, then RDMA over Converged Ethernet (RoCE) v2 is
2341 * supported on this function.
2343 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED UINT32_C(0x10)
2345 * If 1, then control and configuration of WoL magic packet are
2346 * supported on this function.
2348 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
2351 * If 1, then control and configuration of bitmap pattern packet
2352 * are supported on this function.
2354 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED UINT32_C(0x40)
2356 * If set to 1, then the control and configuration of rate limit
2357 * of an allocated TX ring on the queried function is supported.
2359 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED UINT32_C(0x80)
2361 * If 1, then control and configuration of minimum and maximum
2362 * bandwidths are supported on the queried function.
2364 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED UINT32_C(0x100)
2366 * If the query is for a VF, then this flag shall be ignored. If
2367 * this query is for a PF and this flag is set to 1, then the PF
2368 * has the capability to set the rate limits on the TX rings of
2369 * its children VFs. If this query is for a PF and this flag is
2370 * set to 0, then the PF does not have the capability to set the
2371 * rate limits on the TX rings of its children VFs.
2373 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
2376 * If the query is for a VF, then this flag shall be ignored. If
2377 * this query is for a PF and this flag is set to 1, then the PF
2378 * has the capability to set the minimum and/or maximum
2379 * bandwidths for its children VFs. If this query is for a PF
2380 * and this flag is set to 0, then the PF does not have the
2381 * capability to set the minimum or maximum bandwidths for its
2384 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED UINT32_C(0x400)
2386 * Standard TX Ring mode is used for the allocation of TX ring
2387 * and underlying scheduling resources that allow bandwidth
2388 * reservation and limit settings on the queried function. If
2389 * set to 1, then standard TX ring mode is supported on the
2390 * queried function. If set to 0, then standard TX ring mode is
2391 * not available on the queried function.
2393 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
2395 uint8_t mac_address[6];
2397 * This value is current MAC address configured for this
2398 * function. A value of 00-00-00-00-00-00 indicates no MAC
2399 * address is currently configured.
2401 uint16_t max_rsscos_ctx;
2403 * The maximum number of RSS/COS contexts that can be allocated
2406 uint16_t max_cmpl_rings;
2408 * The maximum number of completion rings that can be allocated
2411 uint16_t max_tx_rings;
2413 * The maximum number of transmit rings that can be allocated to
2416 uint16_t max_rx_rings;
2418 * The maximum number of receive rings that can be allocated to
2421 uint16_t max_l2_ctxs;
2423 * The maximum number of L2 contexts that can be allocated to
2428 * The maximum number of VNICs that can be allocated to the
2431 uint16_t first_vf_id;
2433 * The identifier for the first VF enabled on a PF. This is
2434 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2435 * this command is called on a PF with SR-IOV disabled or on a
2440 * The maximum number of VFs that can be allocated to the
2441 * function. This is valid only on the PF with SR-IOV enabled.
2442 * 0xFF... (All Fs) if this command is called on a PF with SR-
2443 * IOV disabled or on a VF.
2445 uint16_t max_stat_ctx;
2447 * The maximum number of statistic contexts that can be
2448 * allocated to the function.
2450 uint32_t max_encap_records;
2452 * The maximum number of Encapsulation records that can be
2453 * offloaded by this function.
2455 uint32_t max_decap_records;
2457 * The maximum number of decapsulation records that can be
2458 * offloaded by this function.
2460 uint32_t max_tx_em_flows;
2462 * The maximum number of Exact Match (EM) flows that can be
2463 * offloaded by this function on the TX side.
2465 uint32_t max_tx_wm_flows;
2467 * The maximum number of Wildcard Match (WM) flows that can be
2468 * offloaded by this function on the TX side.
2470 uint32_t max_rx_em_flows;
2472 * The maximum number of Exact Match (EM) flows that can be
2473 * offloaded by this function on the RX side.
2475 uint32_t max_rx_wm_flows;
2477 * The maximum number of Wildcard Match (WM) flows that can be
2478 * offloaded by this function on the RX side.
2480 uint32_t max_mcast_filters;
2482 * The maximum number of multicast filters that can be supported
2483 * by this function on the RX side.
2485 uint32_t max_flow_id;
2487 * The maximum value of flow_id that can be supported in
2488 * completion records.
2490 uint32_t max_hw_ring_grps;
2492 * The maximum number of HW ring groups that can be supported on
2495 uint16_t max_sp_tx_rings;
2497 * The maximum number of strict priority transmit rings that can
2498 * be allocated to the function. This number indicates the
2499 * maximum number of TX rings that can be assigned strict
2500 * priorities out of the maximum number of TX rings that can be
2501 * allocated (max_tx_rings) to the function.
2506 * This field is used in Output records to indicate that the
2507 * output is completely written to RAM. This field should be
2508 * read as '1' to indicate that the output has been completely
2509 * written. When writing a command completion or response to an
2510 * internal processor, the order of writes has to be such that
2511 * this field is written last.
2513 } __attribute__((packed));
2515 /* hwrm_func_qcfg */
2517 * Description: This command returns the current configuration of a function.
2518 * The input FID value is used to indicate what function is being queried. This
2519 * allows a physical function driver to query virtual functions that are
2520 * children of the physical function. The output FID value is needed to
2521 * configure Rings and MSI-X vectors so their DMA operations appear correctly on
2522 * the PCI bus. This command should be called by every driver after
2523 * 'hwrm_func_cfg' to get the actual number of resources allocated by the HWRM.
2524 * The values returned by hwrm_func_qcfg are the values the driver shall use.
2525 * These values may be different than what was originally requested in the
2526 * 'hwrm_func_cfg' command.
2528 /* Input (24 bytes) */
2529 struct hwrm_func_qcfg_input {
2532 * This value indicates what type of request this is. The format
2533 * for the rest of the command is determined by this field.
2537 * This value indicates the what completion ring the request
2538 * will be optionally completed on. If the value is -1, then no
2539 * CR completion will be generated. Any other value must be a
2540 * valid CR ring_id value for this function.
2543 /* This value indicates the command sequence number. */
2546 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2547 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2552 * This is the host address where the response will be written
2553 * when the request is complete. This area must be 16B aligned
2554 * and must be cleared to zero before the request is made.
2558 * Function ID of the function that is being queried. 0xFF...
2559 * (All Fs) if the query is for the requesting function.
2561 uint16_t unused_0[3];
2562 } __attribute__((packed));
2564 /* Output (72 bytes) */
2565 struct hwrm_func_qcfg_output {
2566 uint16_t error_code;
2568 * Pass/Fail or error type Note: receiver to verify the in
2569 * parameters, and fail the call with an error when appropriate
2572 /* This field returns the type of original request. */
2574 /* This field provides original sequence number of the command. */
2577 * This field is the length of the response in bytes. The last
2578 * byte of the response is a valid flag that will read as '1'
2579 * when the command has been completely written to memory.
2583 * FID value. This value is used to identify operations on the
2584 * PCI bus as belonging to a particular PCI function.
2588 * Port ID of port that this function is associated with.
2589 * 0xFF... (All Fs) if this function is not associated with any
2594 * This value is the current VLAN setting for this function. The
2595 * value of 0 for this field indicates no priority tagging or
2596 * VLAN is used. This field's format is same as 802.1Q Tag's Tag
2597 * Control Information (TCI) format that includes both Priority
2598 * Code Point (PCP) and VLAN Identifier (VID).
2602 * If 1, then magic packet based Out-Of-Box WoL is enabled on
2603 * the port associated with this function.
2605 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
2608 * If 1, then bitmap pattern based Out-Of-Box WoL packet is
2609 * enabled on the port associated with this function.
2611 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED UINT32_C(0x2)
2613 * If set to 1, then FW based DCBX agent is enabled and running
2614 * on the port associated with this function. If set to 0, then
2615 * DCBX agent is not running in the firmware.
2617 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
2620 * Standard TX Ring mode is used for the allocation of TX ring
2621 * and underlying scheduling resources that allow bandwidth
2622 * reservation and limit settings on the queried function. If
2623 * set to 1, then standard TX ring mode is enabled on the
2624 * queried function. If set to 0, then the standard TX ring mode
2625 * is disabled on the queried function. In this extended TX ring
2626 * resource mode, the minimum and maximum bandwidth settings are
2627 * not supported to allow the allocation of TX rings to span
2628 * multiple scheduler nodes.
2630 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
2633 * If set to 1 then FW based LLDP agent is enabled and running
2634 * on the port associated with this function. If set to 0 then
2635 * the LLDP agent is not running in the firmware.
2637 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED UINT32_C(0x10)
2639 * If set to 1, then multi-host mode is active for this
2640 * function. If set to 0, then multi-host mode is inactive for
2641 * this function or not applicable for this device.
2643 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST UINT32_C(0x20)
2644 uint8_t mac_address[6];
2646 * This value is current MAC address configured for this
2647 * function. A value of 00-00-00-00-00-00 indicates no MAC
2648 * address is currently configured.
2652 * This value is current PCI ID of this function. If ARI is
2653 * enabled, then it is Bus Number (8b):Function Number(8b).
2654 * Otherwise, it is Bus Number (8b):Device Number (4b):Function
2657 uint16_t alloc_rsscos_ctx;
2659 * The number of RSS/COS contexts currently allocated to the
2662 uint16_t alloc_cmpl_rings;
2664 * The number of completion rings currently allocated to the
2665 * function. This does not include the rings allocated to any
2666 * children functions if any.
2668 uint16_t alloc_tx_rings;
2670 * The number of transmit rings currently allocated to the
2671 * function. This does not include the rings allocated to any
2672 * children functions if any.
2674 uint16_t alloc_rx_rings;
2676 * The number of receive rings currently allocated to the
2677 * function. This does not include the rings allocated to any
2678 * children functions if any.
2680 uint16_t alloc_l2_ctx;
2681 /* The allocated number of L2 contexts to the function. */
2682 uint16_t alloc_vnics;
2683 /* The allocated number of vnics to the function. */
2686 * The maximum transmission unit of the function. For rings
2687 * allocated on this function, this default value is used if
2688 * ring MTU is not specified.
2692 * The maximum receive unit of the function. For vnics allocated
2693 * on this function, this default value is used if vnic MRU is
2696 uint16_t stat_ctx_id;
2697 /* The statistics context assigned to a function. */
2698 uint8_t port_partition_type;
2700 * The HWRM shall return Unknown value for this field when this
2701 * command is used to query VF's configuration.
2703 /* Single physical function */
2704 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF UINT32_C(0x0)
2705 /* Multiple physical functions */
2706 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS UINT32_C(0x1)
2707 /* Network Partitioning 1.0 */
2708 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
2709 /* Network Partitioning 1.5 */
2710 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
2711 /* Network Partitioning 2.0 */
2712 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
2714 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
2715 uint8_t port_pf_cnt;
2717 * This field will indicate number of physical functions on this
2718 * port_partition. HWRM shall return unavail (i.e. value of 0)
2719 * for this field when this command is used to query VF's
2720 * configuration or from older firmware that doesn't support
2723 /* number of PFs is not available */
2724 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
2725 uint16_t dflt_vnic_id;
2726 /* The default VNIC ID assigned to a function that is being queried. */
2731 * Minimum BW allocated for this function. The HWRM will
2732 * translate this value into byte counter and time interval used
2733 * for the scheduler inside the device. A value of 0 indicates
2734 * the minimum bandwidth is not configured.
2736 /* The bandwidth value. */
2737 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
2738 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT 0
2739 /* The granularity of the value (bits or bytes). */
2740 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE UINT32_C(0x10000000)
2741 /* Value is in bits. */
2742 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
2743 /* Value is in bytes. */
2744 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
2745 (UINT32_C(0x1) << 28)
2746 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
2747 FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
2748 /* bw_value_unit is 3 b */
2749 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
2750 UINT32_C(0xe0000000)
2751 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
2752 /* Value is in Mb or MB (base 10). */
2753 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
2754 (UINT32_C(0x0) << 29)
2755 /* Value is in Kb or KB (base 10). */
2756 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
2757 (UINT32_C(0x2) << 29)
2758 /* Value is in bits or bytes. */
2759 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
2760 (UINT32_C(0x4) << 29)
2761 /* Value is in Gb or GB (base 10). */
2762 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
2763 (UINT32_C(0x6) << 29)
2764 /* Value is in 1/100th of a percentage of total bandwidth. */
2765 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
2766 (UINT32_C(0x1) << 29)
2768 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
2769 (UINT32_C(0x7) << 29)
2770 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
2771 FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
2774 * Maximum BW allocated for this function. The HWRM will
2775 * translate this value into byte counter and time interval used
2776 * for the scheduler inside the device. A value of 0 indicates
2777 * that the maximum bandwidth is not configured.
2779 /* The bandwidth value. */
2780 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
2781 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT 0
2782 /* The granularity of the value (bits or bytes). */
2783 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE UINT32_C(0x10000000)
2784 /* Value is in bits. */
2785 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
2786 /* Value is in bytes. */
2787 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
2788 (UINT32_C(0x1) << 28)
2789 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
2790 FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
2791 /* bw_value_unit is 3 b */
2792 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
2793 UINT32_C(0xe0000000)
2794 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
2795 /* Value is in Mb or MB (base 10). */
2796 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
2797 (UINT32_C(0x0) << 29)
2798 /* Value is in Kb or KB (base 10). */
2799 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
2800 (UINT32_C(0x2) << 29)
2801 /* Value is in bits or bytes. */
2802 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
2803 (UINT32_C(0x4) << 29)
2804 /* Value is in Gb or GB (base 10). */
2805 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
2806 (UINT32_C(0x6) << 29)
2807 /* Value is in 1/100th of a percentage of total bandwidth. */
2808 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
2809 (UINT32_C(0x1) << 29)
2811 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
2812 (UINT32_C(0x7) << 29)
2813 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
2814 FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
2817 * This value indicates the Edge virtual bridge mode for the
2818 * domain that this function belongs to.
2820 /* No Edge Virtual Bridging (EVB) */
2821 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
2822 /* Virtual Ethernet Bridge (VEB) */
2823 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB UINT32_C(0x1)
2824 /* Virtual Ethernet Port Aggregator (VEPA) */
2825 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA UINT32_C(0x2)
2829 * The number of VFs that are allocated to the function. This is
2830 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2831 * this command is called on a PF with SR-IOV disabled or on a
2834 uint32_t alloc_mcast_filters;
2836 * The number of allocated multicast filters for this function
2839 uint32_t alloc_hw_ring_grps;
2840 /* The number of allocated HW ring groups for this function. */
2841 uint16_t alloc_sp_tx_rings;
2843 * The number of strict priority transmit rings out of currently
2844 * allocated TX rings to the function (alloc_tx_rings).
2849 * This field is used in Output records to indicate that the
2850 * output is completely written to RAM. This field should be
2851 * read as '1' to indicate that the output has been completely
2852 * written. When writing a command completion or response to an
2853 * internal processor, the order of writes has to be such that
2854 * this field is written last.
2856 } __attribute__((packed));
2858 /* hwrm_func_vlan_qcfg */
2860 * Description: This command should be called by PF driver to get the current
2861 * C-TAG, S-TAG and correcponsing PCP and TPID values configured for the
2864 /* Input (24 bytes) */
2865 struct hwrm_func_vlan_qcfg_input {
2868 * This value indicates what type of request this is. The format
2869 * for the rest of the command is determined by this field.
2873 * This value indicates the what completion ring the request
2874 * will be optionally completed on. If the value is -1, then no
2875 * CR completion will be generated. Any other value must be a
2876 * valid CR ring_id value for this function.
2879 /* This value indicates the command sequence number. */
2882 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2883 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2888 * This is the host address where the response will be written
2889 * when the request is complete. This area must be 16B aligned
2890 * and must be cleared to zero before the request is made.
2894 * Function ID of the function that is being configured. If set
2895 * to 0xFF... (All Fs), then the configuration is for the
2896 * requesting function.
2898 uint16_t unused_0[3];
2901 /* Output (40 bytes) */
2902 struct hwrm_func_vlan_qcfg_output {
2903 uint16_t error_code;
2905 * Pass/Fail or error type Note: receiver to verify the in
2906 * parameters, and fail the call with an error when appropriate
2909 /* This field returns the type of original request. */
2911 /* This field provides original sequence number of the command. */
2914 * This field is the length of the response in bytes. The last
2915 * byte of the response is a valid flag that will read as '1'
2916 * when the command has been completely written to memory.
2924 * This field is used in Output records to indicate that the
2925 * output is completely written to RAM. This field should be
2926 * read as '1' to indicate that the output has been completely
2927 * written. When writing a command completion or response to an
2928 * internal processor, the order of writes has to be such that
2929 * this field is written last.
2932 /* S-TAG VLAN identifier configured for the function. */
2934 /* S-TAG PCP value configured for the function. */
2938 * S-TAG TPID value configured for the function. This field is
2939 * specified in network byte order.
2942 /* C-TAG VLAN identifier configured for the function. */
2944 /* C-TAG PCP value configured for the function. */
2948 * C-TAG TPID value configured for the function. This field is
2949 * specified in network byte order.
2958 /* hwrm_func_vlan_cfg */
2960 * Description: This command allows PF driver to configure C-TAG, S-TAG and
2961 * corresponding PCP and TPID values for a function.
2963 /* Input (48 bytes) */
2964 struct hwrm_func_vlan_cfg_input {
2967 * This value indicates what type of request this is. The format
2968 * for the rest of the command is determined by this field.
2972 * This value indicates the what completion ring the request
2973 * will be optionally completed on. If the value is -1, then no
2974 * CR completion will be generated. Any other value must be a
2975 * valid CR ring_id value for this function.
2978 /* This value indicates the command sequence number. */
2981 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2982 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2987 * This is the host address where the response will be written
2988 * when the request is complete. This area must be 16B aligned
2989 * and must be cleared to zero before the request is made.
2993 * Function ID of the function that is being configured. If set
2994 * to 0xFF... (All Fs), then the configuration is for the
2995 * requesting function.
3000 /* This bit must be '1' for the stag_vid field to be configured. */
3001 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID UINT32_C(0x1)
3002 /* This bit must be '1' for the ctag_vid field to be configured. */
3003 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID UINT32_C(0x2)
3004 /* This bit must be '1' for the stag_pcp field to be configured. */
3005 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP UINT32_C(0x4)
3006 /* This bit must be '1' for the ctag_pcp field to be configured. */
3007 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP UINT32_C(0x8)
3008 /* This bit must be '1' for the stag_tpid field to be configured. */
3009 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID UINT32_C(0x10)
3010 /* This bit must be '1' for the ctag_tpid field to be configured. */
3011 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID UINT32_C(0x20)
3013 /* S-TAG VLAN identifier configured for the function. */
3015 /* S-TAG PCP value configured for the function. */
3019 * S-TAG TPID value configured for the function. This field is
3020 * specified in network byte order.
3023 /* C-TAG VLAN identifier configured for the function. */
3025 /* C-TAG PCP value configured for the function. */
3029 * C-TAG TPID value configured for the function. This field is
3030 * specified in network byte order.
3039 /* Output (16 bytes) */
3040 struct hwrm_func_vlan_cfg_output {
3041 uint16_t error_code;
3043 * Pass/Fail or error type Note: receiver to verify the in
3044 * parameters, and fail the call with an error when appropriate
3047 /* This field returns the type of original request. */
3049 /* This field provides original sequence number of the command. */
3052 * This field is the length of the response in bytes. The last
3053 * byte of the response is a valid flag that will read as '1'
3054 * when the command has been completely written to memory.
3062 * This field is used in Output records to indicate that the
3063 * output is completely written to RAM. This field should be
3064 * read as '1' to indicate that the output has been completely
3065 * written. When writing a command completion or response to an
3066 * internal processor, the order of writes has to be such that
3067 * this field is written last.
3073 * Description: This command allows configuration of a PF by the corresponding
3074 * PF driver. This command also allows configuration of a child VF by its parent
3075 * PF driver. The input FID value is used to indicate what function is being
3076 * configured. This allows a PF driver to configure the PF owned by itself or a
3077 * virtual function that is a child of the PF. This command allows to reserve
3078 * resources for a VF by its parent PF. To reverse the process, the command
3079 * should be called with all enables flags cleared for resources. This will free
3080 * allocated resources for the VF and return them to the resource pool. If this
3081 * command is requested by a VF driver to configure or reserve resources, then
3082 * the HWRM shall fail this command. If default MAC address and/or VLAN are
3083 * provided in this command, then the HWRM shall set up appropriate MAC/VLAN
3084 * filters for the function that is being configured. If source properties
3085 * checks are enabled and default MAC address and/or IP address are provided in
3086 * this command, then the HWRM shall set appropriate source property checks
3087 * based on provided MAC and/or IP addresses. The parent PF driver should not
3088 * set MTU/MRU for a VF using this command. This is to allow MTU/MRU setting by
3089 * the VF driver. If the MTU or MRU for a VF is set by the PF driver, then the
3090 * HWRM should ignore it. A function's MTU/MRU should be set prior to allocating
3091 * RX VNICs or TX rings. A PF driver calls hwrm_func_cfg to allocate resources
3092 * for itself or its children VFs. All function drivers shall call hwrm_func_cfg
3093 * to reserve resources. A request to hwrm_func_cfg may not be fully granted;
3094 * that is, a request for resources may be larger than what can be supported by
3095 * the device and the HWRM will allocate the best set of resources available,
3096 * but that may be less than requested. If all the amounts requested could not
3097 * be fulfilled, the HWRM shall allocate what it could and return a status code
3098 * of success. A function driver should call hwrm_func_qcfg immediately after
3099 * hwrm_func_cfg to determine what resources were assigned to the configured
3100 * function. A call by a PF driver to hwrm_func_cfg to allocate resources for
3101 * itself shall only allocate resources for the PF driver to use, not for its
3102 * children VFs. Likewise, a call to hwrm_func_qcfg shall return the resources
3103 * available for the PF driver to use, not what is available to its children
3106 /* Input (88 bytes) */
3107 struct hwrm_func_cfg_input {
3110 * This value indicates what type of request this is. The format
3111 * for the rest of the command is determined by this field.
3115 * This value indicates the what completion ring the request
3116 * will be optionally completed on. If the value is -1, then no
3117 * CR completion will be generated. Any other value must be a
3118 * valid CR ring_id value for this function.
3121 /* This value indicates the command sequence number. */
3124 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3125 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3130 * This is the host address where the response will be written
3131 * when the request is complete. This area must be 16B aligned
3132 * and must be cleared to zero before the request is made.
3136 * Function ID of the function that is being configured. If set
3137 * to 0xFF... (All Fs), then the the configuration is for the
3138 * requesting function.
3144 * When this bit is '1', the function is disabled with source
3145 * MAC address check. This is an anti-spoofing check. If this
3146 * flag is set, then the function shall be configured to
3147 * disallow transmission of frames with the source MAC address
3148 * that is configured for this function.
3150 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
3153 * When this bit is '1', the function is enabled with source MAC
3154 * address check. This is an anti-spoofing check. If this flag
3155 * is set, then the function shall be configured to allow
3156 * transmission of frames with the source MAC address that is
3157 * configured for this function.
3159 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
3162 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK UINT32_C(0x1fc)
3163 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT 2
3165 * Standard TX Ring mode is used for the allocation of TX ring
3166 * and underlying scheduling resources that allow bandwidth
3167 * reservation and limit settings on the queried function. If
3168 * set to 1, then standard TX ring mode is requested to be
3169 * enabled on the function being configured.
3171 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
3174 * Standard TX Ring mode is used for the allocation of TX ring
3175 * and underlying scheduling resources that allow bandwidth
3176 * reservation and limit settings on the queried function. If
3177 * set to 1, then the standard TX ring mode is requested to be
3178 * disabled on the function being configured. In this extended
3179 * TX ring resource mode, the minimum and maximum bandwidth
3180 * settings are not supported to allow the allocation of TX
3181 * rings to span multiple scheduler nodes.
3183 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
3186 * If this bit is set, virtual mac address configured in this
3187 * command will be persistent over warm boot.
3189 #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST UINT32_C(0x800)
3191 /* This bit must be '1' for the mtu field to be configured. */
3192 #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
3193 /* This bit must be '1' for the mru field to be configured. */
3194 #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU UINT32_C(0x2)
3196 * This bit must be '1' for the num_rsscos_ctxs field to be
3199 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS UINT32_C(0x4)
3201 * This bit must be '1' for the num_cmpl_rings field to be
3204 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS UINT32_C(0x8)
3205 /* This bit must be '1' for the num_tx_rings field to be configured. */
3206 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS UINT32_C(0x10)
3207 /* This bit must be '1' for the num_rx_rings field to be configured. */
3208 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS UINT32_C(0x20)
3209 /* This bit must be '1' for the num_l2_ctxs field to be configured. */
3210 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS UINT32_C(0x40)
3211 /* This bit must be '1' for the num_vnics field to be configured. */
3212 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS UINT32_C(0x80)
3214 * This bit must be '1' for the num_stat_ctxs field to be
3217 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS UINT32_C(0x100)
3219 * This bit must be '1' for the dflt_mac_addr field to be
3222 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x200)
3223 /* This bit must be '1' for the dflt_vlan field to be configured. */
3224 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN UINT32_C(0x400)
3225 /* This bit must be '1' for the dflt_ip_addr field to be configured. */
3226 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR UINT32_C(0x800)
3227 /* This bit must be '1' for the min_bw field to be configured. */
3228 #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW UINT32_C(0x1000)
3229 /* This bit must be '1' for the max_bw field to be configured. */
3230 #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW UINT32_C(0x2000)
3232 * This bit must be '1' for the async_event_cr field to be
3235 #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4000)
3237 * This bit must be '1' for the vlan_antispoof_mode field to be
3240 #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE UINT32_C(0x8000)
3242 * This bit must be '1' for the allowed_vlan_pris field to be
3245 #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS UINT32_C(0x10000)
3246 /* This bit must be '1' for the evb_mode field to be configured. */
3247 #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE UINT32_C(0x20000)
3249 * This bit must be '1' for the num_mcast_filters field to be
3252 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS UINT32_C(0x40000)
3254 * This bit must be '1' for the num_hw_ring_grps field to be
3257 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS UINT32_C(0x80000)
3260 * The maximum transmission unit of the function. The HWRM
3261 * should make sure that the mtu of the function does not exceed
3262 * the mtu of the physical port that this function is associated
3263 * with. In addition to configuring mtu per function, it is
3264 * possible to configure mtu per transmit ring. By default, the
3265 * mtu of each transmit ring associated with a function is equal
3266 * to the mtu of the function. The HWRM should make sure that
3267 * the mtu of each transmit ring that is assigned to a function
3272 * The maximum receive unit of the function. The HWRM should
3273 * make sure that the mru of the function does not exceed the
3274 * mru of the physical port that this function is associated
3275 * with. In addition to configuring mru per function, it is
3276 * possible to configure mru per vnic. By default, the mru of
3277 * each vnic associated with a function is equal to the mru of
3278 * the function. The HWRM should make sure that the mru of each
3279 * vnic that is assigned to a function has a valid mru.
3281 uint16_t num_rsscos_ctxs;
3282 /* The number of RSS/COS contexts requested for the function. */
3283 uint16_t num_cmpl_rings;
3285 * The number of completion rings requested for the function.
3286 * This does not include the rings allocated to any children
3289 uint16_t num_tx_rings;
3291 * The number of transmit rings requested for the function. This
3292 * does not include the rings allocated to any children
3295 uint16_t num_rx_rings;
3297 * The number of receive rings requested for the function. This
3298 * does not include the rings allocated to any children
3301 uint16_t num_l2_ctxs;
3302 /* The requested number of L2 contexts for the function. */
3304 /* The requested number of vnics for the function. */
3305 uint16_t num_stat_ctxs;
3306 /* The requested number of statistic contexts for the function. */
3307 uint16_t num_hw_ring_grps;
3309 * The number of HW ring groups that should be reserved for this
3312 uint8_t dflt_mac_addr[6];
3313 /* The default MAC address for the function being configured. */
3316 * The default VLAN for the function being configured. This
3317 * field's format is same as 802.1Q Tag's Tag Control
3318 * Information (TCI) format that includes both Priority Code
3319 * Point (PCP) and VLAN Identifier (VID).
3321 uint32_t dflt_ip_addr[4];
3323 * The default IP address for the function being configured.
3324 * This address is only used in enabling source property check.
3328 * Minimum BW allocated for this function. The HWRM will
3329 * translate this value into byte counter and time interval used
3330 * for the scheduler inside the device.
3332 /* The bandwidth value. */
3333 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
3334 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT 0
3335 /* The granularity of the value (bits or bytes). */
3336 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE UINT32_C(0x10000000)
3337 /* Value is in bits. */
3338 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
3339 /* Value is in bytes. */
3340 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
3341 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
3342 FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
3343 /* bw_value_unit is 3 b */
3344 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
3345 UINT32_C(0xe0000000)
3346 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
3347 /* Value is in Mb or MB (base 10). */
3348 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
3349 (UINT32_C(0x0) << 29)
3350 /* Value is in Kb or KB (base 10). */
3351 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
3352 (UINT32_C(0x2) << 29)
3353 /* Value is in bits or bytes. */
3354 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
3355 (UINT32_C(0x4) << 29)
3356 /* Value is in Gb or GB (base 10). */
3357 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
3358 (UINT32_C(0x6) << 29)
3359 /* Value is in 1/100th of a percentage of total bandwidth. */
3360 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
3361 (UINT32_C(0x1) << 29)
3363 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
3364 (UINT32_C(0x7) << 29)
3365 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
3366 FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
3369 * Maximum BW allocated for this function. The HWRM will
3370 * translate this value into byte counter and time interval used
3371 * for the scheduler inside the device.
3373 /* The bandwidth value. */
3374 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
3376 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT 0
3377 /* The granularity of the value (bits or bytes). */
3378 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
3379 /* Value is in bits. */
3380 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
3381 /* Value is in bytes. */
3382 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
3383 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
3384 FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
3385 /* bw_value_unit is 3 b */
3386 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
3387 UINT32_C(0xe0000000)
3388 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
3389 /* Value is in Mb or MB (base 10). */
3390 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
3391 (UINT32_C(0x0) << 29)
3392 /* Value is in Kb or KB (base 10). */
3393 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
3394 (UINT32_C(0x2) << 29)
3395 /* Value is in bits or bytes. */
3396 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
3397 (UINT32_C(0x4) << 29)
3398 /* Value is in Gb or GB (base 10). */
3399 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
3400 (UINT32_C(0x6) << 29)
3401 /* Value is in 1/100th of a percentage of total bandwidth. */
3402 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
3403 (UINT32_C(0x1) << 29)
3405 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
3406 (UINT32_C(0x7) << 29)
3407 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
3408 FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
3409 uint16_t async_event_cr;
3411 * ID of the target completion ring for receiving asynchronous
3412 * event completions. If this field is not valid, then the HWRM
3413 * shall use the default completion ring of the function that is
3414 * being configured as the target completion ring for providing
3415 * any asynchronous event completions for that function. If this
3416 * field is valid, then the HWRM shall use the completion ring
3417 * identified by this ID as the target completion ring for
3418 * providing any asynchronous event completions for the function
3419 * that is being configured.
3421 uint8_t vlan_antispoof_mode;
3422 /* VLAN Anti-spoofing mode. */
3423 /* No VLAN anti-spoofing checks are enabled */
3424 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK UINT32_C(0x0)
3425 /* Validate VLAN against the configured VLAN(s) */
3426 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
3428 /* Insert VLAN if it does not exist, otherwise discard */
3429 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
3432 * Insert VLAN if it does not exist, override
3436 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
3438 uint8_t allowed_vlan_pris;
3440 * This bit field defines VLAN PRIs that are allowed on this
3441 * function. If nth bit is set, then VLAN PRI n is allowed on
3446 * The HWRM shall allow a PF driver to change EVB mode for the
3447 * partition it belongs to. The HWRM shall not allow a VF driver
3448 * to change the EVB mode. The HWRM shall take into account the
3449 * switching of EVB mode from one to another and reconfigure
3450 * hardware resources as appropriately. The switching from VEB
3451 * to VEPA mode requires the disabling of the loopback traffic.
3452 * Additionally, source knock outs are handled differently in
3453 * VEB and VEPA modes.
3455 /* No Edge Virtual Bridging (EVB) */
3456 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
3457 /* Virtual Ethernet Bridge (VEB) */
3458 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB UINT32_C(0x1)
3459 /* Virtual Ethernet Port Aggregator (VEPA) */
3460 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA UINT32_C(0x2)
3462 uint16_t num_mcast_filters;
3464 * The number of multicast filters that should be reserved for
3465 * this function on the RX side.
3467 } __attribute__((packed));
3469 /* Output (16 bytes) */
3470 struct hwrm_func_cfg_output {
3471 uint16_t error_code;
3473 * Pass/Fail or error type Note: receiver to verify the in
3474 * parameters, and fail the call with an error when appropriate
3477 /* This field returns the type of original request. */
3479 /* This field provides original sequence number of the command. */
3482 * This field is the length of the response in bytes. The last
3483 * byte of the response is a valid flag that will read as '1'
3484 * when the command has been completely written to memory.
3492 * This field is used in Output records to indicate that the
3493 * output is completely written to RAM. This field should be
3494 * read as '1' to indicate that the output has been completely
3495 * written. When writing a command completion or response to an
3496 * internal processor, the order of writes has to be such that
3497 * this field is written last.
3499 } __attribute__((packed));
3501 /* hwrm_func_qstats */
3503 * Description: This command returns statistics of a function. The input FID
3504 * value is used to indicate what function is being queried. This allows a
3505 * physical function driver to query virtual functions that are children of the
3506 * physical function. The HWRM shall return any unsupported counter with a value
3507 * of 0xFFFFFFFF for 32-bit counters and 0xFFFFFFFFFFFFFFFF for 64-bit counters.
3509 /* Input (24 bytes) */
3510 struct hwrm_func_qstats_input {
3513 * This value indicates what type of request this is. The format
3514 * for the rest of the command is determined by this field.
3518 * This value indicates the what completion ring the request
3519 * will be optionally completed on. If the value is -1, then no
3520 * CR completion will be generated. Any other value must be a
3521 * valid CR ring_id value for this function.
3524 /* This value indicates the command sequence number. */
3527 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3528 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3533 * This is the host address where the response will be written
3534 * when the request is complete. This area must be 16B aligned
3535 * and must be cleared to zero before the request is made.
3539 * Function ID of the function that is being queried. 0xFF...
3540 * (All Fs) if the query is for the requesting function.
3542 uint16_t unused_0[3];
3543 } __attribute__((packed));
3545 /* Output (176 bytes) */
3546 struct hwrm_func_qstats_output {
3547 uint16_t error_code;
3549 * Pass/Fail or error type Note: receiver to verify the in
3550 * parameters, and fail the call with an error when appropriate
3553 /* This field returns the type of original request. */
3555 /* This field provides original sequence number of the command. */
3558 * This field is the length of the response in bytes. The last
3559 * byte of the response is a valid flag that will read as '1'
3560 * when the command has been completely written to memory.
3562 uint64_t tx_ucast_pkts;
3563 /* Number of transmitted unicast packets on the function. */
3564 uint64_t tx_mcast_pkts;
3565 /* Number of transmitted multicast packets on the function. */
3566 uint64_t tx_bcast_pkts;
3567 /* Number of transmitted broadcast packets on the function. */
3568 uint64_t tx_err_pkts;
3570 * Number of transmitted packets that were discarded due to
3571 * internal NIC resource problems. For transmit, this can only
3572 * happen if TMP is configured to allow dropping in HOL blocking
3573 * conditions, which is not a normal configuration.
3575 uint64_t tx_drop_pkts;
3577 * Number of dropped packets on transmit path on the function.
3578 * These are packets that have been marked for drop by the TE
3579 * CFA block or are packets that exceeded the transmit MTU limit
3582 uint64_t tx_ucast_bytes;
3583 /* Number of transmitted bytes for unicast traffic on the function. */
3584 uint64_t tx_mcast_bytes;
3586 * Number of transmitted bytes for multicast traffic on the
3589 uint64_t tx_bcast_bytes;
3591 * Number of transmitted bytes for broadcast traffic on the
3594 uint64_t rx_ucast_pkts;
3595 /* Number of received unicast packets on the function. */
3596 uint64_t rx_mcast_pkts;
3597 /* Number of received multicast packets on the function. */
3598 uint64_t rx_bcast_pkts;
3599 /* Number of received broadcast packets on the function. */
3600 uint64_t rx_err_pkts;
3602 * Number of received packets that were discarded on the
3603 * function due to resource limitations. This can happen for 3
3604 * reasons. # The BD used for the packet has a bad format. #
3605 * There were no BDs available in the ring for the packet. #
3606 * There were no BDs available on-chip for the packet.
3608 uint64_t rx_drop_pkts;
3610 * Number of dropped packets on received path on the function.
3611 * These are packets that have been marked for drop by the RE
3614 uint64_t rx_ucast_bytes;
3615 /* Number of received bytes for unicast traffic on the function. */
3616 uint64_t rx_mcast_bytes;
3617 /* Number of received bytes for multicast traffic on the function. */
3618 uint64_t rx_bcast_bytes;
3619 /* Number of received bytes for broadcast traffic on the function. */
3620 uint64_t rx_agg_pkts;
3621 /* Number of aggregated unicast packets on the function. */
3622 uint64_t rx_agg_bytes;
3623 /* Number of aggregated unicast bytes on the function. */
3624 uint64_t rx_agg_events;
3625 /* Number of aggregation events on the function. */
3626 uint64_t rx_agg_aborts;
3627 /* Number of aborted aggregations on the function. */
3634 * This field is used in Output records to indicate that the
3635 * output is completely written to RAM. This field should be
3636 * read as '1' to indicate that the output has been completely
3637 * written. When writing a command completion or response to an
3638 * internal processor, the order of writes has to be such that
3639 * this field is written last.
3641 } __attribute__((packed));
3643 /* hwrm_func_clr_stats */
3645 * Description: This command clears statistics of a function. The input FID
3646 * value is used to indicate what function's statistics is being cleared. This
3647 * allows a physical function driver to clear statistics of virtual functions
3648 * that are children of the physical function.
3650 /* Input (24 bytes) */
3651 struct hwrm_func_clr_stats_input {
3654 * This value indicates what type of request this is. The format
3655 * for the rest of the command is determined by this field.
3659 * This value indicates the what completion ring the request
3660 * will be optionally completed on. If the value is -1, then no
3661 * CR completion will be generated. Any other value must be a
3662 * valid CR ring_id value for this function.
3665 /* This value indicates the command sequence number. */
3668 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3669 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3674 * This is the host address where the response will be written
3675 * when the request is complete. This area must be 16B aligned
3676 * and must be cleared to zero before the request is made.
3680 * Function ID of the function. 0xFF... (All Fs) if the query is
3681 * for the requesting function.
3683 uint16_t unused_0[3];
3684 } __attribute__((packed));
3686 /* Output (16 bytes) */
3687 struct hwrm_func_clr_stats_output {
3688 uint16_t error_code;
3690 * Pass/Fail or error type Note: receiver to verify the in
3691 * parameters, and fail the call with an error when appropriate
3694 /* This field returns the type of original request. */
3696 /* This field provides original sequence number of the command. */
3699 * This field is the length of the response in bytes. The last
3700 * byte of the response is a valid flag that will read as '1'
3701 * when the command has been completely written to memory.
3709 * This field is used in Output records to indicate that the
3710 * output is completely written to RAM. This field should be
3711 * read as '1' to indicate that the output has been completely
3712 * written. When writing a command completion or response to an
3713 * internal processor, the order of writes has to be such that
3714 * this field is written last.
3716 } __attribute__((packed));
3718 /* hwrm_func_vf_vnic_ids_query */
3719 /* Description: This command is used to query vf vnic ids. */
3720 /* Input (32 bytes) */
3721 struct hwrm_func_vf_vnic_ids_query_input {
3724 * This value indicates what type of request this is. The format
3725 * for the rest of the command is determined by this field.
3729 * This value indicates the what completion ring the request
3730 * will be optionally completed on. If the value is -1, then no
3731 * CR completion will be generated. Any other value must be a
3732 * valid CR ring_id value for this function.
3735 /* This value indicates the command sequence number. */
3738 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3739 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3744 * This is the host address where the response will be written
3745 * when the request is complete. This area must be 16B aligned
3746 * and must be cleared to zero before the request is made.
3750 * This value is used to identify a Virtual Function (VF). The
3751 * scope of VF ID is local within a PF.
3755 uint32_t max_vnic_id_cnt;
3756 /* Max number of vnic ids in vnic id table */
3757 uint64_t vnic_id_tbl_addr;
3758 /* This is the address for VF VNIC ID table */
3759 } __attribute__((packed));
3761 /* Output (16 bytes) */
3762 struct hwrm_func_vf_vnic_ids_query_output {
3763 uint16_t error_code;
3765 * Pass/Fail or error type Note: receiver to verify the in
3766 * parameters, and fail the call with an error when appropriate
3769 /* This field returns the type of original request. */
3771 /* This field provides original sequence number of the command. */
3774 * This field is the length of the response in bytes. The last
3775 * byte of the response is a valid flag that will read as '1'
3776 * when the command has been completely written to memory.
3778 uint32_t vnic_id_cnt;
3780 * Actual number of vnic ids Each VNIC ID is written as a 32-bit
3788 * This field is used in Output records to indicate that the
3789 * output is completely written to RAM. This field should be
3790 * read as '1' to indicate that the output has been completely
3791 * written. When writing a command completion or response to an
3792 * internal processor, the order of writes has to be such that
3793 * this field is written last.
3795 } __attribute__((packed));
3797 /* hwrm_func_drv_rgtr */
3799 * Description: This command is used by the function driver to register its
3800 * information with the HWRM. A function driver shall implement this command. A
3801 * function driver shall use this command during the driver initialization right
3802 * after the HWRM version discovery and default ring resources allocation.
3804 /* Input (80 bytes) */
3805 struct hwrm_func_drv_rgtr_input {
3808 * This value indicates what type of request this is. The format
3809 * for the rest of the command is determined by this field.
3813 * This value indicates the what completion ring the request
3814 * will be optionally completed on. If the value is -1, then no
3815 * CR completion will be generated. Any other value must be a
3816 * valid CR ring_id value for this function.
3819 /* This value indicates the command sequence number. */
3822 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3823 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3828 * This is the host address where the response will be written
3829 * when the request is complete. This area must be 16B aligned
3830 * and must be cleared to zero before the request is made.
3834 * When this bit is '1', the function driver is requesting all
3835 * requests from its children VF drivers to be forwarded to
3836 * itself. This flag can only be set by the PF driver. If a VF
3837 * driver sets this flag, it should be ignored by the HWRM.
3839 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
3841 * When this bit is '1', the function is requesting none of the
3842 * requests from its children VF drivers to be forwarded to
3843 * itself. This flag can only be set by the PF driver. If a VF
3844 * driver sets this flag, it should be ignored by the HWRM.
3846 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
3848 /* This bit must be '1' for the os_type field to be configured. */
3849 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
3850 /* This bit must be '1' for the ver field to be configured. */
3851 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
3852 /* This bit must be '1' for the timestamp field to be configured. */
3853 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
3854 /* This bit must be '1' for the vf_req_fwd field to be configured. */
3855 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_INPUT_FWD UINT32_C(0x8)
3857 * This bit must be '1' for the async_event_fwd field to be
3860 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD UINT32_C(0x10)
3863 * This value indicates the type of OS. The values are based on
3864 * CIM_OperatingSystem.mof file as published by the DMTF.
3867 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN UINT32_C(0x0)
3868 /* Other OS not listed below. */
3869 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER UINT32_C(0x1)
3871 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS UINT32_C(0xe)
3873 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS UINT32_C(0x12)
3875 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS UINT32_C(0x1d)
3877 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX UINT32_C(0x24)
3879 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD UINT32_C(0x2a)
3880 /* VMware ESXi OS. */
3881 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI UINT32_C(0x68)
3882 /* Microsoft Windows 8 64-bit OS. */
3883 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 UINT32_C(0x73)
3884 /* Microsoft Windows Server 2012 R2 OS. */
3885 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
3887 /* This is the major version of the driver. */
3889 /* This is the minor version of the driver. */
3891 /* This is the update version of the driver. */
3896 * This is a 32-bit timestamp provided by the driver for keep
3897 * alive. The timestamp is in multiples of 1ms.
3900 uint32_t vf_req_fwd[8];
3902 * This is a 256-bit bit mask provided by the PF driver for
3903 * letting the HWRM know what commands issued by the VF driver
3904 * to the HWRM should be forwarded to the PF driver. Nth bit
3905 * refers to the Nth req_type. Setting Nth bit to 1 indicates
3906 * that requests from the VF driver with req_type equal to N
3907 * shall be forwarded to the parent PF driver. This field is not
3908 * valid for the VF driver.
3910 uint32_t async_event_fwd[8];
3912 * This is a 256-bit bit mask provided by the function driver
3913 * (PF or VF driver) to indicate the list of asynchronous event
3914 * completions to be forwarded. Nth bit refers to the Nth
3915 * event_id. Setting Nth bit to 1 by the function driver shall
3916 * result in the HWRM forwarding asynchronous event completion
3917 * with event_id equal to N. If all bits are set to 0 (value of
3918 * 0), then the HWRM shall not forward any asynchronous event
3919 * completion to this function driver.
3921 } __attribute__((packed));
3923 /* Output (16 bytes) */
3924 struct hwrm_func_drv_rgtr_output {
3925 uint16_t error_code;
3927 * Pass/Fail or error type Note: receiver to verify the in
3928 * parameters, and fail the call with an error when appropriate
3931 /* This field returns the type of original request. */
3933 /* This field provides original sequence number of the command. */
3936 * This field is the length of the response in bytes. The last
3937 * byte of the response is a valid flag that will read as '1'
3938 * when the command has been completely written to memory.
3946 * This field is used in Output records to indicate that the
3947 * output is completely written to RAM. This field should be
3948 * read as '1' to indicate that the output has been completely
3949 * written. When writing a command completion or response to an
3950 * internal processor, the order of writes has to be such that
3951 * this field is written last.
3953 } __attribute__((packed));
3955 /* hwrm_func_drv_unrgtr */
3957 * Description: This command is used by the function driver to un register with
3958 * the HWRM. A function driver shall implement this command. A function driver
3959 * shall use this command during the driver unloading.
3961 /* Input (24 bytes) */
3962 struct hwrm_func_drv_unrgtr_input {
3965 * This value indicates what type of request this is. The format
3966 * for the rest of the command is determined by this field.
3970 * This value indicates the what completion ring the request
3971 * will be optionally completed on. If the value is -1, then no
3972 * CR completion will be generated. Any other value must be a
3973 * valid CR ring_id value for this function.
3976 /* This value indicates the command sequence number. */
3979 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3980 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3985 * This is the host address where the response will be written
3986 * when the request is complete. This area must be 16B aligned
3987 * and must be cleared to zero before the request is made.
3991 * When this bit is '1', the function driver is notifying the
3992 * HWRM to prepare for the shutdown.
3994 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
3997 } __attribute__((packed));
3999 /* Output (16 bytes) */
4000 struct hwrm_func_drv_unrgtr_output {
4001 uint16_t error_code;
4003 * Pass/Fail or error type Note: receiver to verify the in
4004 * parameters, and fail the call with an error when appropriate
4007 /* This field returns the type of original request. */
4009 /* This field provides original sequence number of the command. */
4012 * This field is the length of the response in bytes. The last
4013 * byte of the response is a valid flag that will read as '1'
4014 * when the command has been completely written to memory.
4022 * This field is used in Output records to indicate that the
4023 * output is completely written to RAM. This field should be
4024 * read as '1' to indicate that the output has been completely
4025 * written. When writing a command completion or response to an
4026 * internal processor, the order of writes has to be such that
4027 * this field is written last.
4029 } __attribute__((packed));
4031 /* hwrm_func_buf_rgtr */
4033 * Description: This command is used by the PF driver to register buffers used
4034 * in the PF-VF communication with the HWRM. The PF driver uses this command to
4035 * register buffers for each PF-VF channel. A parent PF may issue this command
4036 * per child VF. If VF ID is not valid, then this command is used to register
4037 * buffers for all children VFs of the PF.
4039 /* Input (128 bytes) */
4040 struct hwrm_func_buf_rgtr_input {
4043 * This value indicates what type of request this is. The format
4044 * for the rest of the command is determined by this field.
4048 * This value indicates the what completion ring the request
4049 * will be optionally completed on. If the value is -1, then no
4050 * CR completion will be generated. Any other value must be a
4051 * valid CR ring_id value for this function.
4054 /* This value indicates the command sequence number. */
4057 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4058 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4063 * This is the host address where the response will be written
4064 * when the request is complete. This area must be 16B aligned
4065 * and must be cleared to zero before the request is made.
4068 /* This bit must be '1' for the vf_id field to be configured. */
4069 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
4070 /* This bit must be '1' for the err_buf_addr field to be configured. */
4071 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR UINT32_C(0x2)
4074 * This value is used to identify a Virtual Function (VF). The
4075 * scope of VF ID is local within a PF.
4077 uint16_t req_buf_num_pages;
4079 * This field represents the number of pages used for request
4082 uint16_t req_buf_page_size;
4083 /* This field represents the page size used for request buffer(s). */
4085 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_16B UINT32_C(0x4)
4087 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_4K UINT32_C(0xc)
4089 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_8K UINT32_C(0xd)
4091 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_64K UINT32_C(0x10)
4093 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_2M UINT32_C(0x15)
4095 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_4M UINT32_C(0x16)
4097 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_1G UINT32_C(0x1e)
4098 uint16_t req_buf_len;
4099 /* The length of the request buffer per VF in bytes. */
4100 uint16_t resp_buf_len;
4101 /* The length of the response buffer in bytes. */
4104 uint64_t req_buf_page_addr[10];
4105 /* This field represents the page address of req buffer. */
4106 uint64_t error_buf_addr;
4108 * This field is used to receive the error reporting from the
4109 * chipset. Only applicable for PFs.
4111 uint64_t resp_buf_addr;
4112 /* This field is used to receive the response forwarded by the HWRM. */
4113 } __attribute__((packed));
4115 /* Output (16 bytes) */
4116 struct hwrm_func_buf_rgtr_output {
4117 uint16_t error_code;
4119 * Pass/Fail or error type Note: receiver to verify the in
4120 * parameters, and fail the call with an error when appropriate
4123 /* This field returns the type of original request. */
4125 /* This field provides original sequence number of the command. */
4128 * This field is the length of the response in bytes. The last
4129 * byte of the response is a valid flag that will read as '1'
4130 * when the command has been completely written to memory.
4138 * This field is used in Output records to indicate that the
4139 * output is completely written to RAM. This field should be
4140 * read as '1' to indicate that the output has been completely
4141 * written. When writing a command completion or response to an
4142 * internal processor, the order of writes has to be such that
4143 * this field is written last.
4145 } __attribute__((packed));
4147 /* hwrm_func_buf_unrgtr */
4149 * Description: This command is used by the PF driver to unregister buffers used
4150 * in the PF-VF communication with the HWRM. The PF driver uses this command to
4151 * unregister buffers for PF-VF communication. A parent PF may issue this
4152 * command to unregister buffers for communication between the PF and a specific
4153 * VF. If the VF ID is not valid, then this command is used to unregister
4154 * buffers used for communications with all children VFs of the PF.
4156 /* Input (24 bytes) */
4157 struct hwrm_func_buf_unrgtr_input {
4160 * This value indicates what type of request this is. The format
4161 * for the rest of the command is determined by this field.
4165 * This value indicates the what completion ring the request
4166 * will be optionally completed on. If the value is -1, then no
4167 * CR completion will be generated. Any other value must be a
4168 * valid CR ring_id value for this function.
4171 /* This value indicates the command sequence number. */
4174 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4175 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4180 * This is the host address where the response will be written
4181 * when the request is complete. This area must be 16B aligned
4182 * and must be cleared to zero before the request is made.
4185 /* This bit must be '1' for the vf_id field to be configured. */
4186 #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
4189 * This value is used to identify a Virtual Function (VF). The
4190 * scope of VF ID is local within a PF.
4193 } __attribute__((packed));
4195 /* Output (16 bytes) */
4196 struct hwrm_func_buf_unrgtr_output {
4197 uint16_t error_code;
4199 * Pass/Fail or error type Note: receiver to verify the in
4200 * parameters, and fail the call with an error when appropriate
4203 /* This field returns the type of original request. */
4205 /* This field provides original sequence number of the command. */
4208 * This field is the length of the response in bytes. The last
4209 * byte of the response is a valid flag that will read as '1'
4210 * when the command has been completely written to memory.
4218 * This field is used in Output records to indicate that the
4219 * output is completely written to RAM. This field should be
4220 * read as '1' to indicate that the output has been completely
4221 * written. When writing a command completion or response to an
4222 * internal processor, the order of writes has to be such that
4223 * this field is written last.
4225 } __attribute__((packed));
4227 /* hwrm_func_vf_cfg */
4229 * Description: This command allows configuration of a VF by its driver. If this
4230 * function is called by a PF driver, then the HWRM shall fail this command. If
4231 * guest VLAN and/or MAC address are provided in this command, then the HWRM
4232 * shall set up appropriate MAC/VLAN filters for the VF that is being
4233 * configured. A VF driver should set VF MTU/MRU using this command prior to
4234 * allocating RX VNICs or TX rings for the corresponding VF.
4236 /* Input (32 bytes) */
4238 struct hwrm_func_vf_cfg_input {
4241 * This value indicates what type of request this is. The format for the
4242 * rest of the command is determined by this field.
4246 * This value indicates the what completion ring the request will be
4247 * optionally completed on. If the value is -1, then no CR completion
4248 * will be generated. Any other value must be a valid CR ring_id value
4249 * for this function.
4252 /* This value indicates the command sequence number. */
4255 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4256 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4260 * This is the host address where the response will be written when the
4261 * request is complete. This area must be 16B aligned and must be
4262 * cleared to zero before the request is made.
4265 /* This bit must be '1' for the mtu field to be configured. */
4266 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
4267 /* This bit must be '1' for the guest_vlan field to be configured. */
4268 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN UINT32_C(0x2)
4270 * This bit must be '1' for the async_event_cr field to be configured.
4272 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4)
4273 /* This bit must be '1' for the dflt_mac_addr field to be configured. */
4274 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x8)
4277 * The maximum transmission unit requested on the function. The HWRM
4278 * should make sure that the mtu of the function does not exceed the mtu
4279 * of the physical port that this function is associated with. In
4280 * addition to requesting mtu per function, it is possible to configure
4281 * mtu per transmit ring. By default, the mtu of each transmit ring
4282 * associated with a function is equal to the mtu of the function. The
4283 * HWRM should make sure that the mtu of each transmit ring that is
4284 * assigned to a function has a valid mtu.
4286 uint16_t guest_vlan;
4288 * The guest VLAN for the function being configured. This field's format
4289 * is same as 802.1Q Tag's Tag Control Information (TCI) format that
4290 * includes both Priority Code Point (PCP) and VLAN Identifier (VID).
4292 uint16_t async_event_cr;
4294 * ID of the target completion ring for receiving asynchronous event
4295 * completions. If this field is not valid, then the HWRM shall use the
4296 * default completion ring of the function that is being configured as
4297 * the target completion ring for providing any asynchronous event
4298 * completions for that function. If this field is valid, then the HWRM
4299 * shall use the completion ring identified by this ID as the target
4300 * completion ring for providing any asynchronous event completions for
4301 * the function that is being configured.
4303 uint8_t dflt_mac_addr[6];
4305 * This value is the current MAC address requested by the VF driver to
4306 * be configured on this VF. A value of 00-00-00-00-00-00 indicates no
4307 * MAC address configuration is requested by the VF driver. The parent
4308 * PF driver may reject or overwrite this MAC address.
4310 } __attribute__((packed));
4312 /* Output (16 bytes) */
4314 struct hwrm_func_vf_cfg_output {
4315 uint16_t error_code;
4317 * Pass/Fail or error type Note: receiver to verify the in parameters,
4318 * and fail the call with an error when appropriate
4321 /* This field returns the type of original request. */
4323 /* This field provides original sequence number of the command. */
4326 * This field is the length of the response in bytes. The last
4327 * byte of the response is a valid flag that will read as '1'
4328 * when the command has been completely written to memory.
4336 * This field is used in Output records to indicate that the output is
4337 * completely written to RAM. This field should be read as '1' to
4338 * indicate that the output has been completely written. When writing a
4339 * command completion or response to an internal processor, the order of
4340 * writes has to be such that this field is written last.
4342 } __attribute__((packed));
4344 /* hwrm_port_phy_cfg */
4346 * Description: This command configures the PHY device for the port. It allows
4347 * setting of the most generic settings for the PHY. The HWRM shall complete
4348 * this command as soon as PHY settings are configured. They may not be applied
4349 * when the command response is provided. A VF driver shall not be allowed to
4350 * configure PHY using this command. In a network partition mode, a PF driver
4351 * shall not be allowed to configure PHY using this command.
4353 /* Input (56 bytes) */
4354 struct hwrm_port_phy_cfg_input {
4357 * This value indicates what type of request this is. The format
4358 * for the rest of the command is determined by this field.
4362 * This value indicates the what completion ring the request
4363 * will be optionally completed on. If the value is -1, then no
4364 * CR completion will be generated. Any other value must be a
4365 * valid CR ring_id value for this function.
4368 /* This value indicates the command sequence number. */
4371 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4372 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4377 * This is the host address where the response will be written
4378 * when the request is complete. This area must be 16B aligned
4379 * and must be cleared to zero before the request is made.
4383 * When this bit is set to '1', the PHY for the port shall be
4384 * reset. # If this bit is set to 1, then the HWRM shall reset
4385 * the PHY after applying PHY configuration changes specified in
4386 * this command. # In order to guarantee that PHY configuration
4387 * changes specified in this command take effect, the HWRM
4388 * client should set this flag to 1. # If this bit is not set to
4389 * 1, then the HWRM may reset the PHY depending on the current
4390 * PHY configuration and settings specified in this command.
4392 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
4393 /* deprecated bit. Do not use!!! */
4394 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED UINT32_C(0x2)
4396 * When this bit is set to '1', the link shall be forced to the
4397 * force_link_speed value. When this bit is set to '1', the HWRM
4398 * client should not enable any of the auto negotiation related
4399 * fields represented by auto_XXX fields in this command. When
4400 * this bit is set to '1' and the HWRM client has enabled a
4401 * auto_XXX field in this command, then the HWRM shall ignore
4402 * the enabled auto_XXX field. When this bit is set to zero, the
4403 * link shall be allowed to autoneg.
4405 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
4407 * When this bit is set to '1', the auto-negotiation process
4408 * shall be restarted on the link.
4410 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
4412 * When this bit is set to '1', Energy Efficient Ethernet (EEE)
4413 * is requested to be enabled on this link. If EEE is not
4414 * supported on this port, then this flag shall be ignored by
4417 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
4419 * When this bit is set to '1', Energy Efficient Ethernet (EEE)
4420 * is requested to be disabled on this link. If EEE is not
4421 * supported on this port, then this flag shall be ignored by
4424 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
4426 * When this bit is set to '1' and EEE is enabled on this link,
4427 * then TX LPI is requested to be enabled on the link. If EEE is
4428 * not supported on this port, then this flag shall be ignored
4429 * by the HWRM. If EEE is disabled on this port, then this flag
4430 * shall be ignored by the HWRM.
4432 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE UINT32_C(0x40)
4434 * When this bit is set to '1' and EEE is enabled on this link,
4435 * then TX LPI is requested to be disabled on the link. If EEE
4436 * is not supported on this port, then this flag shall be
4437 * ignored by the HWRM. If EEE is disabled on this port, then
4438 * this flag shall be ignored by the HWRM.
4440 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE UINT32_C(0x80)
4442 * When set to 1, then the HWRM shall enable FEC
4443 * autonegotitation on this port if supported. When set to 0,
4444 * then this flag shall be ignored. If FEC autonegotiation is
4445 * not supported, then the HWRM shall ignore this flag.
4447 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE UINT32_C(0x100)
4449 * When set to 1, then the HWRM shall disable FEC
4450 * autonegotiation on this port if supported. When set to 0,
4451 * then this flag shall be ignored. If FEC autonegotiation is
4452 * not supported, then the HWRM shall ignore this flag.
4454 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
4457 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire
4458 * Code) on this port if supported. When set to 0, then this
4459 * flag shall be ignored. If FEC CLAUSE 74 is not supported,
4460 * then the HWRM shall ignore this flag.
4462 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
4465 * When set to 1, then the HWRM shall disable FEC CLAUSE 74
4466 * (Fire Code) on this port if supported. When set to 0, then
4467 * this flag shall be ignored. If FEC CLAUSE 74 is not
4468 * supported, then the HWRM shall ignore this flag.
4470 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
4473 * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed
4474 * Solomon) on this port if supported. When set to 0, then this
4475 * flag shall be ignored. If FEC CLAUSE 91 is not supported,
4476 * then the HWRM shall ignore this flag.
4478 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
4481 * When set to 1, then the HWRM shall disable FEC CLAUSE 91
4482 * (Reed Solomon) on this port if supported. When set to 0, then
4483 * this flag shall be ignored. If FEC CLAUSE 91 is not
4484 * supported, then the HWRM shall ignore this flag.
4486 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
4489 * When this bit is set to '1', the link shall be forced to be
4490 * taken down. # When this bit is set to '1", all other command
4491 * input settings related to the link speed shall be ignored.
4492 * Once the link state is forced down, it can be explicitly
4493 * cleared from that state by setting this flag to '0'. # If
4494 * this flag is set to '0', then the link shall be cleared from
4495 * forced down state if the link is in forced down state. There
4496 * may be conditions (e.g. out-of-band or sideband configuration
4497 * changes for the link) outside the scope of the HWRM
4498 * implementation that may clear forced down link state.
4500 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN UINT32_C(0x4000)
4502 /* This bit must be '1' for the auto_mode field to be configured. */
4503 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
4504 /* This bit must be '1' for the auto_duplex field to be configured. */
4505 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
4506 /* This bit must be '1' for the auto_pause field to be configured. */
4507 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
4509 * This bit must be '1' for the auto_link_speed field to be
4512 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
4514 * This bit must be '1' for the auto_link_speed_mask field to be
4517 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
4519 /* This bit must be '1' for the wirespeed field to be configured. */
4520 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIOUTPUTEED UINT32_C(0x20)
4521 /* This bit must be '1' for the lpbk field to be configured. */
4522 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
4523 /* This bit must be '1' for the preemphasis field to be configured. */
4524 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
4525 /* This bit must be '1' for the force_pause field to be configured. */
4526 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
4528 * This bit must be '1' for the eee_link_speed_mask field to be
4531 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
4533 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
4534 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
4536 /* Port ID of port that is to be configured. */
4537 uint16_t force_link_speed;
4539 * This is the speed that will be used if the force bit is '1'.
4540 * If unsupported speed is selected, an error will be generated.
4542 /* 100Mb link speed */
4543 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
4544 /* 1Gb link speed */
4545 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
4546 /* 2Gb link speed */
4547 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
4548 /* 2.5Gb link speed */
4549 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
4550 /* 10Gb link speed */
4551 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
4552 /* 20Mb link speed */
4553 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
4554 /* 25Gb link speed */
4555 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
4556 /* 40Gb link speed */
4557 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
4558 /* 50Gb link speed */
4559 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
4560 /* 100Gb link speed */
4561 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
4562 /* 10Mb link speed */
4563 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
4566 * This value is used to identify what autoneg mode is used when
4567 * the link speed is not being forced.
4570 * Disable autoneg or autoneg disabled. No
4571 * speeds are selected.
4573 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE UINT32_C(0x0)
4574 /* Select all possible speeds for autoneg mode. */
4575 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
4577 * Select only the auto_link_speed speed for
4578 * autoneg mode. This mode has been DEPRECATED.
4579 * An HWRM client should not use this mode.
4581 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
4583 * Select the auto_link_speed or any speed below
4584 * that speed for autoneg. This mode has been
4585 * DEPRECATED. An HWRM client should not use
4588 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
4590 * Select the speeds based on the corresponding
4591 * link speed mask value that is provided.
4593 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
4594 uint8_t auto_duplex;
4596 * This is the duplex setting that will be used if the
4597 * autoneg_mode is "one_speed" or "one_or_below".
4599 /* Half Duplex will be requested. */
4600 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
4601 /* Full duplex will be requested. */
4602 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
4603 /* Both Half and Full dupex will be requested. */
4604 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
4607 * This value is used to configure the pause that will be used
4608 * for autonegotiation. Add text on the usage of auto_pause and
4612 * When this bit is '1', Generation of tx pause messages has
4613 * been requested. Disabled otherwise.
4615 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
4617 * When this bit is '1', Reception of rx pause messages has been
4618 * requested. Disabled otherwise.
4620 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
4622 * When set to 1, the advertisement of pause is enabled. # When
4623 * the auto_mode is not set to none and this flag is set to 1,
4624 * then the auto_pause bits on this port are being advertised
4625 * and autoneg pause results are being interpreted. # When the
4626 * auto_mode is not set to none and this flag is set to 0, the
4627 * pause is forced as indicated in force_pause, and also
4628 * advertised as auto_pause bits, but the autoneg results are
4629 * not interpreted since the pause configuration is being
4630 * forced. # When the auto_mode is set to none and this flag is
4631 * set to 1, auto_pause bits should be ignored and should be set
4634 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
4636 uint16_t auto_link_speed;
4638 * This is the speed that will be used if the autoneg_mode is
4639 * "one_speed" or "one_or_below". If an unsupported speed is
4640 * selected, an error will be generated.
4642 /* 100Mb link speed */
4643 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
4644 /* 1Gb link speed */
4645 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
4646 /* 2Gb link speed */
4647 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
4648 /* 2.5Gb link speed */
4649 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
4650 /* 10Gb link speed */
4651 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
4652 /* 20Mb link speed */
4653 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
4654 /* 25Gb link speed */
4655 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
4656 /* 40Gb link speed */
4657 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
4658 /* 50Gb link speed */
4659 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
4660 /* 100Gb link speed */
4661 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
4662 /* 10Mb link speed */
4663 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
4664 uint16_t auto_link_speed_mask;
4666 * This is a mask of link speeds that will be used if
4667 * autoneg_mode is "mask". If unsupported speed is enabled an
4668 * error will be generated.
4670 /* 100Mb link speed (Half-duplex) */
4671 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
4673 /* 100Mb link speed (Full-duplex) */
4674 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
4676 /* 1Gb link speed (Half-duplex) */
4677 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
4679 /* 1Gb link speed (Full-duplex) */
4680 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
4682 /* 2Gb link speed */
4683 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
4685 /* 2.5Gb link speed */
4686 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
4688 /* 10Gb link speed */
4689 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB UINT32_C(0x40)
4690 /* 20Gb link speed */
4691 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB UINT32_C(0x80)
4692 /* 25Gb link speed */
4693 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
4695 /* 40Gb link speed */
4696 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
4698 /* 50Gb link speed */
4699 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
4701 /* 100Gb link speed */
4702 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
4704 /* 10Mb link speed (Half-duplex) */
4705 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
4707 /* 10Mb link speed (Full-duplex) */
4708 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
4711 /* This value controls the wirespeed feature. */
4712 /* Wirespeed feature is disabled. */
4713 #define HWRM_PORT_PHY_CFG_INPUT_WIOUTPUTEED_OFF UINT32_C(0x0)
4714 /* Wirespeed feature is enabled. */
4715 #define HWRM_PORT_PHY_CFG_INPUT_WIOUTPUTEED_ON UINT32_C(0x1)
4717 /* This value controls the loopback setting for the PHY. */
4718 /* No loopback is selected. Normal operation. */
4719 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE UINT32_C(0x0)
4721 * The HW will be configured with local loopback
4722 * such that host data is sent back to the host
4723 * without modification.
4725 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1)
4727 * The HW will be configured with remote
4728 * loopback such that port logic will send
4729 * packets back out the transmitter that are
4732 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
4733 uint8_t force_pause;
4735 * This value is used to configure the pause that will be used
4739 * When this bit is '1', Generation of tx pause messages is
4740 * supported. Disabled otherwise.
4742 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
4744 * When this bit is '1', Reception of rx pause messages is
4745 * supported. Disabled otherwise.
4747 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
4749 uint32_t preemphasis;
4751 * This value controls the pre-emphasis to be used for the link.
4752 * Driver should not set this value (use enable.preemphasis = 0)
4753 * unless driver is sure of setting. Normally HWRM FW will
4754 * determine proper pre-emphasis.
4756 uint16_t eee_link_speed_mask;
4758 * Setting for link speed mask that is used to advertise speeds
4759 * during autonegotiation when EEE is enabled. This field is
4760 * valid only when EEE is enabled. The speeds specified in this
4761 * field shall be a subset of speeds specified in
4762 * auto_link_speed_mask. If EEE is enabled,then at least one
4763 * speed shall be provided in this mask.
4766 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
4767 /* 100Mb link speed (Full-duplex) */
4768 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
4770 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
4771 /* 1Gb link speed (Full-duplex) */
4772 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
4774 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
4776 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
4777 /* 10Gb link speed */
4778 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
4781 uint32_t tx_lpi_timer;
4784 * Reuested setting of TX LPI timer in microseconds. This field
4785 * is valid only when EEE is enabled and TX LPI is enabled.
4787 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
4788 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
4789 } __attribute__((packed));
4791 /* Output (16 bytes) */
4792 struct hwrm_port_phy_cfg_output {
4793 uint16_t error_code;
4795 * Pass/Fail or error type Note: receiver to verify the in
4796 * parameters, and fail the call with an error when appropriate
4799 /* This field returns the type of original request. */
4801 /* This field provides original sequence number of the command. */
4804 * This field is the length of the response in bytes. The last
4805 * byte of the response is a valid flag that will read as '1'
4806 * when the command has been completely written to memory.
4814 * This field is used in Output records to indicate that the
4815 * output is completely written to RAM. This field should be
4816 * read as '1' to indicate that the output has been completely
4817 * written. When writing a command completion or response to an
4818 * internal processor, the order of writes has to be such that
4819 * this field is written last.
4821 } __attribute__((packed));
4823 /* hwrm_port_phy_qcfg */
4824 /* Description: This command queries the PHY configuration for the port. */
4825 /* Input (24 bytes) */
4826 struct hwrm_port_phy_qcfg_input {
4829 * This value indicates what type of request this is. The format
4830 * for the rest of the command is determined by this field.
4834 * This value indicates the what completion ring the request
4835 * will be optionally completed on. If the value is -1, then no
4836 * CR completion will be generated. Any other value must be a
4837 * valid CR ring_id value for this function.
4840 /* This value indicates the command sequence number. */
4843 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4844 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4849 * This is the host address where the response will be written
4850 * when the request is complete. This area must be 16B aligned
4851 * and must be cleared to zero before the request is made.
4854 /* Port ID of port that is to be queried. */
4855 uint16_t unused_0[3];
4856 } __attribute__((packed));
4858 /* Output (96 bytes) */
4859 struct hwrm_port_phy_qcfg_output {
4860 uint16_t error_code;
4862 * Pass/Fail or error type Note: receiver to verify the in
4863 * parameters, and fail the call with an error when appropriate
4866 /* This field returns the type of original request. */
4868 /* This field provides original sequence number of the command. */
4871 * This field is the length of the response in bytes. The last
4872 * byte of the response is a valid flag that will read as '1'
4873 * when the command has been completely written to memory.
4876 /* This value indicates the current link status. */
4877 /* There is no link or cable detected. */
4878 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
4879 /* There is no link, but a cable has been detected. */
4880 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL UINT32_C(0x1)
4881 /* There is a link. */
4882 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK UINT32_C(0x2)
4884 uint16_t link_speed;
4885 /* This value indicates the current link speed of the connection. */
4886 /* 100Mb link speed */
4887 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
4888 /* 1Gb link speed */
4889 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB UINT32_C(0xa)
4890 /* 2Gb link speed */
4891 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB UINT32_C(0x14)
4892 /* 2.5Gb link speed */
4893 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
4894 /* 10Gb link speed */
4895 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB UINT32_C(0x64)
4896 /* 20Mb link speed */
4897 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB UINT32_C(0xc8)
4898 /* 25Gb link speed */
4899 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB UINT32_C(0xfa)
4900 /* 40Gb link speed */
4901 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB UINT32_C(0x190)
4902 /* 50Gb link speed */
4903 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB UINT32_C(0x1f4)
4904 /* 100Gb link speed */
4905 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
4906 /* 10Mb link speed */
4907 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB UINT32_C(0xffff)
4909 /* This value is indicates the duplex of the current connection. */
4910 /* Half Duplex connection. */
4911 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_HALF UINT32_C(0x0)
4912 /* Full duplex connection. */
4913 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_FULL UINT32_C(0x1)
4916 * This value is used to indicate the current pause
4917 * configuration. When autoneg is enabled, this value represents
4918 * the autoneg results of pause configuration.
4921 * When this bit is '1', Generation of tx pause messages is
4922 * supported. Disabled otherwise.
4924 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX UINT32_C(0x1)
4926 * When this bit is '1', Reception of rx pause messages is
4927 * supported. Disabled otherwise.
4929 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX UINT32_C(0x2)
4930 uint16_t support_speeds;
4932 * The supported speeds for the port. This is a bit mask. For
4933 * each speed that is supported, the corrresponding bit will be
4936 /* 100Mb link speed (Half-duplex) */
4937 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD UINT32_C(0x1)
4938 /* 100Mb link speed (Full-duplex) */
4939 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB UINT32_C(0x2)
4940 /* 1Gb link speed (Half-duplex) */
4941 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD UINT32_C(0x4)
4942 /* 1Gb link speed (Full-duplex) */
4943 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB UINT32_C(0x8)
4944 /* 2Gb link speed */
4945 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB UINT32_C(0x10)
4946 /* 2.5Gb link speed */
4947 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB UINT32_C(0x20)
4948 /* 10Gb link speed */
4949 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB UINT32_C(0x40)
4950 /* 20Gb link speed */
4951 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB UINT32_C(0x80)
4952 /* 25Gb link speed */
4953 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB UINT32_C(0x100)
4954 /* 40Gb link speed */
4955 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB UINT32_C(0x200)
4956 /* 50Gb link speed */
4957 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB UINT32_C(0x400)
4958 /* 100Gb link speed */
4959 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB UINT32_C(0x800)
4960 /* 10Mb link speed (Half-duplex) */
4961 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD UINT32_C(0x1000)
4962 /* 10Mb link speed (Full-duplex) */
4963 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB UINT32_C(0x2000)
4964 uint16_t force_link_speed;
4966 * Current setting of forced link speed. When the link speed is
4967 * not being forced, this value shall be set to 0.
4969 /* 100Mb link speed */
4970 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
4971 /* 1Gb link speed */
4972 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
4973 /* 2Gb link speed */
4974 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
4975 /* 2.5Gb link speed */
4976 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
4977 /* 10Gb link speed */
4978 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
4979 /* 20Mb link speed */
4980 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
4981 /* 25Gb link speed */
4982 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
4983 /* 40Gb link speed */
4984 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
4985 /* 50Gb link speed */
4986 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
4987 /* 100Gb link speed */
4988 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
4989 /* 10Mb link speed */
4990 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
4992 /* Current setting of auto negotiation mode. */
4994 * Disable autoneg or autoneg disabled. No
4995 * speeds are selected.
4997 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE UINT32_C(0x0)
4998 /* Select all possible speeds for autoneg mode. */
4999 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
5001 * Select only the auto_link_speed speed for
5002 * autoneg mode. This mode has been DEPRECATED.
5003 * An HWRM client should not use this mode.
5005 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
5007 * Select the auto_link_speed or any speed below
5008 * that speed for autoneg. This mode has been
5009 * DEPRECATED. An HWRM client should not use
5012 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
5014 * Select the speeds based on the corresponding
5015 * link speed mask value that is provided.
5017 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
5020 * Current setting of pause autonegotiation. Move autoneg_pause
5024 * When this bit is '1', Generation of tx pause messages has
5025 * been requested. Disabled otherwise.
5027 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX UINT32_C(0x1)
5029 * When this bit is '1', Reception of rx pause messages has been
5030 * requested. Disabled otherwise.
5032 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX UINT32_C(0x2)
5034 * When set to 1, the advertisement of pause is enabled. # When
5035 * the auto_mode is not set to none and this flag is set to 1,
5036 * then the auto_pause bits on this port are being advertised
5037 * and autoneg pause results are being interpreted. # When the
5038 * auto_mode is not set to none and this flag is set to 0, the
5039 * pause is forced as indicated in force_pause, and also
5040 * advertised as auto_pause bits, but the autoneg results are
5041 * not interpreted since the pause configuration is being
5042 * forced. # When the auto_mode is set to none and this flag is
5043 * set to 1, auto_pause bits should be ignored and should be set
5046 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
5047 uint16_t auto_link_speed;
5049 * Current setting for auto_link_speed. This field is only valid
5050 * when auto_mode is set to "one_speed" or "one_or_below".
5052 /* 100Mb link speed */
5053 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
5054 /* 1Gb link speed */
5055 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
5056 /* 2Gb link speed */
5057 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
5058 /* 2.5Gb link speed */
5059 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
5060 /* 10Gb link speed */
5061 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
5062 /* 20Mb link speed */
5063 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
5064 /* 25Gb link speed */
5065 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
5066 /* 40Gb link speed */
5067 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
5068 /* 50Gb link speed */
5069 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
5070 /* 100Gb link speed */
5071 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
5072 /* 10Mb link speed */
5073 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
5074 uint16_t auto_link_speed_mask;
5076 * Current setting for auto_link_speed_mask that is used to
5077 * advertise speeds during autonegotiation. This field is only
5078 * valid when auto_mode is set to "mask". The speeds specified
5079 * in this field shall be a subset of supported speeds on this
5082 /* 100Mb link speed (Half-duplex) */
5083 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
5085 /* 100Mb link speed (Full-duplex) */
5086 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
5088 /* 1Gb link speed (Half-duplex) */
5089 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
5091 /* 1Gb link speed (Full-duplex) */
5092 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB UINT32_C(0x8)
5093 /* 2Gb link speed */
5094 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
5096 /* 2.5Gb link speed */
5097 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
5099 /* 10Gb link speed */
5100 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
5102 /* 20Gb link speed */
5103 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
5105 /* 25Gb link speed */
5106 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
5108 /* 40Gb link speed */
5109 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
5111 /* 50Gb link speed */
5112 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
5114 /* 100Gb link speed */
5115 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
5117 /* 10Mb link speed (Half-duplex) */
5118 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
5120 /* 10Mb link speed (Full-duplex) */
5121 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
5124 /* Current setting for wirespeed. */
5125 /* Wirespeed feature is disabled. */
5126 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIOUTPUTEED_OFF UINT32_C(0x0)
5127 /* Wirespeed feature is enabled. */
5128 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIOUTPUTEED_ON UINT32_C(0x1)
5130 /* Current setting for loopback. */
5131 /* No loopback is selected. Normal operation. */
5132 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0)
5134 * The HW will be configured with local loopback
5135 * such that host data is sent back to the host
5136 * without modification.
5138 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1)
5140 * The HW will be configured with remote
5141 * loopback such that port logic will send
5142 * packets back out the transmitter that are
5145 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
5146 uint8_t force_pause;
5148 * Current setting of forced pause. When the pause configuration
5149 * is not being forced, then this value shall be set to 0.
5152 * When this bit is '1', Generation of tx pause messages is
5153 * supported. Disabled otherwise.
5155 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX UINT32_C(0x1)
5157 * When this bit is '1', Reception of rx pause messages is
5158 * supported. Disabled otherwise.
5160 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX UINT32_C(0x2)
5161 uint8_t module_status;
5163 * This value indicates the current status of the optics module
5166 /* Module is inserted and accepted */
5167 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE UINT32_C(0x0)
5168 /* Module is rejected and transmit side Laser is disabled. */
5169 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX UINT32_C(0x1)
5170 /* Module mismatch warning. */
5171 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG UINT32_C(0x2)
5172 /* Module is rejected and powered down. */
5173 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN UINT32_C(0x3)
5174 /* Module is not inserted. */
5175 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
5177 /* Module status is not applicable. */
5178 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
5180 uint32_t preemphasis;
5181 /* Current setting for preemphasis. */
5183 /* This field represents the major version of the PHY. */
5185 /* This field represents the minor version of the PHY. */
5187 /* This field represents the build version of the PHY. */
5189 /* This value represents a PHY type. */
5191 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN UINT32_C(0x0)
5193 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR UINT32_C(0x1)
5194 /* BASE-KR4 (Deprecated) */
5195 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 UINT32_C(0x2)
5197 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR UINT32_C(0x3)
5199 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR UINT32_C(0x4)
5200 /* BASE-KR2 (Deprecated) */
5201 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 UINT32_C(0x5)
5203 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX UINT32_C(0x6)
5205 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR UINT32_C(0x7)
5207 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET UINT32_C(0x8)
5208 /* EEE capable BASE-T */
5209 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE UINT32_C(0x9)
5210 /* SGMII connected external PHY */
5211 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY UINT32_C(0xa)
5212 /* 25G_BASECR_CA_L */
5213 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L UINT32_C(0xb)
5214 /* 25G_BASECR_CA_S */
5215 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S UINT32_C(0xc)
5216 /* 25G_BASECR_CA_N */
5217 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N UINT32_C(0xd)
5219 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR UINT32_C(0xe)
5221 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 UINT32_C(0xf)
5223 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 UINT32_C(0x10)
5225 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 UINT32_C(0x11)
5227 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 UINT32_C(0x12)
5229 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 UINT32_C(0x13)
5231 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 UINT32_C(0x14)
5233 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 UINT32_C(0x15)
5235 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 UINT32_C(0x16)
5237 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 UINT32_C(0x17)
5238 /* 40G_ACTIVE_CABLE */
5239 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
5242 /* This value represents a media type. */
5244 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
5246 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP UINT32_C(0x1)
5247 /* Direct Attached Copper */
5248 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC UINT32_C(0x2)
5250 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE UINT32_C(0x3)
5251 uint8_t xcvr_pkg_type;
5252 /* This value represents a transceiver type. */
5253 /* PHY and MAC are in the same package */
5254 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
5256 /* PHY and MAC are in different packages */
5257 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
5259 uint8_t eee_config_phy_addr;
5261 * This field represents flags related to EEE configuration.
5262 * These EEE configuration flags are valid only when the
5263 * auto_mode is not set to none (in other words autonegotiation
5266 /* This field represents PHY address. */
5267 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK UINT32_C(0x1f)
5268 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT 0
5270 * When set to 1, Energy Efficient Ethernet (EEE) mode is
5271 * enabled. Speeds for autoneg with EEE mode enabled are based
5272 * on eee_link_speed_mask.
5274 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED UINT32_C(0x20)
5276 * This flag is valid only when eee_enabled is set to 1. # If
5277 * eee_enabled is set to 0, then EEE mode is disabled and this
5278 * flag shall be ignored. # If eee_enabled is set to 1 and this
5279 * flag is set to 1, then Energy Efficient Ethernet (EEE) mode
5280 * is enabled and in use. # If eee_enabled is set to 1 and this
5281 * flag is set to 0, then Energy Efficient Ethernet (EEE) mode
5282 * is enabled but is currently not in use.
5284 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE UINT32_C(0x40)
5286 * This flag is valid only when eee_enabled is set to 1. # If
5287 * eee_enabled is set to 0, then EEE mode is disabled and this
5288 * flag shall be ignored. # If eee_enabled is set to 1 and this
5289 * flag is set to 1, then Energy Efficient Ethernet (EEE) mode
5290 * is enabled and TX LPI is enabled. # If eee_enabled is set to
5291 * 1 and this flag is set to 0, then Energy Efficient Ethernet
5292 * (EEE) mode is enabled but TX LPI is disabled.
5294 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI UINT32_C(0x80)
5296 * This field represents flags related to EEE configuration.
5297 * These EEE configuration flags are valid only when the
5298 * auto_mode is not set to none (in other words autonegotiation
5301 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK UINT32_C(0xe0)
5302 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT 5
5303 uint8_t parallel_detect;
5304 /* Reserved field, set to 0 */
5306 * When set to 1, the parallel detection is used to determine
5307 * the speed of the link partner. Parallel detection is used
5308 * when a autonegotiation capable device is connected to a link
5309 * parter that is not capable of autonegotiation.
5311 #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT UINT32_C(0x1)
5312 /* Reserved field, set to 0 */
5313 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_MASK UINT32_C(0xfe)
5314 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_SFT 1
5315 uint16_t link_partner_adv_speeds;
5317 * The advertised speeds for the port by the link partner. Each
5318 * advertised speed will be set to '1'.
5320 /* 100Mb link speed (Half-duplex) */
5321 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
5323 /* 100Mb link speed (Full-duplex) */
5324 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
5326 /* 1Gb link speed (Half-duplex) */
5327 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
5329 /* 1Gb link speed (Full-duplex) */
5330 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
5332 /* 2Gb link speed */
5333 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
5335 /* 2.5Gb link speed */
5336 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
5338 /* 10Gb link speed */
5339 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
5341 /* 20Gb link speed */
5342 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
5344 /* 25Gb link speed */
5345 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
5347 /* 40Gb link speed */
5348 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
5350 /* 50Gb link speed */
5351 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
5353 /* 100Gb link speed */
5354 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
5356 /* 10Mb link speed (Half-duplex) */
5357 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
5359 /* 10Mb link speed (Full-duplex) */
5360 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
5362 uint8_t link_partner_adv_auto_mode;
5364 * The advertised autoneg for the port by the link partner. This
5365 * field is deprecated and should be set to 0.
5368 * Disable autoneg or autoneg disabled. No
5369 * speeds are selected.
5371 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
5373 /* Select all possible speeds for autoneg mode. */
5375 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
5378 * Select only the auto_link_speed speed for
5379 * autoneg mode. This mode has been DEPRECATED.
5380 * An HWRM client should not use this mode.
5383 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
5386 * Select the auto_link_speed or any speed below
5387 * that speed for autoneg. This mode has been
5388 * DEPRECATED. An HWRM client should not use
5392 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
5395 * Select the speeds based on the corresponding
5396 * link speed mask value that is provided.
5399 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
5401 uint8_t link_partner_adv_pause;
5402 /* The advertised pause settings on the port by the link partner. */
5404 * When this bit is '1', Generation of tx pause messages is
5405 * supported. Disabled otherwise.
5407 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
5410 * When this bit is '1', Reception of rx pause messages is
5411 * supported. Disabled otherwise.
5413 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
5415 uint16_t adv_eee_link_speed_mask;
5417 * Current setting for link speed mask that is used to advertise
5418 * speeds during autonegotiation when EEE is enabled. This field
5419 * is valid only when eee_enabled flags is set to 1. The speeds
5420 * specified in this field shall be a subset of speeds specified
5421 * in auto_link_speed_mask.
5424 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
5426 /* 100Mb link speed (Full-duplex) */
5427 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
5430 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
5432 /* 1Gb link speed (Full-duplex) */
5433 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
5436 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
5439 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
5441 /* 10Gb link speed */
5442 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
5444 uint16_t link_partner_adv_eee_link_speed_mask;
5446 * Current setting for link speed mask that is advertised by the
5447 * link partner when EEE is enabled. This field is valid only
5448 * when eee_enabled flags is set to 1.
5452 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
5454 /* 100Mb link speed (Full-duplex) */
5456 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
5460 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
5462 /* 1Gb link speed (Full-duplex) */
5464 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
5468 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
5472 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
5474 /* 10Gb link speed */
5476 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
5478 uint32_t xcvr_identifier_type_tx_lpi_timer;
5479 /* This value represents transceiver identifier type. */
5481 * Current setting of TX LPI timer in microseconds. This field
5482 * is valid only when_eee_enabled flag is set to 1 and
5483 * tx_lpi_enabled is set to 1.
5485 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
5486 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT 0
5487 /* This value represents transceiver identifier type. */
5488 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
5489 UINT32_C(0xff000000)
5490 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT 24
5492 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
5493 (UINT32_C(0x0) << 24)
5494 /* SFP/SFP+/SFP28 */
5495 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
5496 (UINT32_C(0x3) << 24)
5498 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
5499 (UINT32_C(0xc) << 24)
5501 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
5502 (UINT32_C(0xd) << 24)
5504 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
5505 (UINT32_C(0x11) << 24)
5508 * This value represents the current configuration of Forward
5509 * Error Correction (FEC) on the port.
5512 * When set to 1, then FEC is not supported on this port. If
5513 * this flag is set to 1, then all other FEC configuration flags
5514 * shall be ignored. When set to 0, then FEC is supported as
5515 * indicated by other configuration flags. If no cable is
5516 * attached and the HWRM does not yet know the FEC capability,
5517 * then the HWRM shall set this flag to 1 when reporting FEC
5520 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
5523 * When set to 1, then FEC autonegotiation is supported on this
5524 * port. When set to 0, then FEC autonegotiation is not
5525 * supported on this port.
5527 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
5530 * When set to 1, then FEC autonegotiation is enabled on this
5531 * port. When set to 0, then FEC autonegotiation is disabled if
5532 * supported. This flag should be ignored if FEC autonegotiation
5533 * is not supported on this port.
5535 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
5538 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on
5539 * this port. When set to 0, then FEC CLAUSE 74 (Fire Code) is
5540 * not supported on this port.
5542 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
5545 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on
5546 * this port. When set to 0, then FEC CLAUSE 74 (Fire Code) is
5547 * disabled if supported. This flag should be ignored if FEC
5548 * CLAUSE 74 is not supported on this port.
5550 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
5553 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported
5554 * on this port. When set to 0, then FEC CLAUSE 91 (Reed
5555 * Solomon) is not supported on this port.
5557 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
5560 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled
5561 * on this port. When set to 0, then FEC CLAUSE 91 (Reed
5562 * Solomon) is disabled if supported. This flag should be
5563 * ignored if FEC CLAUSE 91 is not supported on this port.
5565 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
5569 char phy_vendor_name[16];
5571 * Up to 16 bytes of null padded ASCII string representing PHY
5572 * vendor. If the string is set to null, then the vendor name is
5575 char phy_vendor_partnumber[16];
5577 * Up to 16 bytes of null padded ASCII string that identifies
5578 * vendor specific part number of the PHY. If the string is set
5579 * to null, then the vendor specific part number is not
5588 * This field is used in Output records to indicate that the
5589 * output is completely written to RAM. This field should be
5590 * read as '1' to indicate that the output has been completely
5591 * written. When writing a command completion or response to an
5592 * internal processor, the order of writes has to be such that
5593 * this field is written last.
5595 } __attribute__((packed));
5597 /* hwrm_port_qstats */
5598 /* Description: This function returns per port Ethernet statistics. */
5599 /* Input (40 bytes) */
5600 struct hwrm_port_qstats_input {
5603 * This value indicates what type of request this is. The format
5604 * for the rest of the command is determined by this field.
5608 * This value indicates the what completion ring the request
5609 * will be optionally completed on. If the value is -1, then no
5610 * CR completion will be generated. Any other value must be a
5611 * valid CR ring_id value for this function.
5614 /* This value indicates the command sequence number. */
5617 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5618 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5623 * This is the host address where the response will be written
5624 * when the request is complete. This area must be 16B aligned
5625 * and must be cleared to zero before the request is made.
5628 /* Port ID of port that is being queried. */
5631 uint8_t unused_2[3];
5633 uint64_t tx_stat_host_addr;
5634 /* This is the host address where Tx port statistics will be stored */
5635 uint64_t rx_stat_host_addr;
5636 /* This is the host address where Rx port statistics will be stored */
5637 } __attribute__((packed));
5639 /* Output (16 bytes) */
5640 struct hwrm_port_qstats_output {
5641 uint16_t error_code;
5643 * Pass/Fail or error type Note: receiver to verify the in
5644 * parameters, and fail the call with an error when appropriate
5647 /* This field returns the type of original request. */
5649 /* This field provides original sequence number of the command. */
5652 * This field is the length of the response in bytes. The last
5653 * byte of the response is a valid flag that will read as '1'
5654 * when the command has been completely written to memory.
5656 uint16_t tx_stat_size;
5657 /* The size of TX port statistics block in bytes. */
5658 uint16_t rx_stat_size;
5659 /* The size of RX port statistics block in bytes. */
5665 * This field is used in Output records to indicate that the
5666 * output is completely written to RAM. This field should be
5667 * read as '1' to indicate that the output has been completely
5668 * written. When writing a command completion or response to an
5669 * internal processor, the order of writes has to be such that
5670 * this field is written last.
5672 } __attribute__((packed));
5674 /* hwrm_port_clr_stats */
5676 * Description: This function clears per port statistics. The HWRM shall not
5677 * allow a VF driver to clear port statistics. The HWRM shall not allow a PF
5678 * driver to clear port statistics in a partitioning mode. The HWRM may allow a
5679 * PF driver to clear port statistics in the non-partitioning mode.
5681 /* Input (24 bytes) */
5682 struct hwrm_port_clr_stats_input {
5685 * This value indicates what type of request this is. The format
5686 * for the rest of the command is determined by this field.
5690 * This value indicates the what completion ring the request
5691 * will be optionally completed on. If the value is -1, then no
5692 * CR completion will be generated. Any other value must be a
5693 * valid CR ring_id value for this function.
5696 /* This value indicates the command sequence number. */
5699 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5700 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5705 * This is the host address where the response will be written
5706 * when the request is complete. This area must be 16B aligned
5707 * and must be cleared to zero before the request is made.
5710 /* Port ID of port that is being queried. */
5711 uint16_t unused_0[3];
5712 } __attribute__((packed));
5714 /* Output (16 bytes) */
5715 struct hwrm_port_clr_stats_output {
5716 uint16_t error_code;
5718 * Pass/Fail or error type Note: receiver to verify the in
5719 * parameters, and fail the call with an error when appropriate
5722 /* This field returns the type of original request. */
5724 /* This field provides original sequence number of the command. */
5727 * This field is the length of the response in bytes. The last
5728 * byte of the response is a valid flag that will read as '1'
5729 * when the command has been completely written to memory.
5737 * This field is used in Output records to indicate that the
5738 * output is completely written to RAM. This field should be
5739 * read as '1' to indicate that the output has been completely
5740 * written. When writing a command completion or response to an
5741 * internal processor, the order of writes has to be such that
5742 * this field is written last.
5744 } __attribute__((packed));
5746 /* hwrm_queue_qportcfg */
5748 * Description: This function is called by a driver to query queue configuration
5749 * of a port. # The HWRM shall at least advertise one queue with lossy service
5750 * profile. # The driver shall use this command to query queue ids before
5751 * configuring or using any queues. # If a service profile is not set for a
5752 * queue, then the driver shall not use that queue without configuring a service
5753 * profile for it. # If the driver is not allowed to configure service profiles,
5754 * then the driver shall only use queues for which service profiles are pre-
5757 /* Input (24 bytes) */
5758 struct hwrm_queue_qportcfg_input {
5761 * This value indicates what type of request this is. The format
5762 * for the rest of the command is determined by this field.
5766 * This value indicates the what completion ring the request
5767 * will be optionally completed on. If the value is -1, then no
5768 * CR completion will be generated. Any other value must be a
5769 * valid CR ring_id value for this function.
5772 /* This value indicates the command sequence number. */
5775 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5776 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5781 * This is the host address where the response will be written
5782 * when the request is complete. This area must be 16B aligned
5783 * and must be cleared to zero before the request is made.
5787 * Enumeration denoting the RX, TX type of the resource. This
5788 * enumeration is used for resources that are similar for both
5789 * TX and RX paths of the chip.
5791 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
5793 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
5795 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
5796 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
5797 QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
5800 * Port ID of port for which the queue configuration is being
5801 * queried. This field is only required when sent by IPC.
5804 } __attribute__((packed));
5806 /* Output (32 bytes) */
5807 struct hwrm_queue_qportcfg_output {
5808 uint16_t error_code;
5810 * Pass/Fail or error type Note: receiver to verify the in
5811 * parameters, and fail the call with an error when appropriate
5814 /* This field returns the type of original request. */
5816 /* This field provides original sequence number of the command. */
5819 * This field is the length of the response in bytes. The last
5820 * byte of the response is a valid flag that will read as '1'
5821 * when the command has been completely written to memory.
5823 uint8_t max_configurable_queues;
5825 * The maximum number of queues that can be configured on this
5826 * port. Valid values range from 1 through 8.
5828 uint8_t max_configurable_lossless_queues;
5830 * The maximum number of lossless queues that can be configured
5831 * on this port. Valid values range from 0 through 8.
5833 uint8_t queue_cfg_allowed;
5835 * Bitmask indicating which queues can be configured by the
5836 * hwrm_queue_cfg command. Each bit represents a specific queue
5837 * where bit 0 represents queue 0 and bit 7 represents queue 7.
5838 * # A value of 0 indicates that the queue is not configurable
5839 * by the hwrm_queue_cfg command. # A value of 1 indicates that
5840 * the queue is configurable. # A hwrm_queue_cfg command shall
5841 * return error when trying to configure a queue not
5844 uint8_t queue_cfg_info;
5845 /* Information about queue configuration. */
5847 * If this flag is set to '1', then the queues are configured
5848 * asymmetrically on TX and RX sides. If this flag is set to
5849 * '0', then the queues are configured symmetrically on TX and
5850 * RX sides. For symmetric configuration, the queue
5851 * configuration including queue ids and service profiles on the
5852 * TX side is the same as the corresponding queue configuration
5855 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
5856 uint8_t queue_pfcenable_cfg_allowed;
5858 * Bitmask indicating which queues can be configured by the
5859 * hwrm_queue_pfcenable_cfg command. Each bit represents a
5860 * specific priority where bit 0 represents priority 0 and bit 7
5861 * represents priority 7. # A value of 0 indicates that the
5862 * priority is not configurable by the hwrm_queue_pfcenable_cfg
5863 * command. # A value of 1 indicates that the priority is
5864 * configurable. # A hwrm_queue_pfcenable_cfg command shall
5865 * return error when trying to configure a priority that is not
5868 uint8_t queue_pri2cos_cfg_allowed;
5870 * Bitmask indicating which queues can be configured by the
5871 * hwrm_queue_pri2cos_cfg command. Each bit represents a
5872 * specific queue where bit 0 represents queue 0 and bit 7
5873 * represents queue 7. # A value of 0 indicates that the queue
5874 * is not configurable by the hwrm_queue_pri2cos_cfg command. #
5875 * A value of 1 indicates that the queue is configurable. # A
5876 * hwrm_queue_pri2cos_cfg command shall return error when trying
5877 * to configure a queue that is not configurable.
5879 uint8_t queue_cos2bw_cfg_allowed;
5881 * Bitmask indicating which queues can be configured by the
5882 * hwrm_queue_pri2cos_cfg command. Each bit represents a
5883 * specific queue where bit 0 represents queue 0 and bit 7
5884 * represents queue 7. # A value of 0 indicates that the queue
5885 * is not configurable by the hwrm_queue_pri2cos_cfg command. #
5886 * A value of 1 indicates that the queue is configurable. # A
5887 * hwrm_queue_pri2cos_cfg command shall return error when trying
5888 * to configure a queue not configurable.
5892 * ID of CoS Queue 0. FF - Invalid id # This ID can be used on
5893 * any subsequent call to an hwrm command that takes a queue id.
5894 * # IDs must always be queried by this command before any use
5895 * by the driver or software. # Any driver or software should
5896 * not make any assumptions about queue IDs. # A value of 0xff
5897 * indicates that the queue is not available. # Available queues
5898 * may not be in sequential order.
5900 uint8_t queue_id0_service_profile;
5901 /* This value is applicable to CoS queues only. */
5902 /* Lossy (best-effort) */
5903 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
5906 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
5909 * Set to 0xFF... (All Fs) if there is no
5910 * service profile specified
5912 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
5916 * ID of CoS Queue 1. FF - Invalid id # This ID can be used on
5917 * any subsequent call to an hwrm command that takes a queue id.
5918 * # IDs must always be queried by this command before any use
5919 * by the driver or software. # Any driver or software should
5920 * not make any assumptions about queue IDs. # A value of 0xff
5921 * indicates that the queue is not available. # Available queues
5922 * may not be in sequential order.
5924 uint8_t queue_id1_service_profile;
5925 /* This value is applicable to CoS queues only. */
5926 /* Lossy (best-effort) */
5927 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
5930 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
5933 * Set to 0xFF... (All Fs) if there is no
5934 * service profile specified
5936 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
5940 * ID of CoS Queue 2. FF - Invalid id # This ID can be used on
5941 * any subsequent call to an hwrm command that takes a queue id.
5942 * # IDs must always be queried by this command before any use
5943 * by the driver or software. # Any driver or software should
5944 * not make any assumptions about queue IDs. # A value of 0xff
5945 * indicates that the queue is not available. # Available queues
5946 * may not be in sequential order.
5948 uint8_t queue_id2_service_profile;
5949 /* This value is applicable to CoS queues only. */
5950 /* Lossy (best-effort) */
5951 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
5954 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
5957 * Set to 0xFF... (All Fs) if there is no
5958 * service profile specified
5960 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
5964 * ID of CoS Queue 3. FF - Invalid id # This ID can be used on
5965 * any subsequent call to an hwrm command that takes a queue id.
5966 * # IDs must always be queried by this command before any use
5967 * by the driver or software. # Any driver or software should
5968 * not make any assumptions about queue IDs. # A value of 0xff
5969 * indicates that the queue is not available. # Available queues
5970 * may not be in sequential order.
5972 uint8_t queue_id3_service_profile;
5973 /* This value is applicable to CoS queues only. */
5974 /* Lossy (best-effort) */
5975 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
5978 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
5981 * Set to 0xFF... (All Fs) if there is no
5982 * service profile specified
5984 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
5988 * ID of CoS Queue 4. FF - Invalid id # This ID can be used on
5989 * any subsequent call to an hwrm command that takes a queue id.
5990 * # IDs must always be queried by this command before any use
5991 * by the driver or software. # Any driver or software should
5992 * not make any assumptions about queue IDs. # A value of 0xff
5993 * indicates that the queue is not available. # Available queues
5994 * may not be in sequential order.
5996 uint8_t queue_id4_service_profile;
5997 /* This value is applicable to CoS queues only. */
5998 /* Lossy (best-effort) */
5999 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
6002 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
6005 * Set to 0xFF... (All Fs) if there is no
6006 * service profile specified
6008 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
6012 * ID of CoS Queue 5. FF - Invalid id # This ID can be used on
6013 * any subsequent call to an hwrm command that takes a queue id.
6014 * # IDs must always be queried by this command before any use
6015 * by the driver or software. # Any driver or software should
6016 * not make any assumptions about queue IDs. # A value of 0xff
6017 * indicates that the queue is not available. # Available queues
6018 * may not be in sequential order.
6020 uint8_t queue_id5_service_profile;
6021 /* This value is applicable to CoS queues only. */
6022 /* Lossy (best-effort) */
6023 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
6026 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
6029 * Set to 0xFF... (All Fs) if there is no
6030 * service profile specified
6032 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
6036 * ID of CoS Queue 6. FF - Invalid id # This ID can be used on
6037 * any subsequent call to an hwrm command that takes a queue id.
6038 * # IDs must always be queried by this command before any use
6039 * by the driver or software. # Any driver or software should
6040 * not make any assumptions about queue IDs. # A value of 0xff
6041 * indicates that the queue is not available. # Available queues
6042 * may not be in sequential order.
6044 uint8_t queue_id6_service_profile;
6045 /* This value is applicable to CoS queues only. */
6046 /* Lossy (best-effort) */
6047 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
6050 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
6053 * Set to 0xFF... (All Fs) if there is no
6054 * service profile specified
6056 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
6060 * ID of CoS Queue 7. FF - Invalid id # This ID can be used on
6061 * any subsequent call to an hwrm command that takes a queue id.
6062 * # IDs must always be queried by this command before any use
6063 * by the driver or software. # Any driver or software should
6064 * not make any assumptions about queue IDs. # A value of 0xff
6065 * indicates that the queue is not available. # Available queues
6066 * may not be in sequential order.
6068 uint8_t queue_id7_service_profile;
6069 /* This value is applicable to CoS queues only. */
6070 /* Lossy (best-effort) */
6071 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
6074 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
6077 * Set to 0xFF... (All Fs) if there is no
6078 * service profile specified
6080 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
6084 * This field is used in Output records to indicate that the
6085 * output is completely written to RAM. This field should be
6086 * read as '1' to indicate that the output has been completely
6087 * written. When writing a command completion or response to an
6088 * internal processor, the order of writes has to be such that
6089 * this field is written last.
6091 } __attribute__((packed));
6093 /* hwrm_vnic_alloc */
6095 * Description: This VNIC is a resource in the RX side of the chip that is used
6096 * to represent a virtual host "interface". # At the time of VNIC allocation or
6097 * configuration, the function can specify whether it wants the requested VNIC
6098 * to be the default VNIC for the function or not. # If a function requests
6099 * allocation of a VNIC for the first time and a VNIC is successfully allocated
6100 * by the HWRM, then the HWRM shall make the allocated VNIC as the default VNIC
6101 * for that function. # The default VNIC shall be used for the default action
6102 * for a partition or function. # For each VNIC allocated on a function, a
6103 * mapping on the RX side to map the allocated VNIC to source virtual interface
6104 * shall be performed by the HWRM. This should be hidden to the function driver
6105 * requesting the VNIC allocation. This enables broadcast/multicast replication
6106 * with source knockout. # If multicast replication with source knockout is
6107 * enabled, then the internal VNIC to SVIF mapping data structures shall be
6108 * programmed at the time of VNIC allocation.
6110 /* Input (24 bytes) */
6111 struct hwrm_vnic_alloc_input {
6114 * This value indicates what type of request this is. The format
6115 * for the rest of the command is determined by this field.
6119 * This value indicates the what completion ring the request
6120 * will be optionally completed on. If the value is -1, then no
6121 * CR completion will be generated. Any other value must be a
6122 * valid CR ring_id value for this function.
6125 /* This value indicates the command sequence number. */
6128 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6129 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6134 * This is the host address where the response will be written
6135 * when the request is complete. This area must be 16B aligned
6136 * and must be cleared to zero before the request is made.
6140 * When this bit is '1', this VNIC is requested to be the
6141 * default VNIC for this function.
6143 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
6145 } __attribute__((packed));
6147 /* Output (16 bytes) */
6148 struct hwrm_vnic_alloc_output {
6149 uint16_t error_code;
6151 * Pass/Fail or error type Note: receiver to verify the in
6152 * parameters, and fail the call with an error when appropriate
6155 /* This field returns the type of original request. */
6157 /* This field provides original sequence number of the command. */
6160 * This field is the length of the response in bytes. The last
6161 * byte of the response is a valid flag that will read as '1'
6162 * when the command has been completely written to memory.
6165 /* Logical vnic ID */
6171 * This field is used in Output records to indicate that the
6172 * output is completely written to RAM. This field should be
6173 * read as '1' to indicate that the output has been completely
6174 * written. When writing a command completion or response to an
6175 * internal processor, the order of writes has to be such that
6176 * this field is written last.
6178 } __attribute__((packed));
6180 /* hwrm_vnic_free */
6182 * Description: Free a VNIC resource. Idle any resources associated with the
6183 * VNIC as well as the VNIC. Reset and release all resources associated with the
6186 /* Input (24 bytes) */
6187 struct hwrm_vnic_free_input {
6190 * This value indicates what type of request this is. The format
6191 * for the rest of the command is determined by this field.
6195 * This value indicates the what completion ring the request
6196 * will be optionally completed on. If the value is -1, then no
6197 * CR completion will be generated. Any other value must be a
6198 * valid CR ring_id value for this function.
6201 /* This value indicates the command sequence number. */
6204 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6205 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6210 * This is the host address where the response will be written
6211 * when the request is complete. This area must be 16B aligned
6212 * and must be cleared to zero before the request is made.
6215 /* Logical vnic ID */
6217 } __attribute__((packed));
6219 /* Output (16 bytes) */
6220 struct hwrm_vnic_free_output {
6221 uint16_t error_code;
6223 * Pass/Fail or error type Note: receiver to verify the in
6224 * parameters, and fail the call with an error when appropriate
6227 /* This field returns the type of original request. */
6229 /* This field provides original sequence number of the command. */
6232 * This field is the length of the response in bytes. The last
6233 * byte of the response is a valid flag that will read as '1'
6234 * when the command has been completely written to memory.
6242 * This field is used in Output records to indicate that the
6243 * output is completely written to RAM. This field should be
6244 * read as '1' to indicate that the output has been completely
6245 * written. When writing a command completion or response to an
6246 * internal processor, the order of writes has to be such that
6247 * this field is written last.
6249 } __attribute__((packed));
6252 /* Description: Configure the RX VNIC structure. */
6253 /* Input (40 bytes) */
6254 struct hwrm_vnic_cfg_input {
6257 * This value indicates what type of request this is. The format
6258 * for the rest of the command is determined by this field.
6262 * This value indicates the what completion ring the request
6263 * will be optionally completed on. If the value is -1, then no
6264 * CR completion will be generated. Any other value must be a
6265 * valid CR ring_id value for this function.
6268 /* This value indicates the command sequence number. */
6271 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6272 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6277 * This is the host address where the response will be written
6278 * when the request is complete. This area must be 16B aligned
6279 * and must be cleared to zero before the request is made.
6283 * When this bit is '1', the VNIC is requested to be the default
6284 * VNIC for the function.
6286 #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
6288 * When this bit is '1', the VNIC is being configured to strip
6289 * VLAN in the RX path. If set to '0', then VLAN stripping is
6290 * disabled on this VNIC.
6292 #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
6294 * When this bit is '1', the VNIC is being configured to buffer
6295 * receive packets in the hardware until the host posts new
6296 * receive buffers. If set to '0', then bd_stall is being
6297 * configured to be disabled on this VNIC.
6299 #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
6301 * When this bit is '1', the VNIC is being configured to receive
6302 * both RoCE and non-RoCE traffic. If set to '0', then this VNIC
6303 * is not configured to be operating in dual VNIC mode.
6305 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
6307 * When this flag is set to '1', the VNIC is requested to be
6308 * configured to receive only RoCE traffic. If this flag is set
6309 * to '0', then this flag shall be ignored by the HWRM. If
6310 * roce_dual_vnic_mode flag is set to '1', then the HWRM client
6311 * shall not set this flag to '1'.
6313 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
6315 * When a VNIC uses one destination ring group for certain
6316 * application (e.g. Receive Flow Steering) where exact match is
6317 * used to direct packets to a VNIC with one destination ring
6318 * group only, there is no need to configure RSS indirection
6319 * table for that VNIC as only one destination ring group is
6320 * used. This flag is used to enable a mode where RSS is enabled
6321 * in the VNIC using a RSS context for computing RSS hash but
6322 * the RSS indirection table is not configured using
6323 * hwrm_vnic_rss_cfg. If this mode is enabled, then the driver
6324 * should not program RSS indirection table for the RSS context
6325 * that is used for computing RSS hash only.
6327 #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
6330 * This bit must be '1' for the dflt_ring_grp field to be
6333 #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP UINT32_C(0x1)
6334 /* This bit must be '1' for the rss_rule field to be configured. */
6335 #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE UINT32_C(0x2)
6336 /* This bit must be '1' for the cos_rule field to be configured. */
6337 #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE UINT32_C(0x4)
6338 /* This bit must be '1' for the lb_rule field to be configured. */
6339 #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE UINT32_C(0x8)
6340 /* This bit must be '1' for the mru field to be configured. */
6341 #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU UINT32_C(0x10)
6343 /* Logical vnic ID */
6344 uint16_t dflt_ring_grp;
6346 * Default Completion ring for the VNIC. This ring will be
6347 * chosen if packet does not match any RSS rules and if there is
6352 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
6353 * there is no RSS rule.
6357 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
6358 * there is no COS rule.
6362 * RSS ID for load balancing rule/table structure. 0xFF... (All
6363 * Fs) if there is no LB rule.
6367 * The maximum receive unit of the vnic. Each vnic is associated
6368 * with a function. The vnic mru value overwrites the mru
6369 * setting of the associated function. The HWRM shall make sure
6370 * that vnic mru does not exceed the mru of the port the
6371 * function is associated with.
6374 } __attribute__((packed));
6376 /* Output (16 bytes) */
6377 struct hwrm_vnic_cfg_output {
6378 uint16_t error_code;
6380 * Pass/Fail or error type Note: receiver to verify the in
6381 * parameters, and fail the call with an error when appropriate
6384 /* This field returns the type of original request. */
6386 /* This field provides original sequence number of the command. */
6389 * This field is the length of the response in bytes. The last
6390 * byte of the response is a valid flag that will read as '1'
6391 * when the command has been completely written to memory.
6399 * This field is used in Output records to indicate that the
6400 * output is completely written to RAM. This field should be
6401 * read as '1' to indicate that the output has been completely
6402 * written. When writing a command completion or response to an
6403 * internal processor, the order of writes has to be such that
6404 * this field is written last.
6406 } __attribute__((packed));
6408 /* hwrm_vnic_qcfg */
6410 * Description: Query the RX VNIC structure. This function can be used by a PF
6411 * driver to query its own VNIC resource or VNIC resource of its child VF. This
6412 * function can also be used by a VF driver to query its own VNIC resource.
6414 /* Input (32 bytes) */
6415 struct hwrm_vnic_qcfg_input {
6418 * This value indicates what type of request this is. The format
6419 * for the rest of the command is determined by this field.
6423 * This value indicates the what completion ring the request
6424 * will be optionally completed on. If the value is -1, then no
6425 * CR completion will be generated. Any other value must be a
6426 * valid CR ring_id value for this function.
6429 /* This value indicates the command sequence number. */
6432 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6433 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6438 * This is the host address where the response will be written
6439 * when the request is complete. This area must be 16B aligned
6440 * and must be cleared to zero before the request is made.
6443 /* This bit must be '1' for the vf_id_valid field to be configured. */
6444 #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
6446 /* Logical vnic ID */
6448 /* ID of Virtual Function whose VNIC resource is being queried. */
6449 uint16_t unused_0[3];
6450 } __attribute__((packed));
6452 /* Output (32 bytes) */
6453 struct hwrm_vnic_qcfg_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.
6469 uint16_t dflt_ring_grp;
6470 /* Default Completion ring for the VNIC. */
6473 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
6474 * there is no RSS rule.
6478 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
6479 * there is no COS rule.
6483 * RSS ID for load balancing rule/table structure. 0xFF... (All
6484 * Fs) if there is no LB rule.
6487 /* The maximum receive unit of the vnic. */
6492 * When this bit is '1', the VNIC is the default VNIC for the
6495 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT UINT32_C(0x1)
6497 * When this bit is '1', the VNIC is configured to strip VLAN in
6498 * the RX path. If set to '0', then VLAN stripping is disabled
6501 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
6503 * When this bit is '1', the VNIC is configured to buffer
6504 * receive packets in the hardware until the host posts new
6505 * receive buffers. If set to '0', then bd_stall is disabled on
6508 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
6510 * When this bit is '1', the VNIC is configured to receive both
6511 * RoCE and non-RoCE traffic. If set to '0', then this VNIC is
6512 * not configured to operate in dual VNIC mode.
6514 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
6516 * When this flag is set to '1', the VNIC is configured to
6517 * receive only RoCE traffic. When this flag is set to '0', the
6518 * VNIC is not configured to receive only RoCE traffic. If
6519 * roce_dual_vnic_mode flag and this flag both are set to '1',
6520 * then it is an invalid configuration of the VNIC. The HWRM
6521 * should not allow that type of mis-configuration by HWRM
6524 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
6526 * When a VNIC uses one destination ring group for certain
6527 * application (e.g. Receive Flow Steering) where exact match is
6528 * used to direct packets to a VNIC with one destination ring
6529 * group only, there is no need to configure RSS indirection
6530 * table for that VNIC as only one destination ring group is
6531 * used. When this bit is set to '1', then the VNIC is enabled
6532 * in a mode where RSS is enabled in the VNIC using a RSS
6533 * context for computing RSS hash but the RSS indirection table
6534 * is not configured.
6536 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
6543 * This field is used in Output records to indicate that the
6544 * output is completely written to RAM. This field should be
6545 * read as '1' to indicate that the output has been completely
6546 * written. When writing a command completion or response to an
6547 * internal processor, the order of writes has to be such that
6548 * this field is written last.
6550 } __attribute__((packed));
6552 /* hwrm_vnic_rss_cfg */
6553 /* Description: This function is used to enable RSS configuration. */
6554 /* Input (48 bytes) */
6555 struct hwrm_vnic_rss_cfg_input {
6558 * This value indicates what type of request this is. The format
6559 * for the rest of the command is determined by this field.
6563 * This value indicates the what completion ring the request
6564 * will be optionally completed on. If the value is -1, then no
6565 * CR completion will be generated. Any other value must be a
6566 * valid CR ring_id value for this function.
6569 /* This value indicates the command sequence number. */
6572 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6573 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6578 * This is the host address where the response will be written
6579 * when the request is complete. This area must be 16B aligned
6580 * and must be cleared to zero before the request is made.
6584 * When this bit is '1', the RSS hash shall be computed over
6585 * source and destination IPv4 addresses of IPv4 packets.
6587 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
6589 * When this bit is '1', the RSS hash shall be computed over
6590 * source/destination IPv4 addresses and source/destination
6591 * ports of TCP/IPv4 packets.
6593 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
6595 * When this bit is '1', the RSS hash shall be computed over
6596 * source/destination IPv4 addresses and source/destination
6597 * ports of UDP/IPv4 packets.
6599 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
6601 * When this bit is '1', the RSS hash shall be computed over
6602 * source and destination IPv4 addresses of IPv6 packets.
6604 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
6606 * When this bit is '1', the RSS hash shall be computed over
6607 * source/destination IPv6 addresses and source/destination
6608 * ports of TCP/IPv6 packets.
6610 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
6612 * When this bit is '1', the RSS hash shall be computed over
6613 * source/destination IPv6 addresses and source/destination
6614 * ports of UDP/IPv6 packets.
6616 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
6618 uint64_t ring_grp_tbl_addr;
6619 /* This is the address for rss ring group table */
6620 uint64_t hash_key_tbl_addr;
6621 /* This is the address for rss hash key table */
6622 uint16_t rss_ctx_idx;
6623 /* Index to the rss indirection table. */
6624 uint16_t unused_1[3];
6625 } __attribute__((packed));
6627 /* Output (16 bytes) */
6628 struct hwrm_vnic_rss_cfg_output {
6629 uint16_t error_code;
6631 * Pass/Fail or error type Note: receiver to verify the in
6632 * parameters, and fail the call with an error when appropriate
6635 /* This field returns the type of original request. */
6637 /* This field provides original sequence number of the command. */
6640 * This field is the length of the response in bytes. The last
6641 * byte of the response is a valid flag that will read as '1'
6642 * when the command has been completely written to memory.
6650 * This field is used in Output records to indicate that the
6651 * output is completely written to RAM. This field should be
6652 * read as '1' to indicate that the output has been completely
6653 * written. When writing a command completion or response to an
6654 * internal processor, the order of writes has to be such that
6655 * this field is written last.
6657 } __attribute__((packed));
6659 /* hwrm_vnic_plcmodes_cfg */
6661 * Description: This function can be used to set placement mode configuration of
6664 /* Input (40 bytes) */
6666 struct hwrm_vnic_plcmodes_cfg_input {
6669 * This value indicates what type of request this is. The format for the
6670 * rest of the command is determined by this field.
6674 * This value indicates the what completion ring the request will be
6675 * optionally completed on. If the value is -1, then no CR completion
6676 * will be generated. Any other value must be a valid CR ring_id value
6677 * for this function.
6680 /* This value indicates the command sequence number. */
6683 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6684 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6688 * This is the host address where the response will be written when the
6689 * request is complete. This area must be 16B aligned and must be
6690 * cleared to zero before the request is made.
6694 * When this bit is '1', the VNIC shall be configured to use regular
6695 * placement algorithm. By default, the regular placement algorithm
6696 * shall be enabled on the VNIC.
6698 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
6701 * When this bit is '1', the VNIC shall be configured use the jumbo
6702 * placement algorithm.
6704 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
6707 * When this bit is '1', the VNIC shall be configured to enable Header-
6708 * Data split for IPv4 packets according to the following rules: # If
6709 * the packet is identified as TCP/IPv4, then the packet is split at the
6710 * beginning of the TCP payload. # If the packet is identified as
6711 * UDP/IPv4, then the packet is split at the beginning of UDP payload. #
6712 * If the packet is identified as non-TCP and non-UDP IPv4 packet, then
6713 * the packet is split at the beginning of the upper layer protocol
6714 * header carried in the IPv4 packet.
6716 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
6718 * When this bit is '1', the VNIC shall be configured to enable Header-
6719 * Data split for IPv6 packets according to the following rules: # If
6720 * the packet is identified as TCP/IPv6, then the packet is split at the
6721 * beginning of the TCP payload. # If the packet is identified as
6722 * UDP/IPv6, then the packet is split at the beginning of UDP payload. #
6723 * If the packet is identified as non-TCP and non-UDP IPv6 packet, then
6724 * the packet is split at the beginning of the upper layer protocol
6725 * header carried in the IPv6 packet.
6727 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
6729 * When this bit is '1', the VNIC shall be configured to enable Header-
6730 * Data split for FCoE packets at the beginning of FC payload.
6732 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
6734 * When this bit is '1', the VNIC shall be configured to enable Header-
6735 * Data split for RoCE packets at the beginning of RoCE payload (after
6738 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
6741 * This bit must be '1' for the jumbo_thresh_valid field to be
6744 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
6747 * This bit must be '1' for the hds_offset_valid field to be configured.
6749 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
6752 * This bit must be '1' for the hds_threshold_valid field to be
6755 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
6758 /* Logical vnic ID */
6759 uint16_t jumbo_thresh;
6761 * When jumbo placement algorithm is enabled, this value is used to
6762 * determine the threshold for jumbo placement. Packets with length
6763 * larger than this value will be placed according to the jumbo
6764 * placement algorithm.
6766 uint16_t hds_offset;
6768 * This value is used to determine the offset into packet buffer where
6769 * the split data (payload) will be placed according to one of of HDS
6770 * placement algorithm. The lengths of packet buffers provided for split
6771 * data shall be larger than this value.
6773 uint16_t hds_threshold;
6775 * When one of the HDS placement algorithm is enabled, this value is
6776 * used to determine the threshold for HDS placement. Packets with
6777 * length larger than this value will be placed according to the HDS
6778 * placement algorithm. This value shall be in multiple of 4 bytes.
6780 uint16_t unused_0[3];
6781 } __attribute__((packed));
6783 /* Output (16 bytes) */
6785 struct hwrm_vnic_plcmodes_cfg_output {
6786 uint16_t error_code;
6788 * Pass/Fail or error type Note: receiver to verify the in parameters,
6789 * and fail the call with an error when appropriate
6792 /* This field returns the type of original request. */
6794 /* This field provides original sequence number of the command. */
6797 * This field is the length of the response in bytes. The last byte of
6798 * the response is a valid flag that will read as '1' when the command
6799 * has been completely written to memory.
6807 * This field is used in Output records to indicate that the output is
6808 * completely written to RAM. This field should be read as '1' to
6809 * indicate that the output has been completely written. When writing a
6810 * command completion or response to an internal processor, the order of
6811 * writes has to be such that this field is written last.
6813 } __attribute__((packed));
6815 /* hwrm_vnic_plcmodes_qcfg */
6817 * Description: This function can be used to query placement mode configuration
6820 /* Input (24 bytes) */
6822 struct hwrm_vnic_plcmodes_qcfg_input {
6825 * This value indicates what type of request this is. The format for the
6826 * rest of the command is determined by this field.
6830 * This value indicates the what completion ring the request will be
6831 * optionally completed on. If the value is -1, then no CR completion
6832 * will be generated. Any other value must be a valid CR ring_id value
6833 * for this function.
6836 /* This value indicates the command sequence number. */
6839 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6840 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6844 * This is the host address where the response will be written when the
6845 * request is complete. This area must be 16B aligned and must be
6846 * cleared to zero before the request is made.
6849 /* Logical vnic ID */
6851 } __attribute__((packed));
6853 /* Output (24 bytes) */
6855 struct hwrm_vnic_plcmodes_qcfg_output {
6856 uint16_t error_code;
6858 * Pass/Fail or error type Note: receiver to verify the in parameters,
6859 * and fail the call with an error when appropriate
6862 /* This field returns the type of original request. */
6864 /* This field provides original sequence number of the command. */
6867 * This field is the length of the response in bytes. The last byte of
6868 * the response is a valid flag that will read as '1' when the command
6869 * has been completely written to memory.
6873 * When this bit is '1', the VNIC is configured to use regular placement
6876 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
6879 * When this bit is '1', the VNIC is configured to use the jumbo
6880 * placement algorithm.
6882 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
6885 * When this bit is '1', the VNIC is configured to enable Header-Data
6886 * split for IPv4 packets.
6888 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
6890 * When this bit is '1', the VNIC is configured to enable Header-Data
6891 * split for IPv6 packets.
6893 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
6895 * When this bit is '1', the VNIC is configured to enable Header-Data
6896 * split for FCoE packets.
6898 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
6900 * When this bit is '1', the VNIC is configured to enable Header-Data
6901 * split for RoCE packets.
6903 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
6905 * When this bit is '1', the VNIC is configured to be the default VNIC
6906 * of the requesting function.
6908 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC UINT32_C(0x40)
6909 uint16_t jumbo_thresh;
6911 * When jumbo placement algorithm is enabled, this value is used to
6912 * determine the threshold for jumbo placement. Packets with length
6913 * larger than this value will be placed according to the jumbo
6914 * placement algorithm.
6916 uint16_t hds_offset;
6918 * This value is used to determine the offset into packet buffer where
6919 * the split data (payload) will be placed according to one of of HDS
6920 * placement algorithm. The lengths of packet buffers provided for split
6921 * data shall be larger than this value.
6923 uint16_t hds_threshold;
6925 * When one of the HDS placement algorithm is enabled, this value is
6926 * used to determine the threshold for HDS placement. Packets with
6927 * length larger than this value will be placed according to the HDS
6928 * placement algorithm. This value shall be in multiple of 4 bytes.
6937 * This field is used in Output records to indicate that the output is
6938 * completely written to RAM. This field should be read as '1' to
6939 * indicate that the output has been completely written. When writing a
6940 * command completion or response to an internal processor, the order of
6941 * writes has to be such that this field is written last.
6943 } __attribute__((packed));
6945 /* hwrm_vnic_rss_cos_lb_ctx_alloc */
6946 /* Description: This function is used to allocate COS/Load Balance context. */
6947 /* Input (16 bytes) */
6948 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
6951 * This value indicates what type of request this is. The format
6952 * for the rest of the command is determined by this field.
6956 * This value indicates the what completion ring the request
6957 * will be optionally completed on. If the value is -1, then no
6958 * CR completion will be generated. Any other value must be a
6959 * valid CR ring_id value for this function.
6962 /* This value indicates the command sequence number. */
6965 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6966 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6971 * This is the host address where the response will be written
6972 * when the request is complete. This area must be 16B aligned
6973 * and must be cleared to zero before the request is made.
6975 } __attribute__((packed));
6977 /* Output (16 bytes) */
6978 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
6979 uint16_t error_code;
6981 * Pass/Fail or error type Note: receiver to verify the in
6982 * parameters, and fail the call with an error when appropriate
6985 /* This field returns the type of original request. */
6987 /* This field provides original sequence number of the command. */
6990 * This field is the length of the response in bytes. The last
6991 * byte of the response is a valid flag that will read as '1'
6992 * when the command has been completely written to memory.
6994 uint16_t rss_cos_lb_ctx_id;
6995 /* rss_cos_lb_ctx_id is 16 b */
7003 * This field is used in Output records to indicate that the
7004 * output is completely written to RAM. This field should be
7005 * read as '1' to indicate that the output has been completely
7006 * written. When writing a command completion or response to an
7007 * internal processor, the order of writes has to be such that
7008 * this field is written last.
7010 } __attribute__((packed));
7012 /* hwrm_vnic_rss_cos_lb_ctx_free */
7013 /* Description: This function can be used to free COS/Load Balance context. */
7014 /* Input (24 bytes) */
7015 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
7018 * This value indicates what type of request this is. The format
7019 * for the rest of the command is determined by this field.
7023 * This value indicates the what completion ring the request
7024 * will be optionally completed on. If the value is -1, then no
7025 * CR completion will be generated. Any other value must be a
7026 * valid CR ring_id value for this function.
7029 /* This value indicates the command sequence number. */
7032 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7033 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7038 * This is the host address where the response will be written
7039 * when the request is complete. This area must be 16B aligned
7040 * and must be cleared to zero before the request is made.
7042 uint16_t rss_cos_lb_ctx_id;
7043 /* rss_cos_lb_ctx_id is 16 b */
7044 uint16_t unused_0[3];
7045 } __attribute__((packed));
7047 /* Output (16 bytes) */
7048 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
7049 uint16_t error_code;
7051 * Pass/Fail or error type Note: receiver to verify the in
7052 * parameters, and fail the call with an error when appropriate
7055 /* This field returns the type of original request. */
7057 /* This field provides original sequence number of the command. */
7060 * This field is the length of the response in bytes. The last
7061 * byte of the response is a valid flag that will read as '1'
7062 * when the command has been completely written to memory.
7070 * This field is used in Output records to indicate that the
7071 * output is completely written to RAM. This field should be
7072 * read as '1' to indicate that the output has been completely
7073 * written. When writing a command completion or response to an
7074 * internal processor, the order of writes has to be such that
7075 * this field is written last.
7077 } __attribute__((packed));
7079 /* hwrm_vnic_tpa_cfg */
7080 /* Description: This function is used to enable/configure TPA on the VNIC. */
7081 /* Input (40 bytes) */
7082 struct hwrm_vnic_tpa_cfg_input {
7085 * This value indicates what type of request this is. The format
7086 * for the rest of the command is determined by this field.
7090 * This value indicates the what completion ring the request
7091 * will be optionally completed on. If the value is -1, then no
7092 * CR completion will be generated. Any other value must be a
7093 * valid CR ring_id value for this function.
7096 /* This value indicates the command sequence number. */
7099 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7100 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7105 * This is the host address where the response will be written
7106 * when the request is complete. This area must be 16B aligned
7107 * and must be cleared to zero before the request is made.
7111 * When this bit is '1', the VNIC shall be configured to perform
7112 * transparent packet aggregation (TPA) of non-tunneled TCP
7115 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA UINT32_C(0x1)
7117 * When this bit is '1', the VNIC shall be configured to perform
7118 * transparent packet aggregation (TPA) of tunneled TCP packets.
7120 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA UINT32_C(0x2)
7122 * When this bit is '1', the VNIC shall be configured to perform
7123 * transparent packet aggregation (TPA) according to Windows
7124 * Receive Segment Coalescing (RSC) rules.
7126 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE UINT32_C(0x4)
7128 * When this bit is '1', the VNIC shall be configured to perform
7129 * transparent packet aggregation (TPA) according to Linux
7130 * Generic Receive Offload (GRO) rules.
7132 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO UINT32_C(0x8)
7134 * When this bit is '1', the VNIC shall be configured to perform
7135 * transparent packet aggregation (TPA) for TCP packets with IP
7136 * ECN set to non-zero.
7138 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN UINT32_C(0x10)
7140 * When this bit is '1', the VNIC shall be configured to perform
7141 * transparent packet aggregation (TPA) for GRE tunneled TCP
7142 * packets only if all packets have the same GRE sequence.
7144 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
7147 * When this bit is '1' and the GRO mode is enabled, the VNIC
7148 * shall be configured to perform transparent packet aggregation
7149 * (TPA) for TCP/IPv4 packets with consecutively increasing
7150 * IPIDs. In other words, the last packet that is being
7151 * aggregated to an already existing aggregation context shall
7152 * have IPID 1 more than the IPID of the last packet that was
7153 * aggregated in that aggregation context.
7155 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK UINT32_C(0x40)
7157 * When this bit is '1' and the GRO mode is enabled, the VNIC
7158 * shall be configured to perform transparent packet aggregation
7159 * (TPA) for TCP packets with the same TTL (IPv4) or Hop limit
7162 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK UINT32_C(0x80)
7164 /* This bit must be '1' for the max_agg_segs field to be configured. */
7165 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS UINT32_C(0x1)
7166 /* This bit must be '1' for the max_aggs field to be configured. */
7167 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS UINT32_C(0x2)
7169 * This bit must be '1' for the max_agg_timer field to be
7172 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER UINT32_C(0x4)
7173 /* This bit must be '1' for the min_agg_len field to be configured. */
7174 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN UINT32_C(0x8)
7176 /* Logical vnic ID */
7177 uint16_t max_agg_segs;
7179 * This is the maximum number of TCP segments that can be
7180 * aggregated (unit is Log2). Max value is 31.
7183 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1 UINT32_C(0x0)
7185 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2 UINT32_C(0x1)
7187 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4 UINT32_C(0x2)
7189 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8 UINT32_C(0x3)
7190 /* Any segment size larger than this is not valid */
7191 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
7194 * This is the maximum number of aggregations this VNIC is
7195 * allowed (unit is Log2). Max value is 7
7198 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1 UINT32_C(0x0)
7199 /* 2 aggregations */
7200 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2 UINT32_C(0x1)
7201 /* 4 aggregations */
7202 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4 UINT32_C(0x2)
7203 /* 8 aggregations */
7204 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8 UINT32_C(0x3)
7205 /* 16 aggregations */
7206 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16 UINT32_C(0x4)
7207 /* Any aggregation size larger than this is not valid */
7208 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
7211 uint32_t max_agg_timer;
7213 * This is the maximum amount of time allowed for an aggregation
7214 * context to complete after it was initiated.
7216 uint32_t min_agg_len;
7218 * This is the minimum amount of payload length required to
7219 * start an aggregation context.
7221 } __attribute__((packed));
7223 /* Output (16 bytes) */
7224 struct hwrm_vnic_tpa_cfg_output {
7225 uint16_t error_code;
7227 * Pass/Fail or error type Note: receiver to verify the in
7228 * parameters, and fail the call with an error when appropriate
7231 /* This field returns the type of original request. */
7233 /* This field provides original sequence number of the command. */
7236 * This field is the length of the response in bytes. The last
7237 * byte of the response is a valid flag that will read as '1'
7238 * when the command has been completely written to memory.
7246 * This field is used in Output records to indicate that the
7247 * output is completely written to RAM. This field should be
7248 * read as '1' to indicate that the output has been completely
7249 * written. When writing a command completion or response to an
7250 * internal processor, the order of writes has to be such that
7251 * this field is written last.
7253 } __attribute__((packed));
7255 /* hwrm_ring_alloc */
7257 * Description: This command allocates and does basic preparation for a ring.
7259 /* Input (80 bytes) */
7260 struct hwrm_ring_alloc_input {
7263 * This value indicates what type of request this is. The format
7264 * for the rest of the command is determined by this field.
7268 * This value indicates the what completion ring the request
7269 * will be optionally completed on. If the value is -1, then no
7270 * CR completion will be generated. Any other value must be a
7271 * valid CR ring_id value for this function.
7274 /* This value indicates the command sequence number. */
7277 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7278 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7283 * This is the host address where the response will be written
7284 * when the request is complete. This area must be 16B aligned
7285 * and must be cleared to zero before the request is made.
7288 /* This bit must be '1' for the Reserved1 field to be configured. */
7289 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED1 UINT32_C(0x1)
7290 /* This bit must be '1' for the ring_arb_cfg field to be configured. */
7291 #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG UINT32_C(0x2)
7292 /* This bit must be '1' for the Reserved3 field to be configured. */
7293 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED3 UINT32_C(0x4)
7295 * This bit must be '1' for the stat_ctx_id_valid field to be
7298 #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID UINT32_C(0x8)
7299 /* This bit must be '1' for the Reserved4 field to be configured. */
7300 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED4 UINT32_C(0x10)
7301 /* This bit must be '1' for the max_bw_valid field to be configured. */
7302 #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID UINT32_C(0x20)
7305 /* L2 Completion Ring (CR) */
7306 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
7308 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX UINT32_C(0x1)
7310 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX UINT32_C(0x2)
7311 /* RoCE Notification Completion Ring (ROCE_CR) */
7312 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
7315 uint64_t page_tbl_addr;
7316 /* This value is a pointer to the page table for the Ring. */
7318 /* First Byte Offset of the first entry in the first page. */
7321 * Actual page size in 2^page_size. The supported range is
7322 * increments in powers of 2 from 16 bytes to 1GB. - 4 = 16 B
7323 * Page size is 16 B. - 12 = 4 KB Page size is 4 KB. - 13 = 8 KB
7324 * Page size is 8 KB. - 16 = 64 KB Page size is 64 KB. - 21 = 2
7325 * MB Page size is 2 MB. - 22 = 4 MB Page size is 4 MB. - 30 = 1
7326 * GB Page size is 1 GB.
7328 uint8_t page_tbl_depth;
7330 * This value indicates the depth of page table. For this
7331 * version of the specification, value other than 0 or 1 shall
7332 * be considered as an invalid value. When the page_tbl_depth =
7333 * 0, then it is treated as a special case with the following.
7334 * 1. FBO and page size fields are not valid. 2. page_tbl_addr
7335 * is the physical address of the first element of the ring.
7341 * Number of 16B units in the ring. Minimum size for a ring is
7344 uint16_t logical_id;
7346 * Logical ring number for the ring to be allocated. This value
7347 * determines the position in the doorbell area where the update
7348 * to the ring will be made. For completion rings, this value is
7349 * also the MSI-X vector number for the function the completion
7350 * ring is associated with.
7352 uint16_t cmpl_ring_id;
7354 * This field is used only when ring_type is a TX ring. This
7355 * value indicates what completion ring the TX ring is
7360 * This field is used only when ring_type is a TX ring. This
7361 * value indicates what CoS queue the TX ring is associated
7367 /* This field is reserved for the future use. It shall be set to 0. */
7368 uint16_t ring_arb_cfg;
7370 * This field is used only when ring_type is a TX ring. This
7371 * field is used to configure arbitration related parameters for
7374 /* Arbitration policy used for the ring. */
7375 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK UINT32_C(0xf)
7376 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT 0
7378 * Use strict priority for the TX ring. Priority
7379 * value is specified in arb_policy_param
7381 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
7382 (UINT32_C(0x1) << 0)
7384 * Use weighted fair queue arbitration for the
7385 * TX ring. Weight is specified in
7388 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
7389 (UINT32_C(0x2) << 0)
7390 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
7391 RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
7392 /* Reserved field. */
7393 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK UINT32_C(0xf0)
7394 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT 4
7396 * Arbitration policy specific parameter. # For strict priority
7397 * arbitration policy, this field represents a priority value.
7398 * If set to 0, then the priority is not specified and the HWRM
7399 * is allowed to select any priority for this TX ring. # For
7400 * weighted fair queue arbitration policy, this field represents
7401 * a weight value. If set to 0, then the weight is not specified
7402 * and the HWRM is allowed to select any weight for this TX
7405 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
7407 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
7411 /* This field is reserved for the future use. It shall be set to 0. */
7412 uint32_t stat_ctx_id;
7414 * This field is used only when ring_type is a TX ring. This
7415 * input indicates what statistics context this ring should be
7419 /* This field is reserved for the future use. It shall be set to 0. */
7422 * This field is used only when ring_type is a TX ring to
7423 * specify maximum BW allocated to the TX ring. The HWRM will
7424 * translate this value into byte counter and time interval used
7425 * for this ring inside the device.
7427 /* The bandwidth value. */
7428 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
7429 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT 0
7430 /* The granularity of the value (bits or bytes). */
7431 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
7432 /* Value is in bits. */
7433 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
7434 /* Value is in bytes. */
7435 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
7436 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
7437 RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
7438 /* bw_value_unit is 3 b */
7439 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
7440 UINT32_C(0xe0000000)
7441 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
7442 /* Value is in Mb or MB (base 10). */
7443 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
7444 (UINT32_C(0x0) << 29)
7445 /* Value is in Kb or KB (base 10). */
7446 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
7447 (UINT32_C(0x2) << 29)
7448 /* Value is in bits or bytes. */
7449 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
7450 (UINT32_C(0x4) << 29)
7451 /* Value is in Gb or GB (base 10). */
7452 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
7453 (UINT32_C(0x6) << 29)
7454 /* Value is in 1/100th of a percentage of total bandwidth. */
7455 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
7456 (UINT32_C(0x1) << 29)
7458 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
7459 (UINT32_C(0x7) << 29)
7460 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
7461 RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
7464 * This field is used only when ring_type is a Completion ring.
7465 * This value indicates what interrupt mode should be used on
7466 * this completion ring. Note: In the legacy interrupt mode, no
7467 * more than 16 completion rings are allowed.
7470 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
7472 #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD UINT32_C(0x1)
7474 #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX UINT32_C(0x2)
7475 /* No Interrupt - Polled mode */
7476 #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL UINT32_C(0x3)
7477 uint8_t unused_8[3];
7478 } __attribute__((packed));
7480 /* Output (16 bytes) */
7481 struct hwrm_ring_alloc_output {
7482 uint16_t error_code;
7484 * Pass/Fail or error type Note: receiver to verify the in
7485 * parameters, and fail the call with an error when appropriate
7488 /* This field returns the type of original request. */
7490 /* This field provides original sequence number of the command. */
7493 * This field is the length of the response in bytes. The last
7494 * byte of the response is a valid flag that will read as '1'
7495 * when the command has been completely written to memory.
7499 * Physical number of ring allocated. This value shall be unique
7502 uint16_t logical_ring_id;
7503 /* Logical number of ring allocated. */
7509 * This field is used in Output records to indicate that the
7510 * output is completely written to RAM. This field should be
7511 * read as '1' to indicate that the output has been completely
7512 * written. When writing a command completion or response to an
7513 * internal processor, the order of writes has to be such that
7514 * this field is written last.
7516 } __attribute__((packed));
7518 /* hwrm_ring_free */
7520 * Description: This command is used to free a ring and associated resources.
7521 * With QoS and DCBx agents, it is possible the traffic classes will be moved
7522 * from one CoS queue to another. When this occurs, the driver shall call
7523 * 'hwrm_ring_free' to free the allocated rings and then call 'hwrm_ring_alloc'
7524 * to re-allocate each ring and assign it to a new CoS queue. hwrm_ring_free
7525 * shall be called on a ring only after it has been idle for 500ms or more and
7526 * no frames have been posted to the ring during this time. All frames queued
7527 * for transmission shall be completed and at least 500ms time elapsed from the
7528 * last completion before calling this command.
7530 /* Input (24 bytes) */
7531 struct hwrm_ring_free_input {
7534 * This value indicates what type of request this is. The format
7535 * for the rest of the command is determined by this field.
7539 * This value indicates the what completion ring the request
7540 * will be optionally completed on. If the value is -1, then no
7541 * CR completion will be generated. Any other value must be a
7542 * valid CR ring_id value for this function.
7545 /* This value indicates the command sequence number. */
7548 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7549 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7554 * This is the host address where the response will be written
7555 * when the request is complete. This area must be 16B aligned
7556 * and must be cleared to zero before the request is made.
7560 /* L2 Completion Ring (CR) */
7561 #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
7563 #define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1)
7565 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2)
7566 /* RoCE Notification Completion Ring (ROCE_CR) */
7567 #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
7570 /* Physical number of ring allocated. */
7572 } __attribute__((packed));
7574 /* Output (16 bytes) */
7575 struct hwrm_ring_free_output {
7576 uint16_t error_code;
7578 * Pass/Fail or error type Note: receiver to verify the in
7579 * parameters, and fail the call with an error when appropriate
7582 /* This field returns the type of original request. */
7584 /* This field provides original sequence number of the command. */
7587 * This field is the length of the response in bytes. The last
7588 * byte of the response is a valid flag that will read as '1'
7589 * when the command has been completely written to memory.
7597 * This field is used in Output records to indicate that the
7598 * output is completely written to RAM. This field should be
7599 * read as '1' to indicate that the output has been completely
7600 * written. When writing a command completion or response to an
7601 * internal processor, the order of writes has to be such that
7602 * this field is written last.
7604 } __attribute__((packed));
7606 /* hwrm_ring_grp_alloc */
7608 * Description: This API allocates and does basic preparation for a ring group.
7610 /* Input (24 bytes) */
7611 struct hwrm_ring_grp_alloc_input {
7614 * This value indicates what type of request this is. The format
7615 * for the rest of the command is determined by this field.
7619 * This value indicates the what completion ring the request
7620 * will be optionally completed on. If the value is -1, then no
7621 * CR completion will be generated. Any other value must be a
7622 * valid CR ring_id value for this function.
7625 /* This value indicates the command sequence number. */
7628 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7629 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7634 * This is the host address where the response will be written
7635 * when the request is complete. This area must be 16B aligned
7636 * and must be cleared to zero before the request is made.
7639 /* This value identifies the CR associated with the ring group. */
7641 /* This value identifies the main RR associated with the ring group. */
7644 * This value identifies the aggregation RR associated with the
7645 * ring group. If this value is 0xFF... (All Fs), then no
7646 * Aggregation ring will be set.
7650 * This value identifies the statistics context associated with
7653 } __attribute__((packed));
7655 /* Output (16 bytes) */
7656 struct hwrm_ring_grp_alloc_output {
7657 uint16_t error_code;
7659 * Pass/Fail or error type Note: receiver to verify the in
7660 * parameters, and fail the call with an error when appropriate
7663 /* This field returns the type of original request. */
7665 /* This field provides original sequence number of the command. */
7668 * This field is the length of the response in bytes. The last
7669 * byte of the response is a valid flag that will read as '1'
7670 * when the command has been completely written to memory.
7672 uint32_t ring_group_id;
7674 * This is the ring group ID value. Use this value to program
7675 * the default ring group for the VNIC or as table entries in an
7683 * This field is used in Output records to indicate that the
7684 * output is completely written to RAM. This field should be
7685 * read as '1' to indicate that the output has been completely
7686 * written. When writing a command completion or response to an
7687 * internal processor, the order of writes has to be such that
7688 * this field is written last.
7690 } __attribute__((packed));
7692 /* hwrm_ring_grp_free */
7694 * Description: This API frees a ring group and associated resources. # If a
7695 * ring in the ring group is reset or free, then the associated rings in the
7696 * ring group shall also be reset/free using hwrm_ring_free. # A function driver
7697 * shall always use hwrm_ring_grp_free after freeing all rings in a group. # As
7698 * a part of executing this command, the HWRM shall reset all associated ring
7701 /* Input (24 bytes) */
7702 struct hwrm_ring_grp_free_input {
7705 * This value indicates what type of request this is. The format
7706 * for the rest of the command is determined by this field.
7710 * This value indicates the what completion ring the request
7711 * will be optionally completed on. If the value is -1, then no
7712 * CR completion will be generated. Any other value must be a
7713 * valid CR ring_id value for this function.
7716 /* This value indicates the command sequence number. */
7719 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7720 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7725 * This is the host address where the response will be written
7726 * when the request is complete. This area must be 16B aligned
7727 * and must be cleared to zero before the request is made.
7729 uint32_t ring_group_id;
7730 /* This is the ring group ID value. */
7732 } __attribute__((packed));
7734 /* Output (16 bytes) */
7735 struct hwrm_ring_grp_free_output {
7736 uint16_t error_code;
7738 * Pass/Fail or error type Note: receiver to verify the in
7739 * parameters, and fail the call with an error when appropriate
7742 /* This field returns the type of original request. */
7744 /* This field provides original sequence number of the command. */
7747 * This field is the length of the response in bytes. The last
7748 * byte of the response is a valid flag that will read as '1'
7749 * when the command has been completely written to memory.
7757 * This field is used in Output records to indicate that the
7758 * output is completely written to RAM. This field should be
7759 * read as '1' to indicate that the output has been completely
7760 * written. When writing a command completion or response to an
7761 * internal processor, the order of writes has to be such that
7762 * this field is written last.
7764 } __attribute__((packed));
7766 /* hwrm_cfa_l2_filter_alloc */
7768 * Description: An L2 filter is a filter resource that is used to identify a
7769 * vnic or ring for a packet based on layer 2 fields. Layer 2 fields for
7770 * encapsulated packets include both outer L2 header and/or inner l2 header of
7771 * encapsulated packet. The L2 filter resource covers the following OS specific
7772 * L2 filters. Linux/FreeBSD (per function): # Broadcast enable/disable # List
7773 * of individual multicast filters # All multicast enable/disable filter #
7774 * Unicast filters # Promiscuous mode VMware: # Broadcast enable/disable (per
7775 * physical function) # All multicast enable/disable (per function) # Unicast
7776 * filters per ring or vnic # Promiscuous mode per PF Windows: # Broadcast
7777 * enable/disable (per physical function) # List of individual multicast filters
7778 * (Driver needs to advertise the maximum number of filters supported) # All
7779 * multicast enable/disable per physical function # Unicast filters per vnic #
7780 * Promiscuous mode per PF Implementation notes on the use of VNIC in this
7781 * command: # By default, these filters belong to default vnic for the function.
7782 * # Once these filters are set up, only destination VNIC can be modified. # If
7783 * the destination VNIC is not specified in this command, then the HWRM shall
7784 * only create an l2 context id. HWRM Implementation notes for multicast
7785 * filters: # The hwrm_filter_alloc command can be used to set up multicast
7786 * filters (perfect match or partial match). Each individual function driver can
7787 * set up multicast filters independently. # The HWRM needs to keep track of
7788 * multicast filters set up by function drivers and maintain multicast group
7789 * replication records to enable a subset of functions to receive traffic for a
7790 * specific multicast address. # When a specific multicast filter cannot be set,
7791 * the HWRM shall return an error. In this error case, the driver should fall
7792 * back to using one general filter (rather than specific) for all multicast
7793 * traffic. # When the SR-IOV is enabled, the HWRM needs to additionally track
7794 * source knockout per multicast group record. Examples of setting unicast
7795 * filters: For a unicast MAC based filter, one can use a combination of the
7796 * fields and masks provided in this command to set up the filter. Below are
7797 * some examples: # MAC + no VLAN filter: This filter is used to identify
7798 * traffic that does not contain any VLAN tags and matches destination (or
7799 * source) MAC address. This filter can be set up by setting only l2_addr field
7800 * to be a valid field. All other fields are not valid. The following value is
7801 * set for l2_addr. l2_addr = MAC # MAC + Any VLAN filter: This filter is used
7802 * to identify traffic that carries single VLAN tag and matches (destination or
7803 * source) MAC address. This filter can be set up by setting only l2_addr and
7804 * l2_ovlan_mask fields to be valid fields. All other fields are not valid. The
7805 * following values are set for those two valid fields. l2_addr = MAC,
7806 * l2_ovlan_mask = 0xFFFF # MAC + no VLAN or VLAN ID=0: This filter is used to
7807 * identify untagged traffic that does not contain any VLAN tags or a VLAN tag
7808 * with VLAN ID = 0 and matches destination (or source) MAC address. This filter
7809 * can be set up by setting only l2_addr and l2_ovlan fields to be valid fields.
7810 * All other fields are not valid. The following value are set for l2_addr and
7811 * l2_ovlan. l2_addr = MAC, l2_ovlan = 0x0 # MAC + no VLAN or any VLAN: This
7812 * filter is used to identify traffic that contains zero or 1 VLAN tag and
7813 * matches destination (or source) MAC address. This filter can be set up by
7814 * setting only l2_addr, l2_ovlan, and l2_mask fields to be valid fields. All
7815 * other fields are not valid. The following value are set for l2_addr,
7816 * l2_ovlan, and l2_mask fields. l2_addr = MAC, l2_ovlan = 0x0, l2_ovlan_mask =
7817 * 0xFFFF # MAC + VLAN ID filter: This filter can be set up by setting only
7818 * l2_addr, l2_ovlan, and l2_ovlan_mask fields to be valid fields. All other
7819 * fields are not valid. The following values are set for those three valid
7820 * fields. l2_addr = MAC, l2_ovlan = VLAN ID, l2_ovlan_mask = 0xF000
7822 /* Input (96 bytes) */
7823 struct hwrm_cfa_l2_filter_alloc_input {
7826 * This value indicates what type of request this is. The format
7827 * for the rest of the command is determined by this field.
7831 * This value indicates the what completion ring the request
7832 * will be optionally completed on. If the value is -1, then no
7833 * CR completion will be generated. Any other value must be a
7834 * valid CR ring_id value for this function.
7837 /* This value indicates the command sequence number. */
7840 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7841 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7846 * This is the host address where the response will be written
7847 * when the request is complete. This area must be 16B aligned
7848 * and must be cleared to zero before the request is made.
7852 * Enumeration denoting the RX, TX type of the resource. This
7853 * enumeration is used for resources that are similar for both
7854 * TX and RX paths of the chip.
7856 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
7858 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
7859 (UINT32_C(0x0) << 0)
7861 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
7862 (UINT32_C(0x1) << 0)
7863 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
7864 CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
7866 * Setting of this flag indicates the applicability to the
7869 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x2)
7871 * Setting of this flag indicates drop action. If this flag is
7872 * not set, then it should be considered accept action.
7874 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x4)
7876 * If this flag is set, all t_l2_* fields are invalid and they
7877 * should not be specified. If this flag is set, then l2_*
7878 * fields refer to fields of outermost L2 header.
7880 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST UINT32_C(0x8)
7882 /* This bit must be '1' for the l2_addr field to be configured. */
7883 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR UINT32_C(0x1)
7884 /* This bit must be '1' for the l2_addr_mask field to be configured. */
7885 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
7887 /* This bit must be '1' for the l2_ovlan field to be configured. */
7888 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN UINT32_C(0x4)
7890 * This bit must be '1' for the l2_ovlan_mask field to be
7893 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
7895 /* This bit must be '1' for the l2_ivlan field to be configured. */
7896 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN UINT32_C(0x10)
7898 * This bit must be '1' for the l2_ivlan_mask field to be
7901 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
7903 /* This bit must be '1' for the t_l2_addr field to be configured. */
7904 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR UINT32_C(0x40)
7906 * This bit must be '1' for the t_l2_addr_mask field to be
7909 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
7911 /* This bit must be '1' for the t_l2_ovlan field to be configured. */
7912 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
7915 * This bit must be '1' for the t_l2_ovlan_mask field to be
7918 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
7920 /* This bit must be '1' for the t_l2_ivlan field to be configured. */
7921 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
7924 * This bit must be '1' for the t_l2_ivlan_mask field to be
7927 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
7929 /* This bit must be '1' for the src_type field to be configured. */
7930 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE UINT32_C(0x1000)
7931 /* This bit must be '1' for the src_id field to be configured. */
7932 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID UINT32_C(0x2000)
7933 /* This bit must be '1' for the tunnel_type field to be configured. */
7934 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
7936 /* This bit must be '1' for the dst_id field to be configured. */
7937 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x8000)
7939 * This bit must be '1' for the mirror_vnic_id field to be
7942 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
7946 * This value sets the match value for the L2 MAC address.
7947 * Destination MAC address for RX path. Source MAC address for
7952 uint8_t l2_addr_mask[6];
7954 * This value sets the mask value for the L2 address. A value of
7955 * 0 will mask the corresponding bit from compare.
7958 /* This value sets VLAN ID value for outer VLAN. */
7959 uint16_t l2_ovlan_mask;
7961 * This value sets the mask value for the ovlan id. A value of 0
7962 * will mask the corresponding bit from compare.
7965 /* This value sets VLAN ID value for inner VLAN. */
7966 uint16_t l2_ivlan_mask;
7968 * This value sets the mask value for the ivlan id. A value of 0
7969 * will mask the corresponding bit from compare.
7973 uint8_t t_l2_addr[6];
7975 * This value sets the match value for the tunnel L2 MAC
7976 * address. Destination MAC address for RX path. Source MAC
7977 * address for TX path.
7981 uint8_t t_l2_addr_mask[6];
7983 * This value sets the mask value for the tunnel L2 address. A
7984 * value of 0 will mask the corresponding bit from compare.
7986 uint16_t t_l2_ovlan;
7987 /* This value sets VLAN ID value for tunnel outer VLAN. */
7988 uint16_t t_l2_ovlan_mask;
7990 * This value sets the mask value for the tunnel ovlan id. A
7991 * value of 0 will mask the corresponding bit from compare.
7993 uint16_t t_l2_ivlan;
7994 /* This value sets VLAN ID value for tunnel inner VLAN. */
7995 uint16_t t_l2_ivlan_mask;
7997 * This value sets the mask value for the tunnel ivlan id. A
7998 * value of 0 will mask the corresponding bit from compare.
8001 /* This value identifies the type of source of the packet. */
8003 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
8004 /* Physical function */
8005 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF UINT32_C(0x1)
8006 /* Virtual function */
8007 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF UINT32_C(0x2)
8008 /* Virtual NIC of a function */
8009 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC UINT32_C(0x3)
8010 /* Embedded processor for CFA management */
8011 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG UINT32_C(0x4)
8012 /* Embedded processor for OOB management */
8013 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE UINT32_C(0x5)
8014 /* Embedded processor for RoCE */
8015 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO UINT32_C(0x6)
8016 /* Embedded processor for network proxy functions */
8017 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG UINT32_C(0x7)
8021 * This value is the id of the source. For a network port, it
8022 * represents port_id. For a physical function, it represents
8023 * fid. For a virtual function, it represents vf_id. For a vnic,
8024 * it represents vnic_id. For embedded processors, this id is
8025 * not valid. Notes: 1. The function ID is implied if it src_id
8026 * is not provided for a src_type that is either
8028 uint8_t tunnel_type;
8031 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
8033 /* Virtual eXtensible Local Area Network (VXLAN) */
8034 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
8037 * Network Virtualization Generic Routing
8038 * Encapsulation (NVGRE)
8040 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
8043 * Generic Routing Encapsulation (GRE) inside
8046 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
8048 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
8049 /* Generic Network Virtualization Encapsulation (Geneve) */
8050 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
8051 /* Multi-Protocol Lable Switching (MPLS) */
8052 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
8053 /* Stateless Transport Tunnel (STT) */
8054 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
8056 * Generic Routing Encapsulation (GRE) inside IP
8059 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
8060 /* Any tunneled traffic */
8061 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
8066 * If set, this value shall represent the Logical VNIC ID of the
8067 * destination VNIC for the RX path and network port id of the
8068 * destination port for the TX path.
8070 uint16_t mirror_vnic_id;
8071 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
8074 * This hint is provided to help in placing the filter in the
8078 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
8080 /* Above the given filter */
8081 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
8083 /* Below the given filter */
8084 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
8086 /* As high as possible */
8087 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX UINT32_C(0x3)
8088 /* As low as possible */
8089 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN UINT32_C(0x4)
8092 uint64_t l2_filter_id_hint;
8094 * This is the ID of the filter that goes along with the
8095 * pri_hint. This field is valid only for the following values.
8096 * 1 - Above the given filter 2 - Below the given filter
8098 } __attribute__((packed));
8100 /* Output (24 bytes) */
8101 struct hwrm_cfa_l2_filter_alloc_output {
8102 uint16_t error_code;
8104 * Pass/Fail or error type Note: receiver to verify the in
8105 * parameters, and fail the call with an error when appropriate
8108 /* This field returns the type of original request. */
8110 /* This field provides original sequence number of the command. */
8113 * This field is the length of the response in bytes. The last
8114 * byte of the response is a valid flag that will read as '1'
8115 * when the command has been completely written to memory.
8117 uint64_t l2_filter_id;
8119 * This value identifies a set of CFA data structures used for
8124 * This is the ID of the flow associated with this filter. This
8125 * value shall be used to match and associate the flow
8126 * identifier returned in completion records. A value of
8127 * 0xFFFFFFFF shall indicate no flow id.
8134 * This field is used in Output records to indicate that the
8135 * output is completely written to RAM. This field should be
8136 * read as '1' to indicate that the output has been completely
8137 * written. When writing a command completion or response to an
8138 * internal processor, the order of writes has to be such that
8139 * this field is written last.
8141 } __attribute__((packed));
8143 /* hwrm_cfa_l2_filter_free */
8145 * Description: Free a L2 filter. The HWRM shall free all associated filter
8146 * resources with the L2 filter.
8148 /* Input (24 bytes) */
8149 struct hwrm_cfa_l2_filter_free_input {
8152 * This value indicates what type of request this is. The format
8153 * for the rest of the command is determined by this field.
8157 * This value indicates the what completion ring the request
8158 * will be optionally completed on. If the value is -1, then no
8159 * CR completion will be generated. Any other value must be a
8160 * valid CR ring_id value for this function.
8163 /* This value indicates the command sequence number. */
8166 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8167 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8172 * This is the host address where the response will be written
8173 * when the request is complete. This area must be 16B aligned
8174 * and must be cleared to zero before the request is made.
8176 uint64_t l2_filter_id;
8178 * This value identifies a set of CFA data structures used for
8181 } __attribute__((packed));
8183 /* Output (16 bytes) */
8184 struct hwrm_cfa_l2_filter_free_output {
8185 uint16_t error_code;
8187 * Pass/Fail or error type Note: receiver to verify the in
8188 * parameters, and fail the call with an error when appropriate
8191 /* This field returns the type of original request. */
8193 /* This field provides original sequence number of the command. */
8196 * This field is the length of the response in bytes. The last
8197 * byte of the response is a valid flag that will read as '1'
8198 * when the command has been completely written to memory.
8206 * This field is used in Output records to indicate that the
8207 * output is completely written to RAM. This field should be
8208 * read as '1' to indicate that the output has been completely
8209 * written. When writing a command completion or response to an
8210 * internal processor, the order of writes has to be such that
8211 * this field is written last.
8213 } __attribute__((packed));
8215 /* hwrm_cfa_l2_filter_cfg */
8216 /* Description: Change the configuration of an existing L2 filter */
8217 /* Input (40 bytes) */
8218 struct hwrm_cfa_l2_filter_cfg_input {
8221 * This value indicates what type of request this is. The format
8222 * for the rest of the command is determined by this field.
8226 * This value indicates the what completion ring the request
8227 * will be optionally completed on. If the value is -1, then no
8228 * CR completion will be generated. Any other value must be a
8229 * valid CR ring_id value for this function.
8232 /* This value indicates the command sequence number. */
8235 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8236 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8241 * This is the host address where the response will be written
8242 * when the request is complete. This area must be 16B aligned
8243 * and must be cleared to zero before the request is made.
8247 * Enumeration denoting the RX, TX type of the resource. This
8248 * enumeration is used for resources that are similar for both
8249 * TX and RX paths of the chip.
8251 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
8253 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
8254 (UINT32_C(0x0) << 0)
8256 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
8257 (UINT32_C(0x1) << 0)
8258 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
8259 CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
8261 * Setting of this flag indicates drop action. If this flag is
8262 * not set, then it should be considered accept action.
8264 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP UINT32_C(0x2)
8266 /* This bit must be '1' for the dst_id field to be configured. */
8267 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID UINT32_C(0x1)
8269 * This bit must be '1' for the new_mirror_vnic_id field to be
8272 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
8274 uint64_t l2_filter_id;
8276 * This value identifies a set of CFA data structures used for
8281 * If set, this value shall represent the Logical VNIC ID of the
8282 * destination VNIC for the RX path and network port id of the
8283 * destination port for the TX path.
8285 uint32_t new_mirror_vnic_id;
8286 /* New Logical VNIC ID of the VNIC where traffic is mirrored. */
8287 } __attribute__((packed));
8289 /* Output (16 bytes) */
8290 struct hwrm_cfa_l2_filter_cfg_output {
8291 uint16_t error_code;
8293 * Pass/Fail or error type Note: receiver to verify the in
8294 * parameters, and fail the call with an error when appropriate
8297 /* This field returns the type of original request. */
8299 /* This field provides original sequence number of the command. */
8302 * This field is the length of the response in bytes. The last
8303 * byte of the response is a valid flag that will read as '1'
8304 * when the command has been completely written to memory.
8312 * This field is used in Output records to indicate that the
8313 * output is completely written to RAM. This field should be
8314 * read as '1' to indicate that the output has been completely
8315 * written. When writing a command completion or response to an
8316 * internal processor, the order of writes has to be such that
8317 * this field is written last.
8319 } __attribute__((packed));
8321 /* hwrm_cfa_l2_set_rx_mask */
8322 /* Description: This command will set rx mask of the function. */
8323 /* Input (56 bytes) */
8324 struct hwrm_cfa_l2_set_rx_mask_input {
8327 * This value indicates what type of request this is. The format
8328 * for the rest of the command is determined by this field.
8332 * This value indicates the what completion ring the request
8333 * will be optionally completed on. If the value is -1, then no
8334 * CR completion will be generated. Any other value must be a
8335 * valid CR ring_id value for this function.
8338 /* This value indicates the command sequence number. */
8341 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8342 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8347 * This is the host address where the response will be written
8348 * when the request is complete. This area must be 16B aligned
8349 * and must be cleared to zero before the request is made.
8354 /* Reserved for future use. */
8355 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_RESERVED UINT32_C(0x1)
8357 * When this bit is '1', the function is requested to accept
8358 * multi-cast packets specified by the multicast addr table.
8360 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST UINT32_C(0x2)
8362 * When this bit is '1', the function is requested to accept all
8363 * multi-cast packets.
8365 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST UINT32_C(0x4)
8367 * When this bit is '1', the function is requested to accept
8368 * broadcast packets.
8370 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST UINT32_C(0x8)
8372 * When this bit is '1', the function is requested to be put in
8373 * the promiscuous mode. The HWRM should accept any function to
8374 * set up promiscuous mode. The HWRM shall follow the semantics
8375 * below for the promiscuous mode support. # When partitioning
8376 * is not enabled on a port (i.e. single PF on the port), then
8377 * the PF shall be allowed to be in the promiscuous mode. When
8378 * the PF is in the promiscuous mode, then it shall receive all
8379 * host bound traffic on that port. # When partitioning is
8380 * enabled on a port (i.e. multiple PFs per port) and a PF on
8381 * that port is in the promiscuous mode, then the PF receives
8382 * all traffic within that partition as identified by a unique
8383 * identifier for the PF (e.g. S-Tag). If a unique outer VLAN
8384 * for the PF is specified, then the setting of promiscuous mode
8385 * on that PF shall result in the PF receiving all host bound
8386 * traffic with matching outer VLAN. # A VF shall can be set in
8387 * the promiscuous mode. In the promiscuous mode, the VF does
8388 * not receive any traffic unless a unique outer VLAN for the VF
8389 * is specified. If a unique outer VLAN for the VF is specified,
8390 * then the setting of promiscuous mode on that VF shall result
8391 * in the VF receiving all host bound traffic with the matching
8392 * outer VLAN. # The HWRM shall allow the setting of promiscuous
8393 * mode on a function independently from the promiscuous mode
8394 * settings on other functions.
8396 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS UINT32_C(0x10)
8398 * If this flag is set, the corresponding RX filters shall be
8399 * set up to cover multicast/broadcast filters for the outermost
8400 * Layer 2 destination MAC address field.
8402 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST UINT32_C(0x20)
8404 * If this flag is set, the corresponding RX filters shall be
8405 * set up to cover multicast/broadcast filters for the VLAN-
8406 * tagged packets that match the TPID and VID fields of VLAN
8407 * tags in the VLAN tag table specified in this command.
8409 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY UINT32_C(0x40)
8411 * If this flag is set, the corresponding RX filters shall be
8412 * set up to cover multicast/broadcast filters for non-VLAN
8413 * tagged packets and VLAN-tagged packets that match the TPID
8414 * and VID fields of VLAN tags in the VLAN tag table specified
8417 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN UINT32_C(0x80)
8419 * If this flag is set, the corresponding RX filters shall be
8420 * set up to cover multicast/broadcast filters for non-VLAN
8421 * tagged packets and VLAN-tagged packets matching any VLAN tag.
8422 * If this flag is set, then the HWRM shall ignore VLAN tags
8423 * specified in vlan_tag_tbl. If none of vlanonly, vlan_nonvlan,
8424 * and anyvlan_nonvlan flags is set, then the HWRM shall ignore
8425 * VLAN tags specified in vlan_tag_tbl. The HWRM client shall
8426 * set at most one flag out of vlanonly, vlan_nonvlan, and
8429 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
8431 uint64_t mc_tbl_addr;
8432 /* This is the address for mcast address tbl. */
8433 uint32_t num_mc_entries;
8435 * This value indicates how many entries in mc_tbl are valid.
8436 * Each entry is 6 bytes.
8439 uint64_t vlan_tag_tbl_addr;
8441 * This is the address for VLAN tag table. Each VLAN entry in
8442 * the table is 4 bytes of a VLAN tag including TPID, PCP, DEI,
8443 * and VID fields in network byte order.
8445 uint32_t num_vlan_tags;
8447 * This value indicates how many entries in vlan_tag_tbl are
8448 * valid. Each entry is 4 bytes.
8451 } __attribute__((packed));
8453 /* Output (16 bytes) */
8454 struct hwrm_cfa_l2_set_rx_mask_output {
8455 uint16_t error_code;
8457 * Pass/Fail or error type Note: receiver to verify the in
8458 * parameters, and fail the call with an error when appropriate
8461 /* This field returns the type of original request. */
8463 /* This field provides original sequence number of the command. */
8466 * This field is the length of the response in bytes. The last
8467 * byte of the response is a valid flag that will read as '1'
8468 * when the command has been completely written to memory.
8476 * This field is used in Output records to indicate that the
8477 * output is completely written to RAM. This field should be
8478 * read as '1' to indicate that the output has been completely
8479 * written. When writing a command completion or response to an
8480 * internal processor, the order of writes has to be such that
8481 * this field is written last.
8483 } __attribute__((packed));
8485 /* hwrm_tunnel_dst_port_query */
8487 * Description: This function is called by a driver to query tunnel type
8488 * specific destination port configuration.
8490 /* Input (24 bytes) */
8491 struct hwrm_tunnel_dst_port_query_input {
8494 * This value indicates what type of request this is. The format
8495 * for the rest of the command is determined by this field.
8499 * This value indicates the what completion ring the request
8500 * will be optionally completed on. If the value is -1, then no
8501 * CR completion will be generated. Any other value must be a
8502 * valid CR ring_id value for this function.
8505 /* This value indicates the command sequence number. */
8508 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8509 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8514 * This is the host address where the response will be written
8515 * when the request is complete. This area must be 16B aligned
8516 * and must be cleared to zero before the request is made.
8518 uint8_t tunnel_type;
8520 /* Virtual eXtensible Local Area Network (VXLAN) */
8521 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
8523 /* Generic Network Virtualization Encapsulation (Geneve) */
8524 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
8526 uint8_t unused_0[7];
8527 } __attribute__((packed));
8529 /* Output (16 bytes) */
8530 struct hwrm_tunnel_dst_port_query_output {
8531 uint16_t error_code;
8533 * Pass/Fail or error type Note: receiver to verify the in
8534 * parameters, and fail the call with an error when appropriate
8537 /* This field returns the type of original request. */
8539 /* This field provides original sequence number of the command. */
8542 * This field is the length of the response in bytes. The last
8543 * byte of the response is a valid flag that will read as '1'
8544 * when the command has been completely written to memory.
8546 uint16_t tunnel_dst_port_id;
8548 * This field represents the identifier of L4 destination port
8549 * used for the given tunnel type. This field is valid for
8550 * specific tunnel types that use layer 4 (e.g. UDP) transports
8553 uint16_t tunnel_dst_port_val;
8555 * This field represents the value of L4 destination port
8556 * identified by tunnel_dst_port_id. This field is valid for
8557 * specific tunnel types that use layer 4 (e.g. UDP) transports
8558 * for tunneling. This field is in network byte order. A value
8559 * of 0 means that the destination port is not configured.
8566 * This field is used in Output records to indicate that the
8567 * output is completely written to RAM. This field should be
8568 * read as '1' to indicate that the output has been completely
8569 * written. When writing a command completion or response to an
8570 * internal processor, the order of writes has to be such that
8571 * this field is written last.
8573 } __attribute__((packed));
8575 /* hwrm_tunnel_dst_port_alloc */
8577 * Description: This function is called by a driver to allocate l4 destination
8578 * port for a specific tunnel type. The destination port value is provided in
8579 * the input. If the HWRM supports only one global destination port for a tunnel
8580 * type, then the HWRM shall keep track of its usage as described below. # The
8581 * first caller that allocates a destination port shall always succeed and the
8582 * HWRM shall save the destination port configuration for that tunnel type and
8583 * increment the usage count to 1. # Subsequent callers allocating the same
8584 * destination port for that tunnel type shall succeed and the HWRM shall
8585 * increment the usage count for that port for each subsequent caller that
8586 * succeeds. # Any subsequent caller trying to allocate a different destination
8587 * port for that tunnel type shall fail until the usage count for the original
8588 * destination port goes to zero. # A caller that frees a port will cause the
8589 * usage count for that port to decrement.
8591 /* Input (24 bytes) */
8592 struct hwrm_tunnel_dst_port_alloc_input {
8595 * This value indicates what type of request this is. The format
8596 * for the rest of the command is determined by this field.
8600 * This value indicates the what completion ring the request
8601 * will be optionally completed on. If the value is -1, then no
8602 * CR completion will be generated. Any other value must be a
8603 * valid CR ring_id value for this function.
8606 /* This value indicates the command sequence number. */
8609 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8610 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8615 * This is the host address where the response will be written
8616 * when the request is complete. This area must be 16B aligned
8617 * and must be cleared to zero before the request is made.
8619 uint8_t tunnel_type;
8621 /* Virtual eXtensible Local Area Network (VXLAN) */
8622 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
8623 /* Generic Network Virtualization Encapsulation (Geneve) */
8624 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
8627 uint16_t tunnel_dst_port_val;
8629 * This field represents the value of L4 destination port used
8630 * for the given tunnel type. This field is valid for specific
8631 * tunnel types that use layer 4 (e.g. UDP) transports for
8632 * tunneling. This field is in network byte order. A value of 0
8633 * shall fail the command.
8636 } __attribute__((packed));
8638 /* Output (16 bytes) */
8639 struct hwrm_tunnel_dst_port_alloc_output {
8640 uint16_t error_code;
8642 * Pass/Fail or error type Note: receiver to verify the in
8643 * parameters, and fail the call with an error when appropriate
8646 /* This field returns the type of original request. */
8648 /* This field provides original sequence number of the command. */
8651 * This field is the length of the response in bytes. The last
8652 * byte of the response is a valid flag that will read as '1'
8653 * when the command has been completely written to memory.
8655 uint16_t tunnel_dst_port_id;
8657 * Identifier of a tunnel L4 destination port value. Only
8658 * applies to tunnel types that has l4 destination port
8668 * This field is used in Output records to indicate that the
8669 * output is completely written to RAM. This field should be
8670 * read as '1' to indicate that the output has been completely
8671 * written. When writing a command completion or response to an
8672 * internal processor, the order of writes has to be such that
8673 * this field is written last.
8675 } __attribute__((packed));
8677 /* hwrm_tunnel_dst_port_free */
8679 * Description: This function is called by a driver to free l4 destination port
8680 * for a specific tunnel type.
8682 /* Input (24 bytes) */
8683 struct hwrm_tunnel_dst_port_free_input {
8686 * This value indicates what type of request this is. The format
8687 * for the rest of the command is determined by this field.
8691 * This value indicates the what completion ring the request
8692 * will be optionally completed on. If the value is -1, then no
8693 * CR completion will be generated. Any other value must be a
8694 * valid CR ring_id value for this function.
8697 /* This value indicates the command sequence number. */
8700 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8701 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8706 * This is the host address where the response will be written
8707 * when the request is complete. This area must be 16B aligned
8708 * and must be cleared to zero before the request is made.
8710 uint8_t tunnel_type;
8712 /* Virtual eXtensible Local Area Network (VXLAN) */
8713 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
8714 /* Generic Network Virtualization Encapsulation (Geneve) */
8715 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
8717 uint16_t tunnel_dst_port_id;
8719 * Identifier of a tunnel L4 destination port value. Only
8720 * applies to tunnel types that has l4 destination port
8724 } __attribute__((packed));
8726 /* Output (16 bytes) */
8727 struct hwrm_tunnel_dst_port_free_output {
8728 uint16_t error_code;
8730 * Pass/Fail or error type Note: receiver to verify the in
8731 * parameters, and fail the call with an error when appropriate
8734 /* This field returns the type of original request. */
8736 /* This field provides original sequence number of the command. */
8739 * This field is the length of the response in bytes. The last
8740 * byte of the response is a valid flag that will read as '1'
8741 * when the command has been completely written to memory.
8749 * This field is used in Output records to indicate that the
8750 * output is completely written to RAM. This field should be
8751 * read as '1' to indicate that the output has been completely
8752 * written. When writing a command completion or response to an
8753 * internal processor, the order of writes has to be such that
8754 * this field is written last.
8756 } __attribute__((packed));
8758 /* hwrm_stat_ctx_alloc */
8760 * Description: This command allocates and does basic preparation for a stat
8763 /* Input (32 bytes) */
8764 struct hwrm_stat_ctx_alloc_input {
8767 * This value indicates what type of request this is. The format
8768 * for the rest of the command is determined by this field.
8772 * This value indicates the what completion ring the request
8773 * will be optionally completed on. If the value is -1, then no
8774 * CR completion will be generated. Any other value must be a
8775 * valid CR ring_id value for this function.
8778 /* This value indicates the command sequence number. */
8781 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8782 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8787 * This is the host address where the response will be written
8788 * when the request is complete. This area must be 16B aligned
8789 * and must be cleared to zero before the request is made.
8791 uint64_t stats_dma_addr;
8792 /* This is the address for statistic block. */
8793 uint32_t update_period_ms;
8795 * The statistic block update period in ms. e.g. 250ms, 500ms,
8796 * 750ms, 1000ms. If update_period_ms is 0, then the stats
8797 * update shall be never done and the DMA address shall not be
8798 * used. In this case, the stat block can only be read by
8799 * hwrm_stat_ctx_query command.
8801 uint8_t stat_ctx_flags;
8803 * This field is used to specify statistics context specific
8804 * configuration flags.
8807 * When this bit is set to '1', the statistics context shall be
8808 * allocated for RoCE traffic only. In this case, traffic other
8809 * than offloaded RoCE traffic shall not be included in this
8810 * statistic context. When this bit is set to '0', the
8811 * statistics context shall be used for the network traffic
8812 * other than offloaded RoCE traffic.
8814 #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE UINT32_C(0x1)
8815 uint8_t unused_0[3];
8816 } __attribute__((packed));
8818 /* Output (16 bytes) */
8819 struct hwrm_stat_ctx_alloc_output {
8820 uint16_t error_code;
8822 * Pass/Fail or error type Note: receiver to verify the in
8823 * parameters, and fail the call with an error when appropriate
8826 /* This field returns the type of original request. */
8828 /* This field provides original sequence number of the command. */
8831 * This field is the length of the response in bytes. The last
8832 * byte of the response is a valid flag that will read as '1'
8833 * when the command has been completely written to memory.
8835 uint32_t stat_ctx_id;
8836 /* This is the statistics context ID value. */
8842 * This field is used in Output records to indicate that the
8843 * output is completely written to RAM. This field should be
8844 * read as '1' to indicate that the output has been completely
8845 * written. When writing a command completion or response to an
8846 * internal processor, the order of writes has to be such that
8847 * this field is written last.
8849 } __attribute__((packed));
8851 /* hwrm_stat_ctx_free */
8852 /* Description: This command is used to free a stat context. */
8853 /* Input (24 bytes) */
8854 struct hwrm_stat_ctx_free_input {
8857 * This value indicates what type of request this is. The format
8858 * for the rest of the command is determined by this field.
8862 * This value indicates the what completion ring the request
8863 * will be optionally completed on. If the value is -1, then no
8864 * CR completion will be generated. Any other value must be a
8865 * valid CR ring_id value for this function.
8868 /* This value indicates the command sequence number. */
8871 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8872 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8877 * This is the host address where the response will be written
8878 * when the request is complete. This area must be 16B aligned
8879 * and must be cleared to zero before the request is made.
8881 uint32_t stat_ctx_id;
8882 /* ID of the statistics context that is being queried. */
8884 } __attribute__((packed));
8886 /* Output (16 bytes) */
8887 struct hwrm_stat_ctx_free_output {
8888 uint16_t error_code;
8890 * Pass/Fail or error type Note: receiver to verify the in
8891 * parameters, and fail the call with an error when appropriate
8894 /* This field returns the type of original request. */
8896 /* This field provides original sequence number of the command. */
8899 * This field is the length of the response in bytes. The last
8900 * byte of the response is a valid flag that will read as '1'
8901 * when the command has been completely written to memory.
8903 uint32_t stat_ctx_id;
8904 /* This is the statistics context ID value. */
8910 * This field is used in Output records to indicate that the
8911 * output is completely written to RAM. This field should be
8912 * read as '1' to indicate that the output has been completely
8913 * written. When writing a command completion or response to an
8914 * internal processor, the order of writes has to be such that
8915 * this field is written last.
8917 } __attribute__((packed));
8919 /* hwrm_stat_ctx_clr_stats */
8920 /* Description: This command clears statistics of a context. */
8921 /* Input (24 bytes) */
8922 struct hwrm_stat_ctx_clr_stats_input {
8925 * This value indicates what type of request this is. The format
8926 * for the rest of the command is determined by this field.
8930 * This value indicates the what completion ring the request
8931 * will be optionally completed on. If the value is -1, then no
8932 * CR completion will be generated. Any other value must be a
8933 * valid CR ring_id value for this function.
8936 /* This value indicates the command sequence number. */
8939 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8940 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8945 * This is the host address where the response will be written
8946 * when the request is complete. This area must be 16B aligned
8947 * and must be cleared to zero before the request is made.
8949 uint32_t stat_ctx_id;
8950 /* ID of the statistics context that is being queried. */
8952 } __attribute__((packed));
8954 /* Output (16 bytes) */
8955 struct hwrm_stat_ctx_clr_stats_output {
8956 uint16_t error_code;
8958 * Pass/Fail or error type Note: receiver to verify the in
8959 * parameters, and fail the call with an error when appropriate
8962 /* This field returns the type of original request. */
8964 /* This field provides original sequence number of the command. */
8967 * This field is the length of the response in bytes. The last
8968 * byte of the response is a valid flag that will read as '1'
8969 * when the command has been completely written to memory.
8977 * This field is used in Output records to indicate that the
8978 * output is completely written to RAM. This field should be
8979 * read as '1' to indicate that the output has been completely
8980 * written. When writing a command completion or response to an
8981 * internal processor, the order of writes has to be such that
8982 * this field is written last.
8984 } __attribute__((packed));
8986 /* hwrm_stat_ctx_query */
8987 /* Description: This command returns statistics of a context. */
8988 /* Input (24 bytes) */
8990 struct hwrm_stat_ctx_query_input {
8993 * This value indicates what type of request this is. The format for the
8994 * rest of the command is determined by this field.
8998 * This value indicates the what completion ring the request will be
8999 * optionally completed on. If the value is -1, then no CR completion
9000 * will be generated. Any other value must be a valid CR ring_id value
9001 * for this function.
9004 /* This value indicates the command sequence number. */
9007 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
9008 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
9012 * This is the host address where the response will be written when the
9013 * request is complete. This area must be 16B aligned and must be
9014 * cleared to zero before the request is made.
9016 uint32_t stat_ctx_id;
9017 /* ID of the statistics context that is being queried. */
9019 } __attribute__((packed));
9021 /* Output (176 bytes) */
9023 struct hwrm_stat_ctx_query_output {
9024 uint16_t error_code;
9026 * Pass/Fail or error type Note: receiver to verify the in parameters,
9027 * and fail the call with an error when appropriate
9030 /* This field returns the type of original request. */
9032 /* This field provides original sequence number of the command. */
9035 * This field is the length of the response in bytes. The last byte of
9036 * the response is a valid flag that will read as '1' when the command
9037 * has been completely written to memory.
9039 uint64_t tx_ucast_pkts;
9040 /* Number of transmitted unicast packets */
9041 uint64_t tx_mcast_pkts;
9042 /* Number of transmitted multicast packets */
9043 uint64_t tx_bcast_pkts;
9044 /* Number of transmitted broadcast packets */
9045 uint64_t tx_err_pkts;
9046 /* Number of transmitted packets with error */
9047 uint64_t tx_drop_pkts;
9048 /* Number of dropped packets on transmit path */
9049 uint64_t tx_ucast_bytes;
9050 /* Number of transmitted bytes for unicast traffic */
9051 uint64_t tx_mcast_bytes;
9052 /* Number of transmitted bytes for multicast traffic */
9053 uint64_t tx_bcast_bytes;
9054 /* Number of transmitted bytes for broadcast traffic */
9055 uint64_t rx_ucast_pkts;
9056 /* Number of received unicast packets */
9057 uint64_t rx_mcast_pkts;
9058 /* Number of received multicast packets */
9059 uint64_t rx_bcast_pkts;
9060 /* Number of received broadcast packets */
9061 uint64_t rx_err_pkts;
9062 /* Number of received packets with error */
9063 uint64_t rx_drop_pkts;
9064 /* Number of dropped packets on received path */
9065 uint64_t rx_ucast_bytes;
9066 /* Number of received bytes for unicast traffic */
9067 uint64_t rx_mcast_bytes;
9068 /* Number of received bytes for multicast traffic */
9069 uint64_t rx_bcast_bytes;
9070 /* Number of received bytes for broadcast traffic */
9071 uint64_t rx_agg_pkts;
9072 /* Number of aggregated unicast packets */
9073 uint64_t rx_agg_bytes;
9074 /* Number of aggregated unicast bytes */
9075 uint64_t rx_agg_events;
9076 /* Number of aggregation events */
9077 uint64_t rx_agg_aborts;
9078 /* Number of aborted aggregations */
9085 * This field is used in Output records to indicate that the output is
9086 * completely written to RAM. This field should be read as '1' to
9087 * indicate that the output has been completely written. When writing a
9088 * command completion or response to an internal processor, the order of
9089 * writes has to be such that this field is written last.
9091 } __attribute__((packed));
9093 /* hwrm_exec_fwd_resp */
9095 * Description: This command is used to send an encapsulated request to the
9096 * HWRM. This command instructs the HWRM to execute the request and forward the
9097 * response of the encapsulated request to the location specified in the
9098 * original request that is encapsulated. The target id of this command shall be
9099 * set to 0xFFFF (HWRM). The response location in this command shall be used to
9100 * acknowledge the receipt of the encapsulated request and forwarding of the
9103 /* Input (128 bytes) */
9104 struct hwrm_exec_fwd_resp_input {
9107 * This value indicates what type of request this is. The format
9108 * for the rest of the command is determined by this field.
9112 * This value indicates the what completion ring the request
9113 * will be optionally completed on. If the value is -1, then no
9114 * CR completion will be generated. Any other value must be a
9115 * valid CR ring_id value for this function.
9118 /* This value indicates the command sequence number. */
9121 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9122 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9127 * This is the host address where the response will be written
9128 * when the request is complete. This area must be 16B aligned
9129 * and must be cleared to zero before the request is made.
9131 uint32_t encap_request[26];
9133 * This is an encapsulated request. This request should be
9134 * executed by the HWRM and the response should be provided in
9135 * the response buffer inside the encapsulated request.
9137 uint16_t encap_resp_target_id;
9139 * This value indicates the target id of the response to the
9140 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids
9141 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
9144 uint16_t unused_0[3];
9145 } __attribute__((packed));
9147 /* Output (16 bytes) */
9148 struct hwrm_exec_fwd_resp_output {
9149 uint16_t error_code;
9151 * Pass/Fail or error type Note: receiver to verify the in
9152 * parameters, and fail the call with an error when appropriate
9155 /* This field returns the type of original request. */
9157 /* This field provides original sequence number of the command. */
9160 * This field is the length of the response in bytes. The last
9161 * byte of the response is a valid flag that will read as '1'
9162 * when the command has been completely written to memory.
9170 * This field is used in Output records to indicate that the
9171 * output is completely written to RAM. This field should be
9172 * read as '1' to indicate that the output has been completely
9173 * written. When writing a command completion or response to an
9174 * internal processor, the order of writes has to be such that
9175 * this field is written last.
9177 } __attribute__((packed));
9179 /* hwrm_reject_fwd_resp */
9181 * Description: This command is used to send an encapsulated request to the
9182 * HWRM. This command instructs the HWRM to reject the request and forward the
9183 * error response of the encapsulated request to the location specified in the
9184 * original request that is encapsulated. The target id of this command shall be
9185 * set to 0xFFFF (HWRM). The response location in this command shall be used to
9186 * acknowledge the receipt of the encapsulated request and forwarding of the
9189 /* Input (128 bytes) */
9190 struct hwrm_reject_fwd_resp_input {
9193 * This value indicates what type of request this is. The format
9194 * for the rest of the command is determined by this field.
9198 * This value indicates the what completion ring the request
9199 * will be optionally completed on. If the value is -1, then no
9200 * CR completion will be generated. Any other value must be a
9201 * valid CR ring_id value for this function.
9204 /* This value indicates the command sequence number. */
9207 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9208 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9213 * This is the host address where the response will be written
9214 * when the request is complete. This area must be 16B aligned
9215 * and must be cleared to zero before the request is made.
9217 uint32_t encap_request[26];
9219 * This is an encapsulated request. This request should be
9220 * rejected by the HWRM and the error response should be
9221 * provided in the response buffer inside the encapsulated
9224 uint16_t encap_resp_target_id;
9226 * This value indicates the target id of the response to the
9227 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids
9228 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
9231 uint16_t unused_0[3];
9232 } __attribute__((packed));
9234 /* Output (16 bytes) */
9235 struct hwrm_reject_fwd_resp_output {
9236 uint16_t error_code;
9238 * Pass/Fail or error type Note: receiver to verify the in
9239 * parameters, and fail the call with an error when appropriate
9242 /* This field returns the type of original request. */
9244 /* This field provides original sequence number of the command. */
9247 * This field is the length of the response in bytes. The last
9248 * byte of the response is a valid flag that will read as '1'
9249 * when the command has been completely written to memory.
9257 * This field is used in Output records to indicate that the
9258 * output is completely written to RAM. This field should be
9259 * read as '1' to indicate that the output has been completely
9260 * written. When writing a command completion or response to an
9261 * internal processor, the order of writes has to be such that
9262 * this field is written last.
9264 } __attribute__((packed));
9266 /* Hardware Resource Manager Specification */
9267 /* Description: This structure is used to specify port description. */
9269 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
9270 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
9271 * processors inside the chip. This firmware service is vital part of the chip.
9272 * The chip can not be used by a driver or HWRM client without the HWRM.
9274 /* Input (16 bytes) */
9278 * This value indicates what type of request this is. The format
9279 * for the rest of the command is determined by this field.
9283 * This value indicates the what completion ring the request
9284 * will be optionally completed on. If the value is -1, then no
9285 * CR completion will be generated. Any other value must be a
9286 * valid CR ring_id value for this function.
9289 /* This value indicates the command sequence number. */
9292 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9293 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9298 * This is the host address where the response will be written
9299 * when the request is complete. This area must be 16B aligned
9300 * and must be cleared to zero before the request is made.
9302 } __attribute__((packed));
9304 /* Output (8 bytes) */
9306 uint16_t error_code;
9308 * Pass/Fail or error type Note: receiver to verify the in
9309 * parameters, and fail the call with an error when appropriate
9312 /* This field returns the type of original request. */
9314 /* This field provides original sequence number of the command. */
9317 * This field is the length of the response in bytes. The last
9318 * byte of the response is a valid flag that will read as '1'
9319 * when the command has been completely written to memory.
9321 } __attribute__((packed));
9323 #define HWRM_GET_HWRM_ERROR_CODE(arg) \
9325 typeof(arg) x = (arg); \
9326 ((x) == 0xf ? "HWRM_ERROR" : \
9327 ((x) == 0xffff ? "CMD_NOT_SUPPORTED" : \
9328 ((x) == 0xfffe ? "UNKNOWN_ERR" : \
9329 ((x) == 0x4 ? "RESOURCE_ALLOC_ERROR" : \
9330 ((x) == 0x5 ? "INVALID_FLAGS" : \
9331 ((x) == 0x6 ? "INVALID_ENABLES" : \
9332 ((x) == 0x0 ? "SUCCESS" : \
9333 ((x) == 0x1 ? "FAIL" : \
9334 ((x) == 0x2 ? "INVALID_PARAMS" : \
9335 ((x) == 0x3 ? "RESOURCE_ACCESS_DENIED" : \
9336 "Unknown error_code")))))))))) \
9339 /* Return Codes (8 bytes) */
9341 uint16_t error_code;
9342 /* These are numbers assigned to return/error codes. */
9343 /* Request was successfully executed by the HWRM. */
9344 #define HWRM_ERR_CODE_SUCCESS (UINT32_C(0x0))
9345 /* THe HWRM failed to execute the request. */
9346 #define HWRM_ERR_CODE_FAIL (UINT32_C(0x1))
9348 * The request contains invalid argument(s) or
9351 #define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
9353 * The requester is not allowed to access the
9354 * requested resource. This error code shall be
9355 * provided in a response to a request to query
9356 * or modify an existing resource that is not
9357 * accessible by the requester.
9359 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
9361 * The HWRM is unable to allocate the requested
9362 * resource. This code only applies to requests
9363 * for HWRM resource allocations.
9365 #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR (UINT32_C(0x4))
9366 /* Invalid combination of flags is specified in the request. */
9367 #define HWRM_ERR_CODE_INVALID_FLAGS (UINT32_C(0x5))
9369 * Invalid combination of enables fields is
9370 * specified in the request.
9372 #define HWRM_ERR_CODE_INVALID_ENABLES (UINT32_C(0x6))
9374 * Generic HWRM execution error that represents
9375 * an internal error.
9377 #define HWRM_ERR_CODE_HWRM_ERROR (UINT32_C(0xf))
9379 #define HWRM_ERR_CODE_UNKNOWN_ERR (UINT32_C(0xfffe))
9380 /* Unsupported or invalid command */
9381 #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED (UINT32_C(0xffff))
9382 uint16_t unused_0[3];
9383 } __attribute__((packed));
9385 /* Output (16 bytes) */
9386 struct hwrm_err_output {
9387 uint16_t error_code;
9389 * Pass/Fail or error type Note: receiver to verify the in
9390 * parameters, and fail the call with an error when appropriate
9393 /* This field returns the type of original request. */
9395 /* This field provides original sequence number of the command. */
9398 * This field is the length of the response in bytes. The last
9399 * byte of the response is a valid flag that will read as '1'
9400 * when the command has been completely written to memory.
9403 /* debug info for this error response. */
9405 /* debug info for this error response. */
9408 * In the case of an error response, command specific error code
9409 * is returned in this field.
9413 * This field is used in Output records to indicate that the
9414 * output is completely written to RAM. This field should be
9415 * read as '1' to indicate that the output has been completely
9416 * written. When writing a command completion or response to an
9417 * internal processor, the order of writes has to be such that
9418 * this field is written last.
9420 } __attribute__((packed));
9422 /* Port Tx Statistics Formats (408 bytes) */
9423 struct tx_port_stats {
9424 uint64_t tx_64b_frames;
9425 /* Total Number of 64 Bytes frames transmitted */
9426 uint64_t tx_65b_127b_frames;
9427 /* Total Number of 65-127 Bytes frames transmitted */
9428 uint64_t tx_128b_255b_frames;
9429 /* Total Number of 128-255 Bytes frames transmitted */
9430 uint64_t tx_256b_511b_frames;
9431 /* Total Number of 256-511 Bytes frames transmitted */
9432 uint64_t tx_512b_1023b_frames;
9433 /* Total Number of 512-1023 Bytes frames transmitted */
9434 uint64_t tx_1024b_1518_frames;
9435 /* Total Number of 1024-1518 Bytes frames transmitted */
9436 uint64_t tx_good_vlan_frames;
9438 * Total Number of each good VLAN (exludes FCS errors) frame
9439 * transmitted which is 1519 to 1522 bytes in length inclusive
9440 * (excluding framing bits but including FCS bytes).
9442 uint64_t tx_1519b_2047_frames;
9443 /* Total Number of 1519-2047 Bytes frames transmitted */
9444 uint64_t tx_2048b_4095b_frames;
9445 /* Total Number of 2048-4095 Bytes frames transmitted */
9446 uint64_t tx_4096b_9216b_frames;
9447 /* Total Number of 4096-9216 Bytes frames transmitted */
9448 uint64_t tx_9217b_16383b_frames;
9449 /* Total Number of 9217-16383 Bytes frames transmitted */
9450 uint64_t tx_good_frames;
9451 /* Total Number of good frames transmitted */
9452 uint64_t tx_total_frames;
9453 /* Total Number of frames transmitted */
9454 uint64_t tx_ucast_frames;
9455 /* Total number of unicast frames transmitted */
9456 uint64_t tx_mcast_frames;
9457 /* Total number of multicast frames transmitted */
9458 uint64_t tx_bcast_frames;
9459 /* Total number of broadcast frames transmitted */
9460 uint64_t tx_pause_frames;
9461 /* Total number of PAUSE control frames transmitted */
9462 uint64_t tx_pfc_frames;
9463 /* Total number of PFC/per-priority PAUSE control frames transmitted */
9464 uint64_t tx_jabber_frames;
9465 /* Total number of jabber frames transmitted */
9466 uint64_t tx_fcs_err_frames;
9467 /* Total number of frames transmitted with FCS error */
9468 uint64_t tx_control_frames;
9469 /* Total number of control frames transmitted */
9470 uint64_t tx_oversz_frames;
9471 /* Total number of over-sized frames transmitted */
9472 uint64_t tx_single_dfrl_frames;
9473 /* Total number of frames with single deferral */
9474 uint64_t tx_multi_dfrl_frames;
9475 /* Total number of frames with multiple deferrals */
9476 uint64_t tx_single_coll_frames;
9477 /* Total number of frames with single collision */
9478 uint64_t tx_multi_coll_frames;
9479 /* Total number of frames with multiple collisions */
9480 uint64_t tx_late_coll_frames;
9481 /* Total number of frames with late collisions */
9482 uint64_t tx_excessive_coll_frames;
9483 /* Total number of frames with excessive collisions */
9484 uint64_t tx_frag_frames;
9485 /* Total number of fragmented frames transmitted */
9487 /* Total number of transmit errors */
9488 uint64_t tx_tagged_frames;
9489 /* Total number of single VLAN tagged frames transmitted */
9490 uint64_t tx_dbl_tagged_frames;
9491 /* Total number of double VLAN tagged frames transmitted */
9492 uint64_t tx_runt_frames;
9493 /* Total number of runt frames transmitted */
9494 uint64_t tx_fifo_underruns;
9495 /* Total number of TX FIFO under runs */
9496 uint64_t tx_pfc_ena_frames_pri0;
9498 * Total number of PFC frames with PFC enabled bit for Pri 0
9501 uint64_t tx_pfc_ena_frames_pri1;
9503 * Total number of PFC frames with PFC enabled bit for Pri 1
9506 uint64_t tx_pfc_ena_frames_pri2;
9508 * Total number of PFC frames with PFC enabled bit for Pri 2
9511 uint64_t tx_pfc_ena_frames_pri3;
9513 * Total number of PFC frames with PFC enabled bit for Pri 3
9516 uint64_t tx_pfc_ena_frames_pri4;
9518 * Total number of PFC frames with PFC enabled bit for Pri 4
9521 uint64_t tx_pfc_ena_frames_pri5;
9523 * Total number of PFC frames with PFC enabled bit for Pri 5
9526 uint64_t tx_pfc_ena_frames_pri6;
9528 * Total number of PFC frames with PFC enabled bit for Pri 6
9531 uint64_t tx_pfc_ena_frames_pri7;
9533 * Total number of PFC frames with PFC enabled bit for Pri 7
9536 uint64_t tx_eee_lpi_events;
9537 /* Total number of EEE LPI Events on TX */
9538 uint64_t tx_eee_lpi_duration;
9539 /* EEE LPI Duration Counter on TX */
9540 uint64_t tx_llfc_logical_msgs;
9542 * Total number of Link Level Flow Control (LLFC) messages
9545 uint64_t tx_hcfc_msgs;
9546 /* Total number of HCFC messages transmitted */
9547 uint64_t tx_total_collisions;
9548 /* Total number of TX collisions */
9550 /* Total number of transmitted bytes */
9551 uint64_t tx_xthol_frames;
9552 /* Total number of end-to-end HOL frames */
9553 uint64_t tx_stat_discard;
9554 /* Total Tx Drops per Port reported by STATS block */
9555 uint64_t tx_stat_error;
9556 /* Total Tx Error Drops per Port reported by STATS block */
9557 } __attribute__((packed));
9559 /* Port Rx Statistics Formats (528 bytes) */
9560 struct rx_port_stats {
9561 uint64_t rx_64b_frames;
9562 /* Total Number of 64 Bytes frames received */
9563 uint64_t rx_65b_127b_frames;
9564 /* Total Number of 65-127 Bytes frames received */
9565 uint64_t rx_128b_255b_frames;
9566 /* Total Number of 128-255 Bytes frames received */
9567 uint64_t rx_256b_511b_frames;
9568 /* Total Number of 256-511 Bytes frames received */
9569 uint64_t rx_512b_1023b_frames;
9570 /* Total Number of 512-1023 Bytes frames received */
9571 uint64_t rx_1024b_1518_frames;
9572 /* Total Number of 1024-1518 Bytes frames received */
9573 uint64_t rx_good_vlan_frames;
9575 * Total Number of each good VLAN (exludes FCS errors) frame
9576 * received which is 1519 to 1522 bytes in length inclusive
9577 * (excluding framing bits but including FCS bytes).
9579 uint64_t rx_1519b_2047b_frames;
9580 /* Total Number of 1519-2047 Bytes frames received */
9581 uint64_t rx_2048b_4095b_frames;
9582 /* Total Number of 2048-4095 Bytes frames received */
9583 uint64_t rx_4096b_9216b_frames;
9584 /* Total Number of 4096-9216 Bytes frames received */
9585 uint64_t rx_9217b_16383b_frames;
9586 /* Total Number of 9217-16383 Bytes frames received */
9587 uint64_t rx_total_frames;
9588 /* Total number of frames received */
9589 uint64_t rx_ucast_frames;
9590 /* Total number of unicast frames received */
9591 uint64_t rx_mcast_frames;
9592 /* Total number of multicast frames received */
9593 uint64_t rx_bcast_frames;
9594 /* Total number of broadcast frames received */
9595 uint64_t rx_fcs_err_frames;
9596 /* Total number of received frames with FCS error */
9597 uint64_t rx_ctrl_frames;
9598 /* Total number of control frames received */
9599 uint64_t rx_pause_frames;
9600 /* Total number of PAUSE frames received */
9601 uint64_t rx_pfc_frames;
9602 /* Total number of PFC frames received */
9603 uint64_t rx_unsupported_opcode_frames;
9604 /* Total number of frames received with an unsupported opcode */
9605 uint64_t rx_unsupported_da_pausepfc_frames;
9607 * Total number of frames received with an unsupported DA for
9610 uint64_t rx_wrong_sa_frames;
9611 /* Total number of frames received with an unsupported SA */
9612 uint64_t rx_align_err_frames;
9613 /* Total number of received packets with alignment error */
9614 uint64_t rx_oor_len_frames;
9615 /* Total number of received frames with out-of-range length */
9616 uint64_t rx_code_err_frames;
9617 /* Total number of received frames with error termination */
9618 uint64_t rx_false_carrier_frames;
9620 * Total number of received frames with a false carrier is
9621 * detected during idle, as defined by RX_ER samples active and
9622 * RXD is 0xE. The event is reported along with the statistics
9623 * generated on the next received frame. Only one false carrier
9624 * condition can be detected and logged between frames. Carrier
9625 * event, valid for 10M/100M speed modes only.
9627 uint64_t rx_ovrsz_frames;
9628 /* Total number of over-sized frames received */
9629 uint64_t rx_jbr_frames;
9630 /* Total number of jabber packets received */
9631 uint64_t rx_mtu_err_frames;
9632 /* Total number of received frames with MTU error */
9633 uint64_t rx_match_crc_frames;
9634 /* Total number of received frames with CRC match */
9635 uint64_t rx_promiscuous_frames;
9636 /* Total number of frames received promiscuously */
9637 uint64_t rx_tagged_frames;
9638 /* Total number of received frames with one or two VLAN tags */
9639 uint64_t rx_double_tagged_frames;
9640 /* Total number of received frames with two VLAN tags */
9641 uint64_t rx_trunc_frames;
9642 /* Total number of truncated frames received */
9643 uint64_t rx_good_frames;
9644 /* Total number of good frames (without errors) received */
9645 uint64_t rx_pfc_xon2xoff_frames_pri0;
9647 * Total number of received PFC frames with transition from XON
9650 uint64_t rx_pfc_xon2xoff_frames_pri1;
9652 * Total number of received PFC frames with transition from XON
9655 uint64_t rx_pfc_xon2xoff_frames_pri2;
9657 * Total number of received PFC frames with transition from XON
9660 uint64_t rx_pfc_xon2xoff_frames_pri3;
9662 * Total number of received PFC frames with transition from XON
9665 uint64_t rx_pfc_xon2xoff_frames_pri4;
9667 * Total number of received PFC frames with transition from XON
9670 uint64_t rx_pfc_xon2xoff_frames_pri5;
9672 * Total number of received PFC frames with transition from XON
9675 uint64_t rx_pfc_xon2xoff_frames_pri6;
9677 * Total number of received PFC frames with transition from XON
9680 uint64_t rx_pfc_xon2xoff_frames_pri7;
9682 * Total number of received PFC frames with transition from XON
9685 uint64_t rx_pfc_ena_frames_pri0;
9687 * Total number of received PFC frames with PFC enabled bit for
9690 uint64_t rx_pfc_ena_frames_pri1;
9692 * Total number of received PFC frames with PFC enabled bit for
9695 uint64_t rx_pfc_ena_frames_pri2;
9697 * Total number of received PFC frames with PFC enabled bit for
9700 uint64_t rx_pfc_ena_frames_pri3;
9702 * Total number of received PFC frames with PFC enabled bit for
9705 uint64_t rx_pfc_ena_frames_pri4;
9707 * Total number of received PFC frames with PFC enabled bit for
9710 uint64_t rx_pfc_ena_frames_pri5;
9712 * Total number of received PFC frames with PFC enabled bit for
9715 uint64_t rx_pfc_ena_frames_pri6;
9717 * Total number of received PFC frames with PFC enabled bit for
9720 uint64_t rx_pfc_ena_frames_pri7;
9722 * Total number of received PFC frames with PFC enabled bit for
9725 uint64_t rx_sch_crc_err_frames;
9726 /* Total Number of frames received with SCH CRC error */
9727 uint64_t rx_undrsz_frames;
9728 /* Total Number of under-sized frames received */
9729 uint64_t rx_frag_frames;
9730 /* Total Number of fragmented frames received */
9731 uint64_t rx_eee_lpi_events;
9732 /* Total number of RX EEE LPI Events */
9733 uint64_t rx_eee_lpi_duration;
9734 /* EEE LPI Duration Counter on RX */
9735 uint64_t rx_llfc_physical_msgs;
9737 * Total number of physical type Link Level Flow Control (LLFC)
9740 uint64_t rx_llfc_logical_msgs;
9742 * Total number of logical type Link Level Flow Control (LLFC)
9745 uint64_t rx_llfc_msgs_with_crc_err;
9747 * Total number of logical type Link Level Flow Control (LLFC)
9748 * messages received with CRC error
9750 uint64_t rx_hcfc_msgs;
9751 /* Total number of HCFC messages received */
9752 uint64_t rx_hcfc_msgs_with_crc_err;
9753 /* Total number of HCFC messages received with CRC error */
9755 /* Total number of received bytes */
9756 uint64_t rx_runt_bytes;
9757 /* Total number of bytes received in runt frames */
9758 uint64_t rx_runt_frames;
9759 /* Total number of runt frames received */
9760 uint64_t rx_stat_discard;
9761 /* Total Rx Discards per Port reported by STATS block */
9762 uint64_t rx_stat_err;
9763 /* Total Rx Error Drops per Port reported by STATS block */
9764 } __attribute__((packed));
9766 /* Periodic Statistics Context DMA to host (160 bytes) */
9768 * per-context HW statistics -- chip view
9771 struct ctx_hw_stats64 {
9772 uint64_t rx_ucast_pkts;
9773 uint64_t rx_mcast_pkts;
9774 uint64_t rx_bcast_pkts;
9775 uint64_t rx_drop_pkts;
9776 uint64_t rx_discard_pkts;
9777 uint64_t rx_ucast_bytes;
9778 uint64_t rx_mcast_bytes;
9779 uint64_t rx_bcast_bytes;
9781 uint64_t tx_ucast_pkts;
9782 uint64_t tx_mcast_pkts;
9783 uint64_t tx_bcast_pkts;
9784 uint64_t tx_drop_pkts;
9785 uint64_t tx_discard_pkts;
9786 uint64_t tx_ucast_bytes;
9787 uint64_t tx_mcast_bytes;
9788 uint64_t tx_bcast_bytes;
9792 uint64_t tpa_events;
9793 uint64_t tpa_aborts;
9794 } __attribute__((packed));
9796 #endif /* _HSI_STRUCT_DEF_DPDK_ */