diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-02-12 15:38:19 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-02-12 19:08:27 -0500 |
commit | 212079df6d77c0daada96b1d906f4b7749871411 (patch) | |
tree | 2c4f2b31b6bdc2a6ea1a22617fd840c19ff90882 /drivers/net/ethernet/freescale/gianfar.h | |
parent | 68719786cba169f93b6cb5a53f5dd6ea1bdbb9f3 (diff) |
gianfar: convert u64 status counters to atomic64_t
While looking at some asm dump for an unrelated change, Eric
noticed in the following stats count increment code:
50b8: 81 3c 01 f8 lwz r9,504(r28)
50bc: 81 5c 01 fc lwz r10,508(r28)
50c0: 31 4a 00 01 addic r10,r10,1
50c4: 7d 29 01 94 addze r9,r9
50c8: 91 3c 01 f8 stw r9,504(r28)
50cc: 91 5c 01 fc stw r10,508(r28)
that a 64 bit counter was used on ppc-32 without sync
and hence the "ethtool -S" output was racy.
Here we convert all the values to use atomic64_t so that
the output will always be consistent.
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 61b1785c9ca7..78125f1f870e 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h | |||
@@ -627,24 +627,25 @@ struct rmon_mib | |||
627 | }; | 627 | }; |
628 | 628 | ||
629 | struct gfar_extra_stats { | 629 | struct gfar_extra_stats { |
630 | u64 kernel_dropped; | 630 | atomic64_t kernel_dropped; |
631 | u64 rx_large; | 631 | atomic64_t rx_large; |
632 | u64 rx_short; | 632 | atomic64_t rx_short; |
633 | u64 rx_nonoctet; | 633 | atomic64_t rx_nonoctet; |
634 | u64 rx_crcerr; | 634 | atomic64_t rx_crcerr; |
635 | u64 rx_overrun; | 635 | atomic64_t rx_overrun; |
636 | u64 rx_bsy; | 636 | atomic64_t rx_bsy; |
637 | u64 rx_babr; | 637 | atomic64_t rx_babr; |
638 | u64 rx_trunc; | 638 | atomic64_t rx_trunc; |
639 | u64 eberr; | 639 | atomic64_t eberr; |
640 | u64 tx_babt; | 640 | atomic64_t tx_babt; |
641 | u64 tx_underrun; | 641 | atomic64_t tx_underrun; |
642 | u64 rx_skbmissing; | 642 | atomic64_t rx_skbmissing; |
643 | u64 tx_timeout; | 643 | atomic64_t tx_timeout; |
644 | }; | 644 | }; |
645 | 645 | ||
646 | #define GFAR_RMON_LEN ((sizeof(struct rmon_mib) - 16)/sizeof(u32)) | 646 | #define GFAR_RMON_LEN ((sizeof(struct rmon_mib) - 16)/sizeof(u32)) |
647 | #define GFAR_EXTRA_STATS_LEN (sizeof(struct gfar_extra_stats)/sizeof(u64)) | 647 | #define GFAR_EXTRA_STATS_LEN \ |
648 | (sizeof(struct gfar_extra_stats)/sizeof(atomic64_t)) | ||
648 | 649 | ||
649 | /* Number of stats exported via ethtool */ | 650 | /* Number of stats exported via ethtool */ |
650 | #define GFAR_STATS_LEN (GFAR_RMON_LEN + GFAR_EXTRA_STATS_LEN) | 651 | #define GFAR_STATS_LEN (GFAR_RMON_LEN + GFAR_EXTRA_STATS_LEN) |