2 * Copyright (c) 2002-2007 Neterion, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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
29 #ifndef XGE_HAL_STATS_H
30 #define XGE_HAL_STATS_H
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>
40 * struct xge_hal_stats_hw_info_t - Xframe hardware statistics.
41 * Transmit MAC Statistics:
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
47 * @tmac_data_octets: Count of data and padding octets of successfully
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).
54 * @tmac_mcst_frms: Count of successfully transmitted frames to a multicast
55 * address. Does not include frames sent to the broadcast address.
57 * @tmac_bcst_frms: Count of successfully transmitted frames to the broadcast
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
65 * @tmac_ttl_octets: Count of total octets of transmitted frames, including
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.
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.
76 * @tmac_ttl_less_fb_octets: Count of total octets of transmitted
77 * frames, not including framing characters (i.e. less framing bits)
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.
83 * @tmac_vld_ip: Count of transmitted IP datagrams that were passed to the
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
91 * @tmac_icmp: Count of transmitted ICMP messages. Includes messages not sent
92 * due to problems within ICMP.
94 * @tmac_rst_tcp: Count of transmitted TCP segments containing the RST flag.
96 * @tmac_tcp: Count of transmitted TCP segments. Note that Xena has
97 * no knowledge of retransmission.
99 * @tmac_udp: Count of transmitted UDP datagrams.
100 * @reserved_0: Reserved.
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.
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
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.
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.
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,
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,
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
133 * @rmac_out_rng_len_err_frms: Count of received frames with length/type field
134 * between 1501 and 1535 decimal, inclusive.
136 * @rmac_long_frms: Count of received frames that are longer than
137 * rmac_max_pyld_len + 18 bytes (+22 bytes if VLAN-tagged).
139 * @rmac_pause_ctrl_frms: Count of received MAC PAUSE control frames.
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.
145 * @rmac_ttl_octets: Count of total octets of received frames, including framing
148 * @rmac_accepted_ucst_frms: Count of successfully received frames
149 * containing a unicast address. Only includes frames that are passed to the
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.
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.
163 * @rmac_drop_events: Because the RMAC drops one frame at a time, this stat
164 * matches rmac_drop_frms.
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).
170 * @rmac_ttl_frms: Count of all received MAC frames, including frames received
171 * with frame-too-long, FCS, or length errors.
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.
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.
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).
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
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.
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
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
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
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
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
219 * @reserved_7: Reserved.
220 * @rmac_ip: Count of received IP datagrams. Includes errored IP datagrams.
222 * @rmac_ip_octets: Count of number of octets in received IP datagrams. Includes
223 * errored IP datagrams.
225 * @rmac_hdr_err_ip: Count of received IP datagrams that are discarded due to IP
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).
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.
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.
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
250 * @rmac_frms_q0: Count of number of frames that pass through queue 0 of receive
252 * @rmac_frms_q1: Count of number of frames that pass through queue 1 of receive
254 * @rmac_frms_q2: Count of number of frames that pass through queue 2 of receive
256 * @rmac_frms_q3: Count of number of frames that pass through queue 3 of receive
258 * @rmac_frms_q4: Count of number of frames that pass through queue 4 of receive
260 * @rmac_frms_q5: Count of number of frames that pass through queue 5 of receive
262 * @rmac_frms_q6: Count of number of frames that pass through queue 6 of receive
264 * @rmac_frms_q7: Count of number of frames that pass through queue 7 of receive
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.
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.
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.
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.
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.
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.
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.
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.
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).
311 * @rmac_accepted_ip: Count of received IP datagrams that were passed to the
314 * @rmac_err_tcp: Count of received TCP segments containing errors. For example,
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
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
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
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.
341 * @txp_wr_cnt: Counts the host write transactions to the Tx Pointer
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.
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
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
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
407 * @link_fault_cnt: TBD
409 * Xframe hardware statistics.
411 typedef struct xge_hal_stats_hw_info_t {
412 #ifdef XGE_OS_HOST_BIG_ENDIAN
413 /* Tx MAC statistics counters. */
415 u32 tmac_data_octets;
419 u64 tmac_pause_ctrl_frms;
423 u32 tmac_any_err_frms;
424 u64 tmac_ttl_less_fb_octets;
425 u64 tmac_vld_ip_octets;
434 /* Rx MAC Statistics counters. */
436 u32 rmac_data_octets;
437 u64 rmac_fcs_err_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;
444 u64 rmac_pause_ctrl_frms;
445 u64 rmac_unsup_ctrl_frms;
447 u32 rmac_accepted_ucst_frms;
448 u32 rmac_accepted_nucst_frms;
449 u32 rmac_discarded_frms;
450 u32 rmac_drop_events;
452 u64 rmac_ttl_less_fb_octets;
456 u32 rmac_usized_frms;
457 u32 rmac_osized_frms;
459 u32 rmac_jabber_frms;
461 u64 rmac_ttl_64_frms;
462 u64 rmac_ttl_65_127_frms;
464 u64 rmac_ttl_128_255_frms;
465 u64 rmac_ttl_256_511_frms;
467 u64 rmac_ttl_512_1023_frms;
468 u64 rmac_ttl_1024_1518_frms;
478 u32 rmac_err_drp_udp;
479 u64 rmac_xgmii_err_sym;
498 u64 rmac_xgmii_data_err_cnt;
499 u64 rmac_xgmii_ctrl_err_cnt;
500 u32 rmac_accepted_ip;
503 /* PCI/PCI-X Read transaction statistics. */
506 u32 new_rd_req_rtry_cnt;
508 u32 wr_rtry_rd_ack_cnt;
510 /* PCI/PCI-X write transaction statistics. */
513 u32 new_wr_req_rtry_cnt;
516 u32 rd_rtry_wr_ack_cnt;
518 /* DMA Transaction statistics. */
527 /* Enhanced Herc statistics */
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;
537 u32 tmac_vld_ip_oflow;
538 u32 tmac_drop_ip_oflow;
540 u32 tmac_rst_tcp_oflow;
542 u32 tpa_unknown_protocol;
543 u32 tpa_parse_failure;
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;
559 u32 rmac_drop_ip_oflow;
562 u32 rmac_err_drp_udp_oflow;
563 u32 rmac_pause_cnt_oflow;
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;
573 u32 rmac_fcs_discard;
574 u32 rmac_len_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;
586 /* Tx MAC statistics counters. */
587 u32 tmac_data_octets;
592 u64 tmac_pause_ctrl_frms;
595 u32 tmac_any_err_frms;
597 u64 tmac_ttl_less_fb_octets;
598 u64 tmac_vld_ip_octets;
607 /* Rx MAC Statistics counters. */
608 u32 rmac_data_octets;
610 u64 rmac_fcs_err_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;
617 u64 rmac_pause_ctrl_frms;
618 u64 rmac_unsup_ctrl_frms;
619 u32 rmac_accepted_ucst_frms;
621 u32 rmac_discarded_frms;
622 u32 rmac_accepted_nucst_frms;
624 u32 rmac_drop_events;
625 u64 rmac_ttl_less_fb_octets;
628 u32 rmac_usized_frms;
631 u32 rmac_osized_frms;
633 u32 rmac_jabber_frms;
634 u64 rmac_ttl_64_frms;
635 u64 rmac_ttl_65_127_frms;
637 u64 rmac_ttl_128_255_frms;
638 u64 rmac_ttl_256_511_frms;
640 u64 rmac_ttl_512_1023_frms;
641 u64 rmac_ttl_1024_1518_frms;
650 u32 rmac_err_drp_udp;
652 u64 rmac_xgmii_err_sym;
671 u64 rmac_xgmii_data_err_cnt;
672 u64 rmac_xgmii_ctrl_err_cnt;
674 u32 rmac_accepted_ip;
676 /* PCI/PCI-X Read transaction statistics. */
680 u32 new_rd_req_rtry_cnt;
682 /* PCI/PCI-X Write/Read transaction statistics. */
684 u32 wr_rtry_rd_ack_cnt;
685 u32 new_wr_req_rtry_cnt;
690 /* PCI/PCI-X Write / DMA Transaction statistics. */
692 u32 rd_rtry_wr_ack_cnt;
700 /* Enhanced Herc statistics */
701 u32 tmac_data_octets_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;
710 u32 tmac_drop_ip_oflow;
711 u32 tmac_vld_ip_oflow;
712 u32 tmac_rst_tcp_oflow;
714 u32 tpa_unknown_protocol;
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;
731 u32 rmac_jabber_frms_oflow;
733 u32 rmac_drop_ip_oflow;
734 u32 rmac_err_drp_udp_oflow;
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;
746 u32 rmac_len_discard;
747 u32 rmac_fcs_discard;
750 u32 rmac_wol_discard;
751 u32 rmac_rts_discard;
752 u32 rmac_ingm_full_discard;
753 u32 rmac_red_discard;
755 u32 rmac_accepted_ip_oflow;
759 } xge_hal_stats_hw_info_t;
762 * struct xge_hal_stats_channel_into_t - HAL channel statistics.
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.
782 * @copied_buffers: TBD
783 * @avg_buffers_per_post: Average number of buffers transferred in a single
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
790 * @avg_post_size: Average amount of data transferred by a single post.
791 * Calculated as a total number of transmitted octets divided by
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.
805 * HAL channel counters.
806 * See also: xge_hal_stats_device_info_t{}.
808 typedef struct xge_hal_stats_channel_info_t {
811 u32 reserve_free_swaps_cnt;
812 u32 avg_compl_per_intr_cnt;
815 u32 total_posts_many;
819 u32 avg_buffers_per_post;
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;
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
836 typedef struct xge_hal_xpak_counter_t {
838 u32 excess_bias_current;
839 u32 excess_laser_output;
841 } xge_hal_xpak_counter_t;
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
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;
876 * struct xge_hal_stats_sw_err_t - HAL device error statistics.
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.
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.
897 typedef struct xge_hal_stats_sw_err_t {
899 u32 single_ecc_err_cnt;
900 u32 double_ecc_err_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;
911 * struct xge_hal_stats_device_info_t - HAL own per-device statistics.
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
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
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
945 * HAL per-device statistics.
946 * See also: xge_hal_stats_channel_info_t{}.
948 typedef struct xge_hal_stats_device_info_t {
949 u32 rx_traffic_intr_cnt;
950 u32 tx_traffic_intr_cnt;
961 u32 mac_tmac_err_cnt;
963 u32 xgxs_txgxs_err_cnt;
971 u32 mac_rmac_err_cnt;
973 u32 xgxs_rxgxs_err_cnt;
975 u32 not_traffic_intr_cnt;
976 u32 not_xge_intr_cnt;
977 u32 traffic_intr_cnt;
980 u32 rxufca_hi_adjust_cnt;
981 u32 rxufca_lo_adjust_cnt;
982 u32 bimodal_hi_adjust_cnt;
983 u32 bimodal_lo_adjust_cnt;
984 #ifdef XGE_HAL_CONFIG_LRO
985 u32 tot_frms_lroised;
986 u32 tot_lro_sessions;
987 u32 lro_frm_len_exceed_cnt;
988 u32 lro_sg_exceed_cnt;
989 u32 lro_out_of_seq_pkt_cnt;
992 } xge_hal_stats_device_info_t;
994 /* ========================== XFRAME ER STATISTICS ======================== */
995 #define XGE_HAL_MAC_LINKS 3
996 #define XGE_HAL_MAC_AGGREGATORS 2
997 #define XGE_HAL_VPATHS 17
999 * struct xge_hal_stats_link_info_t - XGMAC statistics for a link
1001 * @tx_frms: Count of transmitted MAC frames for mac the link.
1002 * @tx_ttl_eth_octets: Count of total octets of transmitted frames
1004 * @tx_data_octets: Count of data and padding octets of transmitted
1005 * frames for mac the link.
1006 * @tx_mcst_frms: Count of multicast MAC frames for mac the link.
1007 * @tx_bcst_frms: Count of broadcast MAC frames for mac the link.
1008 * @tx_ucst_frms: Count of unicast MAC frames for mac the link.
1009 * @tx_tagged_frms: Count of transmitted frames containing a VLAN tag
1011 * @tx_vld_ip: Count of transmitted IP datagrams for mac the link.
1012 * @tx_vld_ip_octets: Count of transmitted IP octets for mac the link.
1013 * @tx_icmp: Count of transmitted ICMP messages for mac the link.
1014 * @tx_tcp: Count of transmitted TCP segments for mac the link.
1015 * @tx_rst_tcp: Count of transmitted TCP segments containing the RST
1016 * flag mac the link.
1017 * @tx_udp: Count of transmitted UDP datagrams for mac the link.
1018 * @tx_unknown_protocol: Count of transmitted packets of unknown
1019 * protocol for mac the link.
1020 * @tx_parse_error: Count of transmitted packets with parsing errors
1022 * @tx_pause_ctrl_frms: Count of MAC PAUSE control frames for mac
1024 * @tx_lacpdu_frms: Count of LACPDUs transmitted for mac the link.
1025 * @tx_marker_pdu_frms: Count of Marker PDUs transmitted for mac the
1027 * @tx_marker_resp_pdu_frms: Count of Marker Response PDUs transmitted
1029 * @tx_drop_ip: Count of dropped IP packets from the transmission path
1031 * @tx_xgmii_char1_match: Count of the number of transmitted XGMII
1032 * characters that match first pattern, for mac the link.
1033 * @tx_xgmii_char2_match: Count of the number of transmitted XGMII
1034 * characters that match second pattern, for mac the link.
1035 * @tx_xgmii_column1_match: Count of the number of transmitted XGMII
1036 * columns that match first pattern, for mac the link.
1037 * @tx_xgmii_column2_match: Count of the number of transmitted XGMII
1038 * columns that match second pattern, for mac the link.
1039 * @tx_drop_frms: Count of frames dropped due to internal errors during
1040 * transmission for mac the link.
1041 * @tx_any_err_frms: Count of frames dropped due to any error during
1042 * transmission for mac the link.
1043 * @rx_ttl_frms: Count of all received MAC frames for mac the link.
1044 * @rx_vld_frms: Count of all successfully received MAC frames for mac
1046 * @rx_offld_frms: Count of all offloaded received MAC frames for mac
1048 * @rx_ttl_eth_octets: Count of total octets of received frames, not
1049 * including framing characters for mac the link.
1050 * @rx_data_octets: Count of data and padding octets of successfully
1051 * received frames for mac the link.
1052 * @rx_offld_octets: Count of total octets, not including framing
1053 * characters, of offloaded received frames for mac the link.
1054 * @rx_vld_mcst_frms: Count of successfully received multicast MAC
1055 * frames for mac the link.
1056 * @rx_vld_bcst_frms: Count of successfully received broadcast MAC
1057 * frames for mac the link.
1058 * @rx_accepted_ucst_frms: Count of successfully received unicast MAC
1059 * frames for mac the link.
1060 * @rx_accepted_nucst_frms: Count of successfully received non-unicast
1061 * MAC frames for mac the link.
1062 * @rx_tagged_frms: Count of received frames containing a VLAN tag for
1064 * @rx_long_frms: Count of received frames that are longer than
1065 * RX_MAX_PYLD_LEN + 18 bytes (+ 22 bytes if VLAN-tagged) for mac the link.
1066 * @rx_usized_frms: Count of received frames of length less than 64
1067 * octets, for mac the link.
1068 * @rx_osized_frms: Count of received frames of length more than 1518
1069 * octets for mac the link.
1070 * @rx_frag_frms: Count of received frames of length less than 64
1071 * octets that had bad FCS, for mac the link.
1072 * @rx_jabber_frms: Count of received frames of length more than 1518
1073 * octets that had bad FCS, for mac the link.
1074 * @rx_ttl_64_frms: Count of all received MAC frames with length of
1075 * exactly 64 octets, for mac the link.
1076 * @rx_ttl_65_127_frms: Count of all received MAC frames with length
1077 * of between 65 and 127 octets inclusive, for mac the link.
1078 * @rx_ttl_128_255_frms: Count of all received MAC frames with length
1079 * of between 128 and 255 octets inclusive, for mac the link.
1080 * @rx_ttl_256_511_frms: Count of all received MAC frames with length
1081 * of between 246 and 511 octets inclusive, for mac the link.
1082 * @rx_ttl_512_1023_frms: Count of all received MAC frames with length
1083 * of between 512 and 1023 octets inclusive, for mac the link.
1084 * @rx_ttl_1024_1518_frms: Count of all received MAC frames with length
1085 * of between 1024 and 1518 octets inclusive, for mac the link.
1086 * @rx_ttl_1519_4095_frms: Count of all received MAC frames with length
1087 * of between 1519 and 4095 octets inclusive, for mac the link.
1088 * @rx_ttl_40956_8191_frms: Count of all received MAC frames with length
1089 * of between 4096 and 8191 octets inclusive, for mac the link.
1090 * @rx_ttl_8192_max_frms: Count of all received MAC frames with length
1091 * of between 8192 and RX_MAX_PYLD_LEN+18 octets inclusive, for mac the link.
1092 * @rx_ttl_gt_max_frms: Count of all received MAC frames with length
1093 * exceeding RX_MAX_PYLD_LEN+18 octets inclusive, for mac the link.
1094 * @rx_ip: Count of received IP datagrams, for mac the link.
1095 * @rx_accepted_ip: Count of received and accepted IP datagrams,
1097 * @rx_ip_octets: Count of number of octets in received IP datagrams,
1099 * @rx_hdr_err_ip: Count of received IP datagrams that are discarded
1100 * due to IP header errors, for mac the link.
1101 * @rx_icmp: Count of received ICMP messages for mac the link.
1102 * @rx_tcp: Count of received TCP segments for mac the link.
1103 * @rx_udp: Count of received UDP datagrams for mac the link.
1104 * @rx_err_tcp: Count of received TCP segments containing errors for
1106 * @rx_pause_cnt: Count of number of pause quanta that the MAC has
1107 * been in the paused state, for mac the link.
1108 * @rx_pause_ctrl_frms: Count of received MAC PAUSE control frames for
1110 * @rx_unsup_ctrl_frms: Count of received MAC control frames that do
1111 * not contain the PAUSE opcode for mac the link.
1112 * @rx_fcs_err_frms: Count of received MAC frames that do not pass FCS
1114 * @rx_in_rng_len_err_frms: Count of received frames with a length/type
1115 * field value between 46 and 1500 inclusive, that does not match the number
1116 * of data octets received, for mac the link.
1117 * @rx_out_rng_len_err_frms: Count of received frames with length/type
1118 * field between 1501 and 1535 decimal, inclusive. for mac the link.
1119 * @rx_drop_frms: Count of dropped frames from receive path for mac
1121 * @rx_discarded_frms: Count of discarded frames from receive path for
1123 * @rx_drop_ip: Count of droppen IP datagrams from receive path for
1125 * @rx_err_drp_udp: Count of droppen UDP datagrams from receive path
1127 * @rx_lacpdu_frms: Count of valid LACPDUs received for mac the link.
1128 * @rx_marker_pdu_frms: Count of valid Marker PDUs received for mac
1130 * @rx_marker_resp_pdu_frms: Count of valid Marker Response PDUs
1131 * received for mac the link.
1132 * @rx_unknown_pdu_frms: Count of unknown PDUs received for mac the link.
1133 * @rx_illegal_pdu_frms: Count of illegal PDUs received for mac the link.
1134 * @rx_fcs_discard: Count of discarded PDUs received for mac the link.
1135 * @rx_len_discard: Count of received frames that were discarded
1136 * because of an invalid frame length, for mac the link.
1137 * @rx_len_discard: Count of received frames that were discarded
1138 * because of an invalid destination MAC address, for mac the link.
1139 * @rx_pf_discard: Count of received frames that were discarded for
1141 * @rx_trash_discard: Count of received frames that were steered to the
1142 * trash queue for mac the link.
1143 * @rx_rts_discard: Count of received frames that were discarded by RTS
1144 * logic for mac the link.
1145 * @rx_wol_discard: Count of received frames that were discarded by WOL
1146 * logic for mac the link.
1147 * @rx_red_discard: Count of received frames that were discarded by RED
1148 * logic for mac the link.
1149 * @rx_ingm_full_discard: Count of received frames that were discarded
1150 * because the internal ingress memory was full for mac the link.
1151 * @rx_xgmii_data_err_cnt: Count of unexpected control characters
1152 * during normal data transmission for mac the link.
1153 * @rx_xgmii_ctrl_err_cnt: Count of unexpected or misplaced control
1154 * characters occuring between times of normal data transmission for mac
1156 * @rx_xgmii_err_sym: Count of the number of symbol errors in the
1157 * received XGMII data for mac the link.
1158 * @rx_xgmii_char1_match: Count of the number of XGMII characters
1159 * that match first pattern defined in MAC_STATS_RX_XGMII_CHAR_LINK_N.
1160 * @rx_xgmii_char2_match: Count of the number of XGMII characters
1161 * that match second pattern defined in MAC_STATS_RX_XGMII_CHAR_LINK_N.
1162 * @rx_xgmii_column1_match: Count of the number of XGMII columns
1163 * that match a pattern defined in MAC_STATS_RX_XGMII_COLUMN1_LINK_N.
1164 * @rx_xgmii_column2_match: Count of the number of XGMII columns
1165 * that match a pattern defined in MAC_STATS_RX_XGMII_COLUMN1_LINK_N.
1166 * @rx_local_fault: Count of the number of local faults for mac the link.
1167 * @rx_remote_fault: Count of the number of remote faults for mac the
1169 * @rx_queue_full: Count of the number of frame destined for a full
1170 * queue for mac the link.
1172 typedef struct xge_hal_stats_link_info_t {
1174 u64 tx_ttl_eth_octets;
1181 u64 tx_vld_ip_octets;
1186 u64 tx_unknown_protocol;
1188 u64 tx_pause_ctrl_frms;
1190 u64 tx_marker_pdu_frms;
1191 u64 tx_marker_resp_pdu_frms;
1193 u64 tx_xgmii_char1_match;
1194 u64 tx_xgmii_char2_match;
1195 u64 tx_xgmii_column1_match;
1196 u64 tx_xgmii_column2_match;
1198 u64 tx_any_err_frms;
1202 u64 rx_ttl_eth_octets;
1204 u64 rx_offld_octets;
1205 u64 rx_vld_mcst_frms;
1206 u64 rx_vld_bcst_frms;
1207 u64 rx_accepted_ucst_frms;
1208 u64 rx_accepted_nucst_frms;
1216 u64 rx_ttl_65_127_frms;
1217 u64 rx_ttl_128_255_frms;
1218 u64 rx_ttl_256_511_frms;
1219 u64 rx_ttl_512_1023_frms;
1220 u64 rx_ttl_1024_1518_frms;
1221 u64 rx_ttl_1519_4095_frms;
1222 u64 rx_ttl_40956_8191_frms;
1223 u64 rx_ttl_8192_max_frms;
1224 u64 rx_ttl_gt_max_frms;
1233 u64 rx_pause_ctrl_frms;
1234 u64 rx_unsup_ctrl_frms;
1235 u64 rx_in_rng_len_err_frms;
1236 u64 rx_out_rng_len_err_frms;
1238 u64 rx_discarded_frms;
1242 u64 rx_marker_pdu_frms;
1243 u64 rx_marker_resp_pdu_frms;
1244 u64 rx_unknown_pdu_frms;
1245 u64 rx_illegal_pdu_frms;
1249 u64 rx_trash_discard;
1253 u64 rx_ingm_full_discard;
1254 u64 rx_xgmii_data_err_cnt;
1255 u64 rx_xgmii_ctrl_err_cnt;
1256 u64 rx_xgmii_err_sym;
1257 u64 rx_xgmii_char1_match;
1258 u64 rx_xgmii_char2_match;
1259 u64 rx_xgmii_column1_match;
1260 u64 rx_xgmii_column2_match;
1262 u64 rx_remote_fault;
1264 }xge_hal_stats_link_info_t;
1267 * struct xge_hal_stats_aggr_info_t - XGMAC statistics for an aggregator
1269 * @tx_frms: Count of data frames transmitted for the aggregator.
1270 * @tx_mcst_frms: Count of multicast data frames transmitted for
1272 * @tx_bcst_frms: Count of broadcast data frames transmitted for
1274 * @tx_discarded_frms: Count of discarded data frames transmitted for
1276 * @tx_errored_frms: Count of errored data frames transmitted for
1278 * @rx_frms: Count of received frames for aggregators
1279 * @rx_data_octets: Count of data and padding octets of frames received
1281 * @rx_mcst_frms: Count of multicast frames received the aggregator.
1282 * @rx_bcst_frms: Count of broadast frames received the aggregator.
1283 * @rx_discarded_frms: Count of discarded frames received the aggregator.
1284 * @rx_errored_frms: Count of errored frames received the aggregator.
1285 * @rx_unknown_protocol_frms: Count of unknown protocol frames received
1288 typedef struct xge_hal_stats_aggr_info_t {
1292 u64 tx_discarded_frms;
1293 u64 tx_errored_frms;
1298 u64 rx_discarded_frms;
1299 u64 rx_errored_frms;
1300 u64 rx_unknown_protocol_frms;
1301 }xge_hal_stats_aggr_info_t;
1304 * struct xge_hal_stats_vpath_info_t - XGMAC statistics for a vpath.
1306 * @tx_frms: Count of transmitted MAC frames for the vpath.
1307 * @tx_ttl_eth_octets: Count of total octets of transmitted frames
1309 * @tx_data_octets: Count of data and padding octets of transmitted
1310 * frames for the vpath.
1311 * @tx_mcst_frms: Count of multicast MAC frames for the vpath.
1312 * @tx_bcst_frms: Count of broadcast MAC frames for the vpath.
1313 * @tx_ucst_frms: Count of unicast MAC frames for the vpath.
1314 * @tx_tagged_frms: Count of transmitted frames containing a VLAN
1315 * tag for the vpath.
1316 * @tx_vld_ip: Count of transmitted IP datagrams for the vpath.
1317 * @tx_vld_ip_octets: Count of transmitted IP octets for the vpath.
1318 * @tx_icmp: Count of transmitted ICMP messages for the vpath.
1319 * @tx_tcp: Count of transmitted TCP segments for the vpath.
1320 * @tx_rst_tcp: Count of transmitted TCP segments containing the RST
1322 * @tx_udp: Count of transmitted UDP datagrams for the vpath.
1323 * @tx_unknown_protocol: Count of transmitted packets of unknown
1324 * protocol for the vpath.
1325 * @tx_parse_error: Count of transmitted packets with parsing errors
1327 * @rx_ttl_frms: Count of all received MAC frames for the vpath.
1328 * @rx_vld_frms: Count of all successfully received MAC frames for
1330 * @rx_offld_frms: Count of all offloaded received MAC frames for
1332 * @rx_ttl_eth_octets: Count of total octets of received frames, not
1333 * including framing characters for the vpath.
1334 * @rx_data_octets: Count of data and padding octets of successfully
1335 * received frames for the vpath.
1336 * @rx_offld_octets: Count of total octets, not including framing
1337 * characters, of offloaded received frames for the vpath.
1338 * @rx_vld_mcst_frms: Count of successfully received multicast MAC
1339 * frames for the vpath.
1340 * @rx_vld_bcst_frms: Count of successfully received broadcast MAC
1341 * frames for the vpath.
1342 * @rx_accepted_ucst_frms: Count of successfully received unicast
1343 * MAC frames for the vpath.
1344 * @rx_accepted_nucst_frms: Count of successfully received
1345 * non-unicast MAC frames for the vpath.
1346 * @rx_tagged_frms: Count of received frames containing a VLAN tag
1348 * @rx_long_frms: Count of received frames that are longer than
1349 * RX_MAX_PYLD_LEN + 18 bytes (+ 22 bytes if VLAN-tagged) for the vpath.
1350 * @rx_usized_frms: Count of received frames of length less than 64
1351 * octets, for the vpath.
1352 * @rx_usized_frms: Count of received frames of length more than
1353 * 1518 octets, for the vpath.
1354 * @rx_osized_frms: Count of received frames of length more than
1355 * 1518 octets for the vpath.
1356 * @rx_frag_frms: Count of received frames of length less than 64
1357 * octets that had bad FCS, for the vpath.
1358 * @rx_jabber_frms: Count of received frames of length more than
1359 * 1518 octets that had bad FCS, for the vpath.
1360 * @rx_ttl_64_frms: Count of all received MAC frames with length of
1361 * exactly 64 octets, for the vpath.
1362 * @rx_ttl_65_127_frms: Count of all received MAC frames with length
1363 * of between 65 and 127 octets inclusive, for the vpath.
1364 * @rx_ttl_128_255_frms: Count of all received MAC frames with
1365 * length of between 128 and 255 octets inclusive, for the vpath.
1366 * @rx_ttl_256_511_frms: Count of all received MAC frames with
1367 * length of between 246 and 511 octets inclusive, for the vpath.
1368 * @rx_ttl_512_1023_frms: Count of all received MAC frames with
1369 * length of between 512 and 1023 octets inclusive, for the vpath.
1370 * @rx_ttl_1024_1518_frms: Count of all received MAC frames with
1371 * length of between 1024 and 1518 octets inclusive, for the vpath.
1372 * @rx_ttl_1519_4095_frms: Count of all received MAC frames with
1373 * length of between 1519 and 4095 octets inclusive, for the vpath.
1374 * @rx_ttl_40956_8191_frms: Count of all received MAC frames with
1375 * of between 4096 and 8191 octets inclusive, for the vpath.
1376 * @rx_ttl_8192_max_frms: Count of all received MAC frames with
1377 * length of between 8192 and RX_MAX_PYLD_LEN+18 octets inclusive, for the
1379 * @rx_ttl_gt_max_frms: Count of all received MAC frames with length
1380 * exceeding RX_MAX_PYLD_LEN+18 octets inclusive, for the vpath.
1381 * @rx_ip: Count of received IP datagrams, for the vpath.
1382 * @rx_accepted_ip: Count of received and accepted IP datagrams,
1384 * @rx_ip_octets: Count of number of octets in received IP datagrams
1386 * @rx_hdr_err_ip: Count of received IP datagrams that are discarded
1387 * due to IP header errors, for the vpath.
1388 * @rx_icmp: Count of received ICMP messages for the vpath.
1389 * @rx_tcp: Count of received TCP segments for the vpath.
1390 * @rx_udp: Count of received UDP datagrams for the vpath.
1391 * @rx_err_tcp: Count of received TCP segments containing errors for
1393 * @rx_mpa_ok_frms: Count of received frames that pass the MPA
1395 * @rx_mpa_crc_fail_frms: Count of received frames that fail the MPA
1396 * CRC check for the vpath.
1397 * @rx_mpa_mrk_fail_frms: Count of received frames that fail the
1398 * MPA marker check for the vpath.
1399 * @rx_mpa_len_fail_frms: Count of received frames that fail the MPA
1400 * length check for the vpath.
1401 * @rx_wol_frms: Count of received "magic packet" frames for
1404 typedef struct xge_hal_stats_vpath_info_t {
1406 u64 tx_ttl_eth_octets;
1413 u64 tx_vld_ip_octets;
1418 u64 tx_unknown_protocol;
1423 u64 rx_ttl_eth_octets;
1425 u64 rx_offld_octets;
1426 u64 rx_vld_mcst_frms;
1427 u64 rx_vld_bcst_frms;
1428 u64 rx_accepted_ucst_frms;
1429 u64 rx_accepted_nucst_frms;
1437 u64 rx_ttl_65_127_frms;
1438 u64 rx_ttl_128_255_frms;
1439 u64 rx_ttl_256_511_frms;
1440 u64 rx_ttl_512_1023_frms;
1441 u64 rx_ttl_1024_1518_frms;
1442 u64 rx_ttl_1519_4095_frms;
1443 u64 rx_ttl_40956_8191_frms;
1444 u64 rx_ttl_8192_max_frms;
1445 u64 rx_ttl_gt_max_frms;
1455 u64 rx_mpa_crc_fail_frms;
1456 u64 rx_mpa_mrk_fail_frms;
1457 u64 rx_mpa_len_fail_frms;
1459 }xge_hal_stats_vpath_info_t;
1462 * struct xge_hal_stats_pcim_info_t - Contains PCIM statistics
1464 * @link_info: PCIM links info for link 0, 1, and 2.
1465 * @aggr_info: PCIM aggregators info for aggregator 0 and 1.
1466 * See also: xge_hal_stats_link_info_t{}, xge_hal_stats_aggr_info_t{}.
1468 typedef struct xge_hal_stats_pcim_info_t {
1469 xge_hal_stats_link_info_t link_info[XGE_HAL_MAC_LINKS];
1470 xge_hal_stats_aggr_info_t aggr_info[XGE_HAL_MAC_AGGREGATORS];
1471 }xge_hal_stats_pcim_info_t;
1474 * struct xge_hal_stats_t - Contains HAL per-device statistics,
1476 * @devh: HAL device handle.
1477 * @dma_addr: DMA addres of the %hw_info. Given to device to fill-in the stats.
1478 * @hw_info_dmah: DMA handle used to map hw statistics onto the device memory
1480 * @hw_info_dma_acch: One more DMA handle used subsequently to free the
1481 * DMA object. Note that this and the previous handle have
1482 * physical meaning for Solaris; on Windows and Linux the
1483 * corresponding value will be simply pointer to PCI device.
1485 * @hw_info: Xframe statistics maintained by the hardware.
1486 * @hw_info_saved: TBD
1487 * @hw_info_latest: TBD
1488 * @pcim_info: Xframe PCIM statistics maintained by the hardware.
1489 * @pcim_info_saved: TBD
1490 * @pcim_info_latest: TBD
1491 * @sw_dev_info_stats: HAL's "soft" device informational statistics, e.g. number
1492 * of completions per interrupt.
1493 * @sw_dev_err_stats: HAL's "soft" device error statistics.
1495 * @is_initialized: True, if all the subordinate structures are allocated and
1497 * @is_enabled: True, if device stats collection is enabled.
1499 * Structure-container of HAL per-device statistics. Note that per-channel
1500 * statistics are kept in separate structures under HAL's fifo and ring
1502 * See also: xge_hal_stats_hw_info_t{}, xge_hal_stats_sw_err_t{},
1503 * xge_hal_stats_device_info_t{}.
1504 * See also: xge_hal_stats_channel_info_t{}.
1506 typedef struct xge_hal_stats_t {
1508 xge_hal_device_h devh;
1509 dma_addr_t dma_addr;
1510 pci_dma_h hw_info_dmah;
1511 pci_dma_acc_h hw_info_dma_acch;
1513 /* HAL device hardware statistics */
1514 xge_hal_stats_hw_info_t *hw_info;
1515 xge_hal_stats_hw_info_t hw_info_saved;
1516 xge_hal_stats_hw_info_t hw_info_latest;
1518 /* HAL device hardware statistics for XFRAME ER */
1519 xge_hal_stats_pcim_info_t *pcim_info;
1520 xge_hal_stats_pcim_info_t *pcim_info_saved;
1521 xge_hal_stats_pcim_info_t *pcim_info_latest;
1523 /* HAL device "soft" stats */
1524 xge_hal_stats_sw_err_t sw_dev_err_stats;
1525 xge_hal_stats_device_info_t sw_dev_info_stats;
1532 /* ========================== STATS PRIVATE API ========================= */
1534 xge_hal_status_e __hal_stats_initialize(xge_hal_stats_t *stats,
1535 xge_hal_device_h devh);
1537 void __hal_stats_terminate(xge_hal_stats_t *stats);
1539 void __hal_stats_enable(xge_hal_stats_t *stats);
1541 void __hal_stats_disable(xge_hal_stats_t *stats);
1543 void __hal_stats_soft_reset(xge_hal_device_h devh, int reset_all);
1545 /* ========================== STATS PUBLIC API ========================= */
1547 xge_hal_status_e xge_hal_stats_hw(xge_hal_device_h devh,
1548 xge_hal_stats_hw_info_t **hw_info);
1550 xge_hal_status_e xge_hal_stats_pcim(xge_hal_device_h devh,
1551 xge_hal_stats_pcim_info_t **pcim_info);
1553 xge_hal_status_e xge_hal_stats_device(xge_hal_device_h devh,
1554 xge_hal_stats_device_info_t **device_info);
1556 xge_hal_status_e xge_hal_stats_channel(xge_hal_channel_h channelh,
1557 xge_hal_stats_channel_info_t **channel_info);
1559 xge_hal_status_e xge_hal_stats_reset(xge_hal_device_h devh);
1564 #endif /* XGE_HAL_STATS_H */