2 * Copyright (c) 2014 Mellanox Technologies Ltd. All rights reserved.
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36 #define NUM_PRIORITIES 9
37 #define NUM_PRIORITY_STATS 2
39 struct mlx4_en_pkt_stats {
42 u64 rx_multicast_packets;
43 u64 rx_broadcast_packets;
50 u64 rx_in_range_length_error;
51 u64 rx_out_range_length_error;
52 u64 rx_lt_64_bytes_packets;
53 u64 rx_127_bytes_packets;
54 u64 rx_255_bytes_packets;
55 u64 rx_511_bytes_packets;
56 u64 rx_1023_bytes_packets;
57 u64 rx_1518_bytes_packets;
58 u64 rx_1522_bytes_packets;
59 u64 rx_1548_bytes_packets;
60 u64 rx_gt_1548_bytes_packets;
63 u64 tx_multicast_packets;
64 u64 tx_broadcast_packets;
67 u64 tx_lt_64_bytes_packets;
68 u64 tx_127_bytes_packets;
69 u64 tx_255_bytes_packets;
70 u64 tx_511_bytes_packets;
71 u64 tx_1023_bytes_packets;
72 u64 tx_1518_bytes_packets;
73 u64 tx_1522_bytes_packets;
74 u64 tx_1548_bytes_packets;
75 u64 tx_gt_1548_bytes_packets;
76 u64 rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
77 u64 tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS];
80 struct mlx4_en_vf_stats {
87 struct mlx4_en_vport_stats {
94 struct mlx4_en_port_stats {
99 u64 oversized_packets;
103 u64 tx_chksum_offload;
107 struct mlx4_en_perf_stats {
116 #define MLX4_NUM_PRIORITIES 8
118 struct mlx4_en_flow_stats_rx {
120 u64 rx_pause_duration;
121 u64 rx_pause_transition;
124 struct mlx4_en_flow_stats_tx {
126 u64 tx_pause_duration;
127 u64 tx_pause_transition;
130 struct mlx4_en_stat_out_flow_control_mbox {
131 /* Total number of PAUSE frames received from the far-end port */
133 /* Total number of microseconds that far-end port requested to pause
134 * transmission of packets
136 __be64 rx_pause_duration;
137 /* Number of received transmission from XOFF state to XON state */
138 __be64 rx_pause_transition;
139 /* Total number of PAUSE frames sent from the far-end port */
141 /* Total time in microseconds that transmission of packets has been
144 __be64 tx_pause_duration;
145 /* Number of transmitter transitions from XOFF state to XON state */
146 __be64 tx_pause_transition;
152 MLX4_DUMP_ETH_STATS_FLOW_CONTROL = 1 << 12
155 int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, int port,
156 struct mlx4_en_vport_stats *vport_stats,
157 int reset, int *read_counters);