aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-10-10 05:35:10 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-12 02:16:18 -0400
commit6abd23468deaf3f6215a80b564f85df934209721 (patch)
treef93e569657d0085894d230920bbec07bb2cd0d01 /drivers/net/qlge
parent80928860941023bb37e9c61927395d0eb753bc3b (diff)
qlge: Add CBFC pause frame counters to ethtool stats.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r--drivers/net/qlge/qlge.h21
-rw-r--r--drivers/net/qlge/qlge_ethtool.c69
2 files changed, 90 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index cef930bfcc79..421471790601 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -1363,6 +1363,27 @@ struct nic_stats {
1363 u64 rx_1024_to_1518_pkts; 1363 u64 rx_1024_to_1518_pkts;
1364 u64 rx_1519_to_max_pkts; 1364 u64 rx_1519_to_max_pkts;
1365 u64 rx_len_err_pkts; 1365 u64 rx_len_err_pkts;
1366 /*
1367 * These stats come from offset 500h to 5C8h
1368 * in the XGMAC register.
1369 */
1370 u64 tx_cbfc_pause_frames0;
1371 u64 tx_cbfc_pause_frames1;
1372 u64 tx_cbfc_pause_frames2;
1373 u64 tx_cbfc_pause_frames3;
1374 u64 tx_cbfc_pause_frames4;
1375 u64 tx_cbfc_pause_frames5;
1376 u64 tx_cbfc_pause_frames6;
1377 u64 tx_cbfc_pause_frames7;
1378 u64 rx_cbfc_pause_frames0;
1379 u64 rx_cbfc_pause_frames1;
1380 u64 rx_cbfc_pause_frames2;
1381 u64 rx_cbfc_pause_frames3;
1382 u64 rx_cbfc_pause_frames4;
1383 u64 rx_cbfc_pause_frames5;
1384 u64 rx_cbfc_pause_frames6;
1385 u64 rx_cbfc_pause_frames7;
1386 u64 rx_nic_fifo_drop;
1366}; 1387};
1367 1388
1368/* 1389/*
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c
index 52073946bce3..aac6c6f19a21 100644
--- a/drivers/net/qlge/qlge_ethtool.c
+++ b/drivers/net/qlge/qlge_ethtool.c
@@ -132,6 +132,41 @@ static void ql_update_stats(struct ql_adapter *qdev)
132 iter++; 132 iter++;
133 } 133 }
134 134
135 /*
136 * Get Per-priority TX pause frame counter statistics.
137 */
138 for (i = 0x500; i < 0x540; i += 8) {
139 if (ql_read_xgmac_reg64(qdev, i, &data)) {
140 QPRINTK(qdev, DRV, ERR,
141 "Error reading status register 0x%.04x.\n", i);
142 goto end;
143 } else
144 *iter = data;
145 iter++;
146 }
147
148 /*
149 * Get Per-priority RX pause frame counter statistics.
150 */
151 for (i = 0x568; i < 0x5a8; i += 8) {
152 if (ql_read_xgmac_reg64(qdev, i, &data)) {
153 QPRINTK(qdev, DRV, ERR,
154 "Error reading status register 0x%.04x.\n", i);
155 goto end;
156 } else
157 *iter = data;
158 iter++;
159 }
160
161 /*
162 * Get RX NIC FIFO DROP statistics.
163 */
164 if (ql_read_xgmac_reg64(qdev, 0x5b8, &data)) {
165 QPRINTK(qdev, DRV, ERR,
166 "Error reading status register 0x%.04x.\n", i);
167 goto end;
168 } else
169 *iter = data;
135end: 170end:
136 ql_sem_unlock(qdev, qdev->xg_sem_mask); 171 ql_sem_unlock(qdev, qdev->xg_sem_mask);
137quit: 172quit:
@@ -185,6 +220,23 @@ static char ql_stats_str_arr[][ETH_GSTRING_LEN] = {
185 {"rx_1024_to_1518_pkts"}, 220 {"rx_1024_to_1518_pkts"},
186 {"rx_1519_to_max_pkts"}, 221 {"rx_1519_to_max_pkts"},
187 {"rx_len_err_pkts"}, 222 {"rx_len_err_pkts"},
223 {"tx_cbfc_pause_frames0"},
224 {"tx_cbfc_pause_frames1"},
225 {"tx_cbfc_pause_frames2"},
226 {"tx_cbfc_pause_frames3"},
227 {"tx_cbfc_pause_frames4"},
228 {"tx_cbfc_pause_frames5"},
229 {"tx_cbfc_pause_frames6"},
230 {"tx_cbfc_pause_frames7"},
231 {"rx_cbfc_pause_frames0"},
232 {"rx_cbfc_pause_frames1"},
233 {"rx_cbfc_pause_frames2"},
234 {"rx_cbfc_pause_frames3"},
235 {"rx_cbfc_pause_frames4"},
236 {"rx_cbfc_pause_frames5"},
237 {"rx_cbfc_pause_frames6"},
238 {"rx_cbfc_pause_frames7"},
239 {"rx_nic_fifo_drop"},
188}; 240};
189 241
190static void ql_get_strings(struct net_device *dev, u32 stringset, u8 *buf) 242static void ql_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
@@ -257,6 +309,23 @@ ql_get_ethtool_stats(struct net_device *ndev,
257 *data++ = s->rx_1024_to_1518_pkts; 309 *data++ = s->rx_1024_to_1518_pkts;
258 *data++ = s->rx_1519_to_max_pkts; 310 *data++ = s->rx_1519_to_max_pkts;
259 *data++ = s->rx_len_err_pkts; 311 *data++ = s->rx_len_err_pkts;
312 *data++ = s->tx_cbfc_pause_frames0;
313 *data++ = s->tx_cbfc_pause_frames1;
314 *data++ = s->tx_cbfc_pause_frames2;
315 *data++ = s->tx_cbfc_pause_frames3;
316 *data++ = s->tx_cbfc_pause_frames4;
317 *data++ = s->tx_cbfc_pause_frames5;
318 *data++ = s->tx_cbfc_pause_frames6;
319 *data++ = s->tx_cbfc_pause_frames7;
320 *data++ = s->rx_cbfc_pause_frames0;
321 *data++ = s->rx_cbfc_pause_frames1;
322 *data++ = s->rx_cbfc_pause_frames2;
323 *data++ = s->rx_cbfc_pause_frames3;
324 *data++ = s->rx_cbfc_pause_frames4;
325 *data++ = s->rx_cbfc_pause_frames5;
326 *data++ = s->rx_cbfc_pause_frames6;
327 *data++ = s->rx_cbfc_pause_frames7;
328 *data++ = s->rx_nic_fifo_drop;
260} 329}
261 330
262static int ql_get_settings(struct net_device *ndev, 331static int ql_get_settings(struct net_device *ndev,