xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/oce/oce_stat.h (revision 3abb112f8485b33b6b9b52b340bede0a333c10bf)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /* Copyright © 2003-2011 Emulex. All rights reserved.  */
23 
24 /*
25  * Statistic specific data structures and function prototypes
26  */
27 
28 #ifndef	_OCE_STAT_H_
29 #define	_OCE_STAT_H_
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <oce_hw_eth.h>
36 #include <oce_impl.h>
37 
38 struct oce_stat {
39 	kstat_named_t rx_bytes_hi;
40 	kstat_named_t rx_bytes_lo;
41 	kstat_named_t rx_frames;
42 	kstat_named_t rx_errors;
43 	kstat_named_t rx_drops;
44 
45 	kstat_named_t tx_bytes_hi;
46 	kstat_named_t tx_bytes_lo;
47 	kstat_named_t tx_frames;
48 	kstat_named_t tx_errors;
49 
50 	kstat_named_t rx_unicast_frames;
51 	kstat_named_t rx_multicast_frames;
52 	kstat_named_t rx_broadcast_frames;
53 	kstat_named_t rx_crc_errors;
54 
55 	kstat_named_t rx_alignment_symbol_errors;
56 	kstat_named_t rx_in_range_errors;
57 	kstat_named_t rx_out_range_errors;
58 	kstat_named_t rx_frame_too_long;
59 	kstat_named_t rx_address_match_errors;
60 
61 	kstat_named_t rx_pause_frames;
62 	kstat_named_t rx_control_frames;
63 	kstat_named_t rx_ip_checksum_errs;
64 	kstat_named_t rx_tcp_checksum_errs;
65 	kstat_named_t rx_udp_checksum_errs;
66 	kstat_named_t rx_fifo_overflow;
67 	kstat_named_t rx_input_fifo_overflow;
68 
69 	kstat_named_t tx_unicast_frames;
70 	kstat_named_t tx_multicast_frames;
71 	kstat_named_t tx_broadcast_frames;
72 	kstat_named_t tx_pause_frames;
73 	kstat_named_t tx_control_frames;
74 
75 
76 	kstat_named_t rx_drops_no_pbuf;
77 	kstat_named_t rx_drops_no_txpb;
78 	kstat_named_t rx_drops_no_erx_descr;
79 	kstat_named_t rx_drops_no_tpre_descr;
80 	kstat_named_t rx_drops_too_many_frags;
81 	kstat_named_t rx_drops_invalid_ring;
82 	kstat_named_t rx_drops_mtu;
83 
84 	kstat_named_t rx_dropped_too_small;
85 	kstat_named_t rx_dropped_too_short;
86 	kstat_named_t rx_dropped_header_too_small;
87 	kstat_named_t rx_dropped_tcp_length;
88 	kstat_named_t rx_dropped_runt;
89 
90 	kstat_named_t rx_drops_no_fragments;
91 };
92 
93 int oce_stat_init(struct oce_dev *dev);
94 void oce_stat_fini(struct oce_dev *dev);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* _OCE_STAT_H_ */
101