aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2011-05-19 08:12:51 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-19 18:00:00 -0400
commit4452d0999906e3e26b718566362e943fcaa3d694 (patch)
tree124fa03691574ffb7e290bff82552915a04a5f7b /drivers/net
parent54e0a67f446fae290f99781691eba46c5cda66e7 (diff)
tg3: Fix stats for 5704 and later devices
Commit 4d95847381228639844c7197deb8b2211274ef22, entitled "tg3: Workaround rx_discards stat bug" modified the hardware statistics data structure. The modification shifted the statistics so that the labels no longer corresponded to the counter values. This patch fixes the problem by utilizing reserved space for the new counters. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tg3.c7
-rw-r--r--drivers/net/tg3.h10
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index d05c6a06da44..574fe9785f3c 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -364,7 +364,6 @@ static const struct {
364 { "dma_write_prioq_full" }, 364 { "dma_write_prioq_full" },
365 { "rxbds_empty" }, 365 { "rxbds_empty" },
366 { "rx_discards" }, 366 { "rx_discards" },
367 { "mbuf_lwm_thresh_hit" },
368 { "rx_errors" }, 367 { "rx_errors" },
369 { "rx_threshold_hit" }, 368 { "rx_threshold_hit" },
370 369
@@ -376,7 +375,9 @@ static const struct {
376 { "ring_status_update" }, 375 { "ring_status_update" },
377 { "nic_irqs" }, 376 { "nic_irqs" },
378 { "nic_avoided_irqs" }, 377 { "nic_avoided_irqs" },
379 { "nic_tx_threshold_hit" } 378 { "nic_tx_threshold_hit" },
379
380 { "mbuf_lwm_thresh_hit" },
380}; 381};
381 382
382#define TG3_NUM_STATS ARRAY_SIZE(ethtool_stats_keys) 383#define TG3_NUM_STATS ARRAY_SIZE(ethtool_stats_keys)
@@ -9546,6 +9547,8 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
9546 ESTAT_ADD(nic_avoided_irqs); 9547 ESTAT_ADD(nic_avoided_irqs);
9547 ESTAT_ADD(nic_tx_threshold_hit); 9548 ESTAT_ADD(nic_tx_threshold_hit);
9548 9549
9550 ESTAT_ADD(mbuf_lwm_thresh_hit);
9551
9549 return estats; 9552 return estats;
9550} 9553}
9551 9554
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 83f45bf0a08e..5b3d2f34da7a 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2620,7 +2620,6 @@ struct tg3_hw_stats {
2620 tg3_stat64_t dma_write_prioq_full; 2620 tg3_stat64_t dma_write_prioq_full;
2621 tg3_stat64_t rxbds_empty; 2621 tg3_stat64_t rxbds_empty;
2622 tg3_stat64_t rx_discards; 2622 tg3_stat64_t rx_discards;
2623 tg3_stat64_t mbuf_lwm_thresh_hit;
2624 tg3_stat64_t rx_errors; 2623 tg3_stat64_t rx_errors;
2625 tg3_stat64_t rx_threshold_hit; 2624 tg3_stat64_t rx_threshold_hit;
2626 2625
@@ -2639,7 +2638,12 @@ struct tg3_hw_stats {
2639 tg3_stat64_t nic_avoided_irqs; 2638 tg3_stat64_t nic_avoided_irqs;
2640 tg3_stat64_t nic_tx_threshold_hit; 2639 tg3_stat64_t nic_tx_threshold_hit;
2641 2640
2642 u8 __reserved4[0xb00-0x9c0]; 2641 /* NOT a part of the hardware statistics block format.
2642 * These stats are here as storage for tg3_periodic_fetch_stats().
2643 */
2644 tg3_stat64_t mbuf_lwm_thresh_hit;
2645
2646 u8 __reserved4[0xb00-0x9c8];
2643}; 2647};
2644 2648
2645/* 'mapping' is superfluous as the chip does not write into 2649/* 'mapping' is superfluous as the chip does not write into
@@ -2771,6 +2775,8 @@ struct tg3_ethtool_stats {
2771 u64 nic_irqs; 2775 u64 nic_irqs;
2772 u64 nic_avoided_irqs; 2776 u64 nic_avoided_irqs;
2773 u64 nic_tx_threshold_hit; 2777 u64 nic_tx_threshold_hit;
2778
2779 u64 mbuf_lwm_thresh_hit;
2774}; 2780};
2775 2781
2776struct tg3_rx_prodring_set { 2782struct tg3_rx_prodring_set {