diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-10-10 05:35:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-12 02:16:18 -0400 |
commit | 6abd23468deaf3f6215a80b564f85df934209721 (patch) | |
tree | f93e569657d0085894d230920bbec07bb2cd0d01 /drivers/net/qlge/qlge_ethtool.c | |
parent | 80928860941023bb37e9c61927395d0eb753bc3b (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/qlge_ethtool.c')
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 69 |
1 files changed, 69 insertions, 0 deletions
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; | ||
135 | end: | 170 | end: |
136 | ql_sem_unlock(qdev, qdev->xg_sem_mask); | 171 | ql_sem_unlock(qdev, qdev->xg_sem_mask); |
137 | quit: | 172 | quit: |
@@ -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 | ||
190 | static void ql_get_strings(struct net_device *dev, u32 stringset, u8 *buf) | 242 | static 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 | ||
262 | static int ql_get_settings(struct net_device *ndev, | 331 | static int ql_get_settings(struct net_device *ndev, |