diff options
| author | Paulius Zaleckas <paulius.zaleckas@gmail.com> | 2012-01-22 20:16:35 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-01-23 14:00:58 -0500 |
| commit | 302476c99863fe6d08eed6145e37322892ab7f55 (patch) | |
| tree | e9f7beae3c13644fdb233c7d34b2bc9bf88e4366 | |
| parent | 44151acb9f13563e40d40d14c3e5c11ce21b59e1 (diff) | |
mv643xx_eth: Add Rx Discard and Rx Overrun statistics
These statistics helped me a lot while searching who is losing
packets in my setup.
I added these stats to MIB group since they are very similar,
but just in other registers.
I have tested this patch on 88F6281 SoC.
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/ethernet/marvell/mv643xx_eth.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 9c049d2cb97d..9edecfa1f0f4 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
| @@ -136,6 +136,8 @@ static char mv643xx_eth_driver_version[] = "1.4"; | |||
| 136 | #define INT_MASK 0x0068 | 136 | #define INT_MASK 0x0068 |
| 137 | #define INT_MASK_EXT 0x006c | 137 | #define INT_MASK_EXT 0x006c |
| 138 | #define TX_FIFO_URGENT_THRESHOLD 0x0074 | 138 | #define TX_FIFO_URGENT_THRESHOLD 0x0074 |
| 139 | #define RX_DISCARD_FRAME_CNT 0x0084 | ||
| 140 | #define RX_OVERRUN_FRAME_CNT 0x0088 | ||
| 139 | #define TXQ_FIX_PRIO_CONF_MOVED 0x00dc | 141 | #define TXQ_FIX_PRIO_CONF_MOVED 0x00dc |
| 140 | #define TX_BW_RATE_MOVED 0x00e0 | 142 | #define TX_BW_RATE_MOVED 0x00e0 |
| 141 | #define TX_BW_MTU_MOVED 0x00e8 | 143 | #define TX_BW_MTU_MOVED 0x00e8 |
| @@ -334,6 +336,9 @@ struct mib_counters { | |||
| 334 | u32 bad_crc_event; | 336 | u32 bad_crc_event; |
| 335 | u32 collision; | 337 | u32 collision; |
| 336 | u32 late_collision; | 338 | u32 late_collision; |
| 339 | /* Non MIB hardware counters */ | ||
| 340 | u32 rx_discard; | ||
| 341 | u32 rx_overrun; | ||
| 337 | }; | 342 | }; |
| 338 | 343 | ||
| 339 | struct lro_counters { | 344 | struct lro_counters { |
| @@ -1225,6 +1230,10 @@ static void mib_counters_clear(struct mv643xx_eth_private *mp) | |||
| 1225 | 1230 | ||
| 1226 | for (i = 0; i < 0x80; i += 4) | 1231 | for (i = 0; i < 0x80; i += 4) |
| 1227 | mib_read(mp, i); | 1232 | mib_read(mp, i); |
| 1233 | |||
| 1234 | /* Clear non MIB hw counters also */ | ||
| 1235 | rdlp(mp, RX_DISCARD_FRAME_CNT); | ||
| 1236 | rdlp(mp, RX_OVERRUN_FRAME_CNT); | ||
| 1228 | } | 1237 | } |
| 1229 | 1238 | ||
| 1230 | static void mib_counters_update(struct mv643xx_eth_private *mp) | 1239 | static void mib_counters_update(struct mv643xx_eth_private *mp) |
| @@ -1262,6 +1271,9 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
| 1262 | p->bad_crc_event += mib_read(mp, 0x74); | 1271 | p->bad_crc_event += mib_read(mp, 0x74); |
| 1263 | p->collision += mib_read(mp, 0x78); | 1272 | p->collision += mib_read(mp, 0x78); |
| 1264 | p->late_collision += mib_read(mp, 0x7c); | 1273 | p->late_collision += mib_read(mp, 0x7c); |
| 1274 | /* Non MIB hardware counters */ | ||
| 1275 | p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT); | ||
| 1276 | p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT); | ||
| 1265 | spin_unlock_bh(&mp->mib_counters_lock); | 1277 | spin_unlock_bh(&mp->mib_counters_lock); |
| 1266 | 1278 | ||
| 1267 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); | 1279 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); |
| @@ -1413,6 +1425,8 @@ static const struct mv643xx_eth_stats mv643xx_eth_stats[] = { | |||
| 1413 | MIBSTAT(bad_crc_event), | 1425 | MIBSTAT(bad_crc_event), |
| 1414 | MIBSTAT(collision), | 1426 | MIBSTAT(collision), |
| 1415 | MIBSTAT(late_collision), | 1427 | MIBSTAT(late_collision), |
| 1428 | MIBSTAT(rx_discard), | ||
| 1429 | MIBSTAT(rx_overrun), | ||
| 1416 | LROSTAT(lro_aggregated), | 1430 | LROSTAT(lro_aggregated), |
| 1417 | LROSTAT(lro_flushed), | 1431 | LROSTAT(lro_flushed), |
| 1418 | LROSTAT(lro_no_desc), | 1432 | LROSTAT(lro_no_desc), |
