1 /*-
2 * Copyright (c) 2002-2007 Neterion, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: src/sys/dev/nxge/include/xgehal-stats.h,v 1.2 2007/10/29 14:19:31 rwatson Exp $
27 */
28
29 #ifndef XGE_HAL_STATS_H
30 #define XGE_HAL_STATS_H
31
32 #include <dev/nxge/include/xge-os-pal.h>
33 #include <dev/nxge/include/xge-debug.h>
34 #include <dev/nxge/include/xgehal-types.h>
35 #include <dev/nxge/include/xgehal-config.h>
36
37 __EXTERN_BEGIN_DECLS
38
39 /**
40 * struct xge_hal_stats_hw_info_t - Xframe hardware statistics.
41 * Transmit MAC Statistics:
42 *
43 * @tmac_frms: Count of successfully transmitted MAC
44 * frames Note that this statistic may be inaccurate. The correct statistic may
45 * be derived by calcualating (tmac_ttl_octets - tmac_ttl_less_fb_octets) / 8
46 *
47 * @tmac_data_octets: Count of data and padding octets of successfully
48 * transmitted frames.
49 *
50 * @tmac_drop_frms: Count of frames that could not be sent for no other reason
51 * than internal MAC processing. Increments once whenever the
52 * transmit buffer is flushed (due to an ECC error on a memory descriptor).
53 *
54 * @tmac_mcst_frms: Count of successfully transmitted frames to a multicast
55 * address. Does not include frames sent to the broadcast address.
56 *
57 * @tmac_bcst_frms: Count of successfully transmitted frames to the broadcast
58 * address.
59 *
60 * @tmac_pause_ctrl_frms: Count of MAC PAUSE control frames that are
61 * transmitted. Since, the only control frames supported by this device
62 * are PAUSE frames, this register is a count of all transmitted MAC control
63 * frames.
64 *
65 * @tmac_ttl_octets: Count of total octets of transmitted frames, including
66 * framing characters.
67 *
68 * @tmac_ucst_frms: Count of transmitted frames containing a unicast address.
69 * @tmac_nucst_frms: Count of transmitted frames containing a non-unicast
70 * (broadcast, multicast) address.
71 *
72 * @tmac_any_err_frms: Count of transmitted frames containing any error that
73 * prevents them from being passed to the network. Increments if there is an ECC
74 * while reading the frame out of the transmit buffer.
75 *
76 * @tmac_ttl_less_fb_octets: Count of total octets of transmitted
77 * frames, not including framing characters (i.e. less framing bits)
78 *
79 * @tmac_vld_ip_octets: Count of total octets of transmitted IP datagrams that
80 * were passed to the network. Frames that are padded by the host have
81 * their padding counted as part of the IP datagram.
82 *
83 * @tmac_vld_ip: Count of transmitted IP datagrams that were passed to the
84 * network.
85 *
86 * @tmac_drop_ip: Count of transmitted IP datagrams that could not be passed to
87 * the network. Increments because of 1) an internal processing error (such as
88 * an uncorrectable ECC error); 2) a frame parsing error during IP checksum
89 * calculation.
90 *
91 * @tmac_icmp: Count of transmitted ICMP messages. Includes messages not sent
92 * due to problems within ICMP.
93 *
94 * @tmac_rst_tcp: Count of transmitted TCP segments containing the RST flag.
95 *
96 * @tmac_tcp: Count of transmitted TCP segments. Note that Xena has
97 * no knowledge of retransmission.
98 *
99 * @tmac_udp: Count of transmitted UDP datagrams.
100 * @reserved_0: Reserved.
101 *
102 * Receive MAC Statistics:
103 * @rmac_vld_frms: Count of successfully received MAC frames. Does not include
104 * frames received with frame-too-long, FCS, or length errors.
105 *
106 * @rmac_data_octets: Count of data and padding octets of successfully received
107 * frames. Does not include frames received with frame-too-long, FCS, or length
108 * errors.
109 *
110 * @rmac_fcs_err_frms: Count of received MAC frames that do not pass FCS. Does
111 * not include frames received with frame-too-long or frame-too-short error.
112 *
113 * @rmac_drop_frms: Count of received frames that could not be passed to the
114 * host because of 1) Random Early Discard (RED); 2) Frame steering algorithm
115 * found no available queue; 3) Receive ingress buffer overflow.
116 *
117 * @rmac_vld_mcst_frms: Count of successfully received MAC frames containing a
118 * multicast address. Does not include frames received with frame-too-long, FCS,
119 * or length errors.
120 *
121 * @rmac_vld_bcst_frms: Count of successfully received MAC frames containing a
122 * broadcast address. Does not include frames received with frame-too-long, FCS,
123 * or length errors.
124 *
125 * @rmac_in_rng_len_err_frms: Count of received frames with a length/type field
126 * value between 46 (42 for VLANtagged frames) and 1500 (also 1500 for
127 * VLAN-tagged frames), inclusive, that does not match the number of data octets
128 * (including pad) received. Also contains a count of received frames with a
129 * length/type field less than 46 (42 for VLAN-tagged frames) and the number of
130 * data octets (including pad) received is greater than 46 (42 for VLAN-tagged
131 * frames).
132 *
133 * @rmac_out_rng_len_err_frms: Count of received frames with length/type field
134 * between 1501 and 1535 decimal, inclusive.
135 *
136 * @rmac_long_frms: Count of received frames that are longer than
137 * rmac_max_pyld_len + 18 bytes (+22 bytes if VLAN-tagged).
138 *
139 * @rmac_pause_ctrl_frms: Count of received MAC PAUSE control frames.
140 *
141 * @rmac_unsup_ctrl_frms: Count of received MAC control frames
142 * that do not contain the PAUSE opcode. The sum of MAC_PAUSE_CTRL_FRMS and this
143 * register is a count of all received MAC control frames.
144 *
145 * @rmac_ttl_octets: Count of total octets of received frames, including framing
146 * characters.
147 *
148 * @rmac_accepted_ucst_frms: Count of successfully received frames
149 * containing a unicast address. Only includes frames that are passed to the
150 * system.
151 *
152 * @rmac_accepted_nucst_frms: Count of successfully received frames
153 * containing a non-unicast (broadcast or multicast) address. Only includes
154 * frames that are passed to the system. Could include, for instance,
155 * non-unicast frames that contain FCS errors if the MAC_ERROR_CFG register is
156 * set to pass FCSerrored frames to the host.
157 *
158 * @rmac_discarded_frms: Count of received frames containing any error that
159 * prevents them from being passed to the system. Includes, for example,
160 * received pause frames that are discarded by the MAC and frames discarded
161 * because of their destination address.
162 *
163 * @rmac_drop_events: Because the RMAC drops one frame at a time, this stat
164 * matches rmac_drop_frms.
165 *
166 * @reserved_1: Reserved.
167 * @rmac_ttl_less_fb_octets: Count of total octets of received frames,
168 * not including framing characters (i.e. less framing bits).
169 *
170 * @rmac_ttl_frms: Count of all received MAC frames, including frames received
171 * with frame-too-long, FCS, or length errors.
172 *
173 * @reserved_2: Reserved.
174 * @reserved_3: Reserved.
175 * @rmac_usized_frms: Count of received frames of length (including FCS, but not
176 * framing bits) less than 64 octets, that are otherwise well-formed.
177 *
178 * @rmac_osized_frms: Count of received frames of length (including FCS, but not
179 * framing bits) more than 1518 octets, that are otherwise well-formed.
180 *
181 * @rmac_frag_frms: Count of received frames of length (including FCS, but not
182 * framing bits) less than 64 octets that had bad FCS. In other words, counts
183 * fragments (i.e. runts).
184 *
185 * @rmac_jabber_frms: Count of received frames of length (including FCS, but not
186 * framing bits) more than MTU octets that had bad FCS. In other words, counts
187 * jabbers.
188 *
189 * @reserved_4: Reserved.
190 * @rmac_ttl_64_frms: Count of all received MAC frames with length (including
191 * FCS, but not framing bits) of exactly 64 octets. Includes frames received
192 * with frame-too-long, FCS, or length errors.
193 *
194 * @rmac_ttl_65_127_frms: Count of all received MAC frames with length
195 * (including FCS, but not framing bits) of between 65 and 127 octets
196 * inclusive. Includes frames received with frame-too-long, FCS, or length
197 * errors.
198 * @reserved_5: Reserved.
199 * @rmac_ttl_128_255_frms: Count of all received MAC frames with length
200 * (including FCS, but not framing bits) of between 128 and 255 octets
201 * inclusive. Includes frames received with frame-too-long, FCS, or length
202 * errors.
203 *
204 * @rmac_ttl_256_511_frms: Count of all received MAC frames with length
205 * (including FCS, but not framing bits) of between 256 and 511 octets
206 * inclusive. Includes frames received with frame-too-long, FCS, or length
207 * errors.
208 *
209 * @reserved_6: Reserved.
210 * @rmac_ttl_512_1023_frms: Count of all received MAC frames with length
211 * (including FCS, but not framing bits) of between 512 and 1023 octets
212 * inclusive. Includes frames received with frame-too-long, FCS, or length
213 * errors.
214 *
215 * @rmac_ttl_1024_1518_frms: Count of all received MAC frames with length
216 * (including FCS, but not framing bits) of between 1024 and 1518 octets
217 * inclusive. Includes frames received with frame-too-long, FCS, or length
218 * errors.
219 * @reserved_7: Reserved.
220 * @rmac_ip: Count of received IP datagrams. Includes errored IP datagrams.
221 *
222 * @rmac_ip_octets: Count of number of octets in received IP datagrams. Includes
223 * errored IP datagrams.
224 *
225 * @rmac_hdr_err_ip: Count of received IP datagrams that are discarded due to IP
226 * header errors.
227 *
228 * @rmac_drop_ip: Count of received IP datagrams that could not be passed to the
229 * host because of 1) Random Early Discard (RED); 2) Frame steering algorithm
230 * found no available queue; 3) Receive ingress buffer overflow.
231 * @rmac_icmp: Count of received ICMP messages. Includes errored ICMP messages
232 * (due to ICMP checksum fail).
233 *
234 * @reserved_8: Reserved.
235 * @rmac_tcp: Count of received TCP segments. Since Xena is unaware of
236 * connection context, counts all received TCP segments, regardless of whether
237 * or not they pertain to an established connection.
238 *
239 * @rmac_udp: Count of received UDP datagrams.
240 * @rmac_err_drp_udp: Count of received UDP datagrams that were not delivered to
241 * the system because of 1) Random Early Discard (RED); 2) Frame steering
242 * algorithm found no available queue; 3) Receive ingress buffer overflow.
243 *
244 * @rmac_xgmii_err_sym: Count of the number of symbol errors in the received
245 * XGMII data (i.e. PHY indicates "Receive Error" on the XGMII). Only includes
246 * symbol errors that are observed between the XGMII Start Frame Delimiter
247 * and End Frame Delimiter, inclusive. And only increments the count by one for
248 * each frame.
249 *
250 * @rmac_frms_q0: Count of number of frames that pass through queue 0 of receive
251 * buffer.
252 * @rmac_frms_q1: Count of number of frames that pass through queue 1 of receive
253 * buffer.
254 * @rmac_frms_q2: Count of number of frames that pass through queue 2 of receive
255 * buffer.
256 * @rmac_frms_q3: Count of number of frames that pass through queue 3 of receive
257 * buffer.
258 * @rmac_frms_q4: Count of number of frames that pass through queue 4 of receive
259 * buffer.
260 * @rmac_frms_q5: Count of number of frames that pass through queue 5 of receive
261 * buffer.
262 * @rmac_frms_q6: Count of number of frames that pass through queue 6 of receive
263 * buffer.
264 * @rmac_frms_q7: Count of number of frames that pass through queue 7 of receive
265 * buffer.
266 * @rmac_full_q0: Count of number of times that receive buffer queue 0 has
267 * filled up. If a queue is size 0, then this stat is incremented to a value of
268 * 1 when MAC receives its first frame.
269 *
270 * @rmac_full_q1: Count of number of times that receive buffer queue 1 has
271 * filled up. If a queue is size 0, then this stat is incremented to a value of
272 * 1 when MAC receives its first frame.
273 *
274 * @rmac_full_q2: Count of number of times that receive buffer queue 2 has
275 * filled up. If a queue is size 0, then this stat is incremented to a value of
276 * 1 when MAC receives its first frame.
277 *
278 * @rmac_full_q3: Count of number of times that receive buffer queue 3 has
279 * filled up. If a queue is size 0, then this stat is incremented to a value of
280 * 1 when MAC receives its first frame.
281 *
282 * @rmac_full_q4: Count of number of times that receive buffer queue 4 has
283 * filled up. If a queue is size 0, then this stat is incremented to a value of
284 * 1 when MAC receives its first frame.
285 *
286 * @rmac_full_q5: Count of number of times that receive buffer queue 5 has
287 * filled up. If a queue is size 0, then this stat is incremented to a value of
288 * 1 when MAC receives its first frame.
289 *
290 * @rmac_full_q6: Count of number of times that receive buffer queue 6 has
291 * filled up. If a queue is size 0, then this stat is incremented to a value of
292 * 1 when MAC receives its first frame.
293 *
294 * @rmac_full_q7: Count of number of times that receive buffer queue 7 has
295 * filled up. If a queue is size 0, then this stat is incremented to a value of
296 * 1 when MAC receives its first frame.
297 *
298 * @rmac_pause_cnt: Count of number of pause quanta that the MAC has been in the
299 * paused state. Recall, one pause quantum equates to 512 bit times.
300 * @reserved_9: Reserved.
301 * @rmac_xgmii_data_err_cnt: This counter is incremented when either 1) The
302 * Reconcilliation Sublayer (RS) is expecting one control character and gets
303 * another (i.e. expecting Start control character and gets another control
304 * character); 2) Start control character is not in lane 0 or lane 4; 3) The RS
305 * gets a Start control character, but the start frame delimiter is not found in
306 * the correct location.
307 * @rmac_xgmii_ctrl_err_cnt: Maintains a count of unexpected or
308 * misplaced control characters occuring outside of normal data transmission
309 * (i.e. not included in RMAC_XGMII_DATA_ERR_CNT).
310 *
311 * @rmac_accepted_ip: Count of received IP datagrams that were passed to the
312 * system.
313 *
314 * @rmac_err_tcp: Count of received TCP segments containing errors. For example,
315 * bad TCP checksum.
316 *
317 * PCI (bus) Statistics:
318 * @rd_req_cnt: Counts the total number of read requests made by the device.
319 * @new_rd_req_cnt: Counts the requests made for a new read sequence (request
320 * made for the same sequence after a retry or disconnect response are not
321 * counted).
322 * @new_rd_req_rtry_cnt: Counts the Retry responses received on the start of
323 * the new read sequences.
324 * @rd_rtry_cnt: Counts the Retry responses received for read requests.
325 * @wr_rtry_rd_ack_cnt: Increments whenever a read request is accepted by
326 * the target after a write request was terminated with retry.
327 * @wr_req_cnt: Counts the total number of Write requests made by the device.
328 * @new_wr_req_cnt: Counts the requests made for a new write sequence (request
329 * made for the same sequence after a retry or disconnect response are not
330 * counted).
331 * @new_wr_req_rtry_cnt: Counts the requests made for a new write sequence
332 * (request made for the same sequence after a retry or disconnect response are
333 * not counted).
334 *
335 * @wr_rtry_cnt: Counts the Retry responses received for write requests.
336 * @wr_disc_cnt: Write Disconnect. Counts the target initiated disconnects
337 * on write transactions.
338 * @rd_rtry_wr_ack_cnt: Increments whenever a write request is accepted by the
339 * target after a read request was terminated with retry.
340 *
341 * @txp_wr_cnt: Counts the host write transactions to the Tx Pointer
342 * FIFOs.
343 * @txd_rd_cnt: Count of the Transmit Descriptor (TxD) read requests.
344 * @txd_wr_cnt: Count of the TxD write requests.
345 * @rxd_rd_cnt: Count of the Receive Descriptor (RxD) read requests.
346 * @rxd_wr_cnt: Count of the RxD write requests.
347 * @txf_rd_cnt: Count of transmit frame read requests. This will not
348 * equal the number of frames transmitted, as frame data is typically spread
349 * across multiple PCI transactions.
350 * @rxf_wr_cnt: Count of receive frame write requests.
351 *
352 * @tmac_frms_oflow: tbd
353 * @tmac_data_octets_oflow: tbd
354 * @tmac_mcst_frms_oflow: tbd
355 * @tmac_bcst_frms_oflow: tbd
356 * @tmac_ttl_octets_oflow: tbd
357 * @tmac_ucst_frms_oflow: tbd
358 * @tmac_nucst_frms_oflow: tbd
359 * @tmac_any_err_frms_oflow: tbd
360 * @tmac_vlan_frms: tbd
361 * @tmac_vld_ip_oflow: tbd
362 * @tmac_drop_ip_oflow: tbd
363 * @tmac_icmp_oflow: tbd
364 * @tmac_rst_tcp_oflow: tbd
365 * @tmac_udp_oflow: tbd
366 * @reserved_10: tbd
367 * @tpa_unknown_protocol: tbd
368 * @tpa_parse_failure: tbd
369 * @rmac_vld_frms_oflow: tbd
370 * @rmac_data_octets_oflow: tbd
371 * @rmac_vld_mcst_frms_oflow: tbd
372 * @rmac_vld_bcst_frms_oflow: tbd
373 * @rmac_ttl_octets_oflow: tbd
374 * @rmac_accepted_ucst_frms_oflow: tbd
375 * @rmac_accepted_nucst_frms_oflow: tbd
376 * @rmac_discarded_frms_oflow: tbd
377 * @rmac_drop_events_oflow: tbd
378 * @rmac_usized_frms_oflow: tbd
379 * @rmac_osized_frms_oflow: tbd
380 * @rmac_frag_frms_oflow: tbd
381 * @rmac_jabber_frms_oflow: tbd
382 * @rmac_ip_oflow: tbd
383 * @rmac_drop_ip_oflow: tbd
384 * @rmac_icmp_oflow: tbd
385 * @rmac_udp_oflow: tbd
386 * @reserved_11: tbd
387 * @rmac_err_drp_udp_oflow: tbd
388 * @rmac_pause_cnt_oflow: tbd
389 * @rmac_ttl_1519_4095_frms: tbd
390 * @rmac_ttl_4096_8191_frms: tbd
391 * @rmac_ttl_8192_max_frms: tbd
392 * @rmac_ttl_gt_max_frms: tbd
393 * @rmac_osized_alt_frms: tbd
394 * @rmac_jabber_alt_frms: tbd
395 * @rmac_gt_max_alt_frms: tbd
396 * @rmac_vlan_frms: tbd
397 * @rmac_fcs_discard: tbd
398 * @rmac_len_discard: tbd
399 * @rmac_da_discard: tbd
400 * @rmac_pf_discard: tbd
401 * @rmac_rts_discard: tbd
402 * @rmac_wol_discard: tbd
403 * @rmac_red_discard: tbd
404 * @rmac_ingm_full_discard: tbd
405 * @rmac_accepted_ip_oflow: tbd
406 * @reserved_12: tbd
407 * @link_fault_cnt: TBD
408 * @reserved_13: tbd
409 * Xframe hardware statistics.
410 */
411 typedef struct xge_hal_stats_hw_info_t {
412 #ifdef XGE_OS_HOST_BIG_ENDIAN
413 /* Tx MAC statistics counters. */
414 u32 tmac_frms;
415 u32 tmac_data_octets;
416 u64 tmac_drop_frms;
417 u32 tmac_mcst_frms;
418 u32 tmac_bcst_frms;
419 u64 tmac_pause_ctrl_frms;
420 u32 tmac_ttl_octets;
421 u32 tmac_ucst_frms;
422 u32 tmac_nucst_frms;
423 u32 tmac_any_err_frms;
424 u64 tmac_ttl_less_fb_octets;
425 u64 tmac_vld_ip_octets;
426 u32 tmac_vld_ip;
427 u32 tmac_drop_ip;
428 u32 tmac_icmp;
429 u32 tmac_rst_tcp;
430 u64 tmac_tcp;
431 u32 tmac_udp;
432 u32 reserved_0;
433
434 /* Rx MAC Statistics counters. */
435 u32 rmac_vld_frms;
436 u32 rmac_data_octets;
437 u64 rmac_fcs_err_frms;
438 u64 rmac_drop_frms;
439 u32 rmac_vld_mcst_frms;
440 u32 rmac_vld_bcst_frms;
441 u32 rmac_in_rng_len_err_frms;
442 u32 rmac_out_rng_len_err_frms;
443 u64 rmac_long_frms;
444 u64 rmac_pause_ctrl_frms;
445 u64 rmac_unsup_ctrl_frms;
446 u32 rmac_ttl_octets;
447 u32 rmac_accepted_ucst_frms;
448 u32 rmac_accepted_nucst_frms;
449 u32 rmac_discarded_frms;
450 u32 rmac_drop_events;
451 u32 reserved_1;
452 u64 rmac_ttl_less_fb_octets;
453 u64 rmac_ttl_frms;
454 u64 reserved_2;
455 u32 reserved_3;
456 u32 rmac_usized_frms;
457 u32 rmac_osized_frms;
458 u32 rmac_frag_frms;
459 u32 rmac_jabber_frms;
460 u32 reserved_4;
461 u64 rmac_ttl_64_frms;
462 u64 rmac_ttl_65_127_frms;
463 u64 reserved_5;
464 u64 rmac_ttl_128_255_frms;
465 u64 rmac_ttl_256_511_frms;
466 u64 reserved_6;
467 u64 rmac_ttl_512_1023_frms;
468 u64 rmac_ttl_1024_1518_frms;
469 u32 reserved_7;
470 u32 rmac_ip;
471 u64 rmac_ip_octets;
472 u32 rmac_hdr_err_ip;
473 u32 rmac_drop_ip;
474 u32 rmac_icmp;
475 u32 reserved_8;
476 u64 rmac_tcp;
477 u32 rmac_udp;
478 u32 rmac_err_drp_udp;
479 u64 rmac_xgmii_err_sym;
480 u64 rmac_frms_q0;
481 u64 rmac_frms_q1;
482 u64 rmac_frms_q2;
483 u64 rmac_frms_q3;
484 u64 rmac_frms_q4;
485 u64 rmac_frms_q5;
486 u64 rmac_frms_q6;
487 u64 rmac_frms_q7;
488 u16 rmac_full_q0;
489 u16 rmac_full_q1;
490 u16 rmac_full_q2;
491 u16 rmac_full_q3;
492 u16 rmac_full_q4;
493 u16 rmac_full_q5;
494 u16 rmac_full_q6;
495 u16 rmac_full_q7;
496 u32 rmac_pause_cnt;
497 u32 reserved_9;
498 u64 rmac_xgmii_data_err_cnt;
499 u64 rmac_xgmii_ctrl_err_cnt;
500 u32 rmac_accepted_ip;
501 u32 rmac_err_tcp;
502
503 /* PCI/PCI-X Read transaction statistics. */
504 u32 rd_req_cnt;
505 u32 new_rd_req_cnt;
506 u32 new_rd_req_rtry_cnt;
507 u32 rd_rtry_cnt;
508 u32 wr_rtry_rd_ack_cnt;
509
510 /* PCI/PCI-X write transaction statistics. */
511 u32 wr_req_cnt;
512 u32 new_wr_req_cnt;
513 u32 new_wr_req_rtry_cnt;
514 u32 wr_rtry_cnt;
515 u32 wr_disc_cnt;
516 u32 rd_rtry_wr_ack_cnt;
517
518 /* DMA Transaction statistics. */
519 u32 txp_wr_cnt;
520 u32 txd_rd_cnt;
521 u32 txd_wr_cnt;
522 u32 rxd_rd_cnt;
523 u32 rxd_wr_cnt;
524 u32 txf_rd_cnt;
525 u32 rxf_wr_cnt;
526
527 /* Enhanced Herc statistics */
528 u32 tmac_frms_oflow;
529 u32 tmac_data_octets_oflow;
530 u32 tmac_mcst_frms_oflow;
531 u32 tmac_bcst_frms_oflow;
532 u32 tmac_ttl_octets_oflow;
533 u32 tmac_ucst_frms_oflow;
534 u32 tmac_nucst_frms_oflow;
535 u32 tmac_any_err_frms_oflow;
536 u64 tmac_vlan_frms;
537 u32 tmac_vld_ip_oflow;
538 u32 tmac_drop_ip_oflow;
539 u32 tmac_icmp_oflow;
540 u32 tmac_rst_tcp_oflow;
541 u32 tmac_udp_oflow;
542 u32 tpa_unknown_protocol;
543 u32 tpa_parse_failure;
544 u32 reserved_10;
545 u32 rmac_vld_frms_oflow;
546 u32 rmac_data_octets_oflow;
547 u32 rmac_vld_mcst_frms_oflow;
548 u32 rmac_vld_bcst_frms_oflow;
549 u32 rmac_ttl_octets_oflow;
550 u32 rmac_accepted_ucst_frms_oflow;
551 u32 rmac_accepted_nucst_frms_oflow;
552 u32 rmac_discarded_frms_oflow;
553 u32 rmac_drop_events_oflow;
554 u32 rmac_usized_frms_oflow;
555 u32 rmac_osized_frms_oflow;
556 u32 rmac_frag_frms_oflow;
557 u32 rmac_jabber_frms_oflow;
558 u32 rmac_ip_oflow;
559 u32 rmac_drop_ip_oflow;
560 u32 rmac_icmp_oflow;
561 u32 rmac_udp_oflow;
562 u32 rmac_err_drp_udp_oflow;
563 u32 rmac_pause_cnt_oflow;
564 u32 reserved_11;
565 u64 rmac_ttl_1519_4095_frms;
566 u64 rmac_ttl_4096_8191_frms;
567 u64 rmac_ttl_8192_max_frms;
568 u64 rmac_ttl_gt_max_frms;
569 u64 rmac_osized_alt_frms;
570 u64 rmac_jabber_alt_frms;
571 u64 rmac_gt_max_alt_frms;
572 u64 rmac_vlan_frms;
573 u32 rmac_fcs_discard;
574 u32 rmac_len_discard;
575 u32 rmac_da_discard;
576 u32 rmac_pf_discard;
577 u32 rmac_rts_discard;
578 u32 rmac_wol_discard;
579 u32 rmac_red_discard;
580 u32 rmac_ingm_full_discard;
581 u32 rmac_accepted_ip_oflow;
582 u32 reserved_12;
583 u32 link_fault_cnt;
584 u32 reserved_13;
585 #else
586 /* Tx MAC statistics counters. */
587 u32 tmac_data_octets;
588 u32 tmac_frms;
589 u64 tmac_drop_frms;
590 u32 tmac_bcst_frms;
591 u32 tmac_mcst_frms;
592 u64 tmac_pause_ctrl_frms;
593 u32 tmac_ucst_frms;
594 u32 tmac_ttl_octets;
595 u32 tmac_any_err_frms;
596 u32 tmac_nucst_frms;
597 u64 tmac_ttl_less_fb_octets;
598 u64 tmac_vld_ip_octets;
599 u32 tmac_drop_ip;
600 u32 tmac_vld_ip;
601 u32 tmac_rst_tcp;
602 u32 tmac_icmp;
603 u64 tmac_tcp;
604 u32 reserved_0;
605 u32 tmac_udp;
606
607 /* Rx MAC Statistics counters. */
608 u32 rmac_data_octets;
609 u32 rmac_vld_frms;
610 u64 rmac_fcs_err_frms;
611 u64 rmac_drop_frms;
612 u32 rmac_vld_bcst_frms;
613 u32 rmac_vld_mcst_frms;
614 u32 rmac_out_rng_len_err_frms;
615 u32 rmac_in_rng_len_err_frms;
616 u64 rmac_long_frms;
617 u64 rmac_pause_ctrl_frms;
618 u64 rmac_unsup_ctrl_frms;
619 u32 rmac_accepted_ucst_frms;
620 u32 rmac_ttl_octets;
621 u32 rmac_discarded_frms;
622 u32 rmac_accepted_nucst_frms;
623 u32 reserved_1;
624 u32 rmac_drop_events;
625 u64 rmac_ttl_less_fb_octets;
626 u64 rmac_ttl_frms;
627 u64 reserved_2;
628 u32 rmac_usized_frms;
629 u32 reserved_3;
630 u32 rmac_frag_frms;
631 u32 rmac_osized_frms;
632 u32 reserved_4;
633 u32 rmac_jabber_frms;
634 u64 rmac_ttl_64_frms;
635 u64 rmac_ttl_65_127_frms;
636 u64 reserved_5;
637 u64 rmac_ttl_128_255_frms;
638 u64 rmac_ttl_256_511_frms;
639 u64 reserved_6;
640 u64 rmac_ttl_512_1023_frms;
641 u64 rmac_ttl_1024_1518_frms;
642 u32 rmac_ip;
643 u32 reserved_7;
644 u64 rmac_ip_octets;
645 u32 rmac_drop_ip;
646 u32 rmac_hdr_err_ip;
647 u32 reserved_8;
648 u32 rmac_icmp;
649 u64 rmac_tcp;
650 u32 rmac_err_drp_udp;
651 u32 rmac_udp;
652 u64 rmac_xgmii_err_sym;
653 u64 rmac_frms_q0;
654 u64 rmac_frms_q1;
655 u64 rmac_frms_q2;
656 u64 rmac_frms_q3;
657 u64 rmac_frms_q4;
658 u64 rmac_frms_q5;
659 u64 rmac_frms_q6;
660 u64 rmac_frms_q7;
661 u16 rmac_full_q3;
662 u16 rmac_full_q2;
663 u16 rmac_full_q1;
664 u16 rmac_full_q0;
665 u16 rmac_full_q7;
666 u16 rmac_full_q6;
667 u16 rmac_full_q5;
668 u16 rmac_full_q4;
669 u32 reserved_9;
670 u32 rmac_pause_cnt;
671 u64 rmac_xgmii_data_err_cnt;
672 u64 rmac_xgmii_ctrl_err_cnt;
673 u32 rmac_err_tcp;
674 u32 rmac_accepted_ip;
675
676 /* PCI/PCI-X Read transaction statistics. */
677 u32 new_rd_req_cnt;
678 u32 rd_req_cnt;
679 u32 rd_rtry_cnt;
680 u32 new_rd_req_rtry_cnt;
681
682 /* PCI/PCI-X Write/Read transaction statistics. */
683 u32 wr_req_cnt;
684 u32 wr_rtry_rd_ack_cnt;
685 u32 new_wr_req_rtry_cnt;
686 u32 new_wr_req_cnt;
687 u32 wr_disc_cnt;
688 u32 wr_rtry_cnt;
689
690 /* PCI/PCI-X Write / DMA Transaction statistics. */
691 u32 txp_wr_cnt;
692 u32 rd_rtry_wr_ack_cnt;
693 u32 txd_wr_cnt;
694 u32 txd_rd_cnt;
695 u32 rxd_wr_cnt;
696 u32 rxd_rd_cnt;
697 u32 rxf_wr_cnt;
698 u32 txf_rd_cnt;
699
700 /* Enhanced Herc statistics */
701 u32 tmac_data_octets_oflow;
702 u32 tmac_frms_oflow;
703 u32 tmac_bcst_frms_oflow;
704 u32 tmac_mcst_frms_oflow;
705 u32 tmac_ucst_frms_oflow;
706 u32 tmac_ttl_octets_oflow;
707 u32 tmac_any_err_frms_oflow;
708 u32 tmac_nucst_frms_oflow;
709 u64 tmac_vlan_frms;
710 u32 tmac_drop_ip_oflow;
711 u32 tmac_vld_ip_oflow;
712 u32 tmac_rst_tcp_oflow;
713 u32 tmac_icmp_oflow;
714 u32 tpa_unknown_protocol;
715 u32 tmac_udp_oflow;
716 u32 reserved_10;
717 u32 tpa_parse_failure;
718 u32 rmac_data_octets_oflow;
719 u32 rmac_vld_frms_oflow;
720 u32 rmac_vld_bcst_frms_oflow;
721 u32 rmac_vld_mcst_frms_oflow;
722 u32 rmac_accepted_ucst_frms_oflow;
723 u32 rmac_ttl_octets_oflow;
724 u32 rmac_discarded_frms_oflow;
725 u32 rmac_accepted_nucst_frms_oflow;
726 u32 rmac_usized_frms_oflow;
727 u32 rmac_drop_events_oflow;
728 u32 rmac_frag_frms_oflow;
729 u32 rmac_osized_frms_oflow;
730 u32 rmac_ip_oflow;
731 u32 rmac_jabber_frms_oflow;
732 u32 rmac_icmp_oflow;
733 u32 rmac_drop_ip_oflow;
734 u32 rmac_err_drp_udp_oflow;
735 u32 rmac_udp_oflow;
736 u32 reserved_11;
737 u32 rmac_pause_cnt_oflow;
738 u64 rmac_ttl_1519_4095_frms;
739 u64 rmac_ttl_4096_8191_frms;
740 u64 rmac_ttl_8192_max_frms;
741 u64 rmac_ttl_gt_max_frms;
742 u64 rmac_osized_alt_frms;
743 u64 rmac_jabber_alt_frms;
744 u64 rmac_gt_max_alt_frms;
745 u64 rmac_vlan_frms;
746 u32 rmac_len_discard;
747 u32 rmac_fcs_discard;
748 u32 rmac_pf_discard;
749 u32 rmac_da_discard;
750 u32 rmac_wol_discard;
751 u32 rmac_rts_discard;
752 u32 rmac_ingm_full_discard;
753 u32 rmac_red_discard;
754 u32 reserved_12;
755 u32 rmac_accepted_ip_oflow;
756 u32 reserved_13;
757 u32 link_fault_cnt;
758 #endif
759 } xge_hal_stats_hw_info_t;
760
761 /**
762 * struct xge_hal_stats_channel_into_t - HAL channel statistics.
763 * @full_cnt: TBD
764 * @usage_max: TBD
765 * @reserve_free_swaps_cnt: Reserve/free swap counter. Internal usage.
766 * @max_compl_per_intr_cnt: Maximum number of completions per interrupt.
767 * @avg_compl_per_intr_cnt: Average number of completions per interrupt.
768 * Note that a total number of completed descriptors
769 * for the given channel can be calculated as
770 * (@traffic_intr_cnt * @avg_compl_per_intr_cnt).
771 * @total_compl_cnt: Total completion count.
772 * @total_compl_cnt == (@traffic_intr_cnt * @avg_compl_per_intr_cnt).
773 * @total_posts: Total number of descriptor postings on the channel.
774 * Counts the number of xge_hal_ring_dtr_post()
775 * or xge_hal_fifo_dtr_post() calls by ULD, for ring and fifo
776 * channel, respectively.
777 * @total_posts_many: Total number of posts on the channel that involved
778 * more than one descriptor. Counts the number of
779 * xge_hal_fifo_dtr_post_many() calls performed by ULD.
780 * @total_buffers: Total number of buffers posted on the channel.
781 * @copied_frags: TBD
782 * @copied_buffers: TBD
783 * @avg_buffers_per_post: Average number of buffers transferred in a single
784 * post operation.
785 * Calculated as @total_buffers/@total_posts.
786 * @avg_buffer_size: Average buffer size transferred by a single post
787 * operation on a fifo channel. The counter is not supported for a ring
788 * channel. Calculated as a total number of transmitted octets divided
789 * by @total_buffers.
790 * @avg_post_size: Average amount of data transferred by a single post.
791 * Calculated as a total number of transmitted octets divided by
792 * @total_posts.
793 * @ring_bump_cnt: Ring "bump" count. Number of times the hardware could
794 * not post receive data (and had to continue keeping it on-board)
795 * because of unavailable receive descriptor(s).
796 * @total_posts_dtrs_many: Total number of posts on the channel that involving
797 * more than one descriptor.
798 * @total_posts_frags_many: Total number of fragments posted on the channel
799 * during post requests of multiple descriptors.
800 * @total_posts_dang_dtrs: Total number of posts on the channel involving
801 * dangling descriptors.
802 * @total_posts_dang_frags: Total number of dangling fragments posted on the channel
803 * during post request containing multiple descriptors.
804 *
805 * HAL channel counters.
806 * See also: xge_hal_stats_device_info_t{}.
807 */
808 typedef struct xge_hal_stats_channel_info_t {
809 u32 full_cnt;
810 u32 usage_max;
811 u32 reserve_free_swaps_cnt;
812 u32 avg_compl_per_intr_cnt;
813 u32 total_compl_cnt;
814 u32 total_posts;
815 u32 total_posts_many;
816 u32 total_buffers;
817 u32 copied_frags;
818 u32 copied_buffers;
819 u32 avg_buffers_per_post;
820 u32 avg_buffer_size;
821 u32 avg_post_size;
822 u32 ring_bump_cnt;
823 u32 total_posts_dtrs_many;
824 u32 total_posts_frags_many;
825 u32 total_posts_dang_dtrs;
826 u32 total_posts_dang_frags;
827 } xge_hal_stats_channel_info_t;
828
829 /**
830 * struct xge_hal_xpak_counter_t - HAL xpak error counters
831 * @excess_temp: excess transceiver_temperature count
832 * @excess_bias_current: excess laser_bias_current count
833 * @excess_laser_output: excess laser_output_power count
834 * @tick_period: tick count for each cycle
835 */
836 typedef struct xge_hal_xpak_counter_t {
837 u32 excess_temp;
838 u32 excess_bias_current;
839 u32 excess_laser_output;
840 u32 tick_period;
841 } xge_hal_xpak_counter_t;
842
843 /**
844 * struct xge_hal_stats_xpak_t - HAL xpak stats
845 * @alarm_transceiver_temp_high: alarm_transceiver_temp_high count value
846 * @alarm_transceiver_temp_low : alarm_transceiver_temp_low count value
847 * @alarm_laser_bias_current_high: alarm_laser_bias_current_high count value
848 * @alarm_laser_bias_current_low: alarm_laser_bias_current_low count value
849 * @alarm_laser_output_power_high: alarm_laser_output_power_high count value
850 * @alarm_laser_output_power_low: alarm_laser_output_power_low count value
851 * @warn_transceiver_temp_high: warn_transceiver_temp_high count value
852 * @warn_transceiver_temp_low: warn_transceiver_temp_low count value
853 * @warn_laser_bias_current_high: warn_laser_bias_current_high count value
854 * @warn_laser_bias_current_low: warn_laser_bias_current_low count value
855 * @warn_laser_output_power_high: warn_laser_output_power_high count value
856 * @warn_laser_output_power_low: warn_laser_output_power_low count value
857 */
858 typedef struct xge_hal_stats_xpak_t {
859 u16 alarm_transceiver_temp_high;
860 u16 alarm_transceiver_temp_low;
861 u16 alarm_laser_bias_current_high;
862 u16 alarm_laser_bias_current_low;
863 u16 alarm_laser_output_power_high;
864 u16 alarm_laser_output_power_low;
865 u16 warn_transceiver_temp_high;
866 u16 warn_transceiver_temp_low;
867 u16 warn_laser_bias_current_high;
868 u16 warn_laser_bias_current_low;
869 u16 warn_laser_output_power_high;
870 u16 warn_laser_output_power_low;
871 } xge_hal_stats_xpak_t;
872
873
874
875 /**
876 * struct xge_hal_stats_sw_err_t - HAL device error statistics.
877 * @sm_err_cnt: TBD
878 * @single_ecc_err_cnt: TBD
879 * @double_ecc_err_cnt: TBD
880 * @ecc_err_cnt: ECC error count.
881 * @parity_err_cnt: Parity error count.
882 * @serr_cnt: Number of exceptions indicated to the host via PCI SERR#.
883 * @rxd_t_code_err_cnt: Array of receive transfer codes. The position
884 * (index) in this array reflects the transfer code type, for instance
885 * 0x7 - for "invalid receive buffer size", or 0x8 - for ECC.
886 * Value rxd_t_code_err_cnt[i] reflects the
887 * number of times the corresponding transfer code was encountered.
888 *
889 * @txd_t_code_err_cnt: Array of transmit transfer codes. The position
890 * (index) in this array reflects the transfer code type, for instance
891 * 0xA - "loss of link".
892 * Value txd_t_code_err_cnt[i] reflects the
893 * number of times the corresponding transfer code was encountered.
894 * @stats_xpak: TBD
895 * @xpak_counter: TBD
896 */
897 typedef struct xge_hal_stats_sw_err_t {
898 u32 sm_err_cnt;
899 u32 single_ecc_err_cnt;
900 u32 double_ecc_err_cnt;
901 u32 ecc_err_cnt;
902 u32 parity_err_cnt;
903 u32 serr_cnt;
904 u32 rxd_t_code_err_cnt[16];
905 u32 txd_t_code_err_cnt[16];
906 xge_hal_stats_xpak_t stats_xpak;
907 xge_hal_xpak_counter_t xpak_counter;
908 } xge_hal_stats_sw_err_t;
909
910 /**
911 * struct xge_hal_stats_device_info_t - HAL own per-device statistics.
912 *
913 * @rx_traffic_intr_cnt: TBD
914 * @tx_traffic_intr_cnt: TBD
915 * @txpic_intr_cnt: TBD
916 * @txdma_intr_cnt: TBD
917 * @txmac_intr_cnt: TBD
918 * @txxgxs_intr_cnt: TBD
919 * @rxpic_intr_cnt: TBD
920 * @rxdma_intr_cnt: TBD
921 * @rxmac_intr_cnt: TBD
922 * @rxxgxs_intr_cnt: TBD
923 * @mc_intr_cnt: TBD
924 * @not_traffic_intr_cnt: Number of times the host was interrupted
925 * without new completions.
926 * "Non-traffic interrupt counter".
927 * @not_xge_intr_cnt: TBD
928 * @traffic_intr_cnt: Number of traffic interrupts for the device.
929 * @total_intr_cnt: Total number of traffic interrupts for the device.
930 * @total_intr_cnt == @traffic_intr_cnt +
931 * @not_traffic_intr_cnt
932 * @soft_reset_cnt: Number of times soft reset is done on this device.
933 * @rxufca_hi_adjust_cnt: TODO
934 * @rxufca_lo_adjust_cnt: TODO
935 * @bimodal_hi_adjust_cnt: TODO
936 * @bimodal_lo_adjust_cnt: TODO
937 *
938 * @tot_frms_lroised: TBD
939 * @tot_lro_sessions: TBD
940 * @lro_frm_len_exceed_cnt: TBD
941 * @lro_sg_exceed_cnt: TBD
942 * @lro_out_of_seq_pkt_cnt: TBD
943 * @lro_dup_pkt_cnt: TBD
944 *
945 * HAL per-device statistics.
946 * See also: xge_hal_stats_channel_info_t{}.
947 */
948 typedef struct xge_hal_stats_device_info_t {
949 u32 rx_traffic_intr_cnt;
950 u32 tx_traffic_intr_cnt;
951 u32 txpic_intr_cnt;
952 u32 txdma_intr_cnt;
953 u32 pfc_err_cnt;
954 u32 tda_err_cnt;
955 u32 pcc_err_cnt;
956 u32 tti_err_cnt;
957 u32 lso_err_cnt;
958 u32 tpa_err_cnt;
959 u32 sm_err_cnt;
960 u32 txmac_intr_cnt;
961 u32 mac_tmac_err_cnt;
962 u32 txxgxs_intr_cnt;
963 u32 xgxs_txgxs_err_cnt;
964 |