diff options
author | stephen hemminger <shemminger@vyatta.com> | 2011-06-08 10:54:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-09 02:26:33 -0400 |
commit | c5f7ef72fcca7602ff8c75682b2a8568ba4e5064 (patch) | |
tree | 6b21414d86925a45507a3f77b11c858220ed8655 | |
parent | f20530bc982d67ebde84b3e0a043549d7ccd85a1 (diff) |
myricom: update to 64 bit stats
Driver was already keeping 64 bit counters, just not using the new interface.
Ps: IMHO drivers should not be duplicating network device
stats into ethtool stats. It is useless duplication.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 3f33870de211..04e10f4d679d 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -377,7 +377,8 @@ static inline void put_be32(__be32 val, __be32 __iomem * p) | |||
377 | __raw_writel((__force __u32) val, (__force void __iomem *)p); | 377 | __raw_writel((__force __u32) val, (__force void __iomem *)p); |
378 | } | 378 | } |
379 | 379 | ||
380 | static struct net_device_stats *myri10ge_get_stats(struct net_device *dev); | 380 | static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev, |
381 | struct rtnl_link_stats64 *stats); | ||
381 | 382 | ||
382 | static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated) | 383 | static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated) |
383 | { | 384 | { |
@@ -1831,13 +1832,14 @@ myri10ge_get_ethtool_stats(struct net_device *netdev, | |||
1831 | { | 1832 | { |
1832 | struct myri10ge_priv *mgp = netdev_priv(netdev); | 1833 | struct myri10ge_priv *mgp = netdev_priv(netdev); |
1833 | struct myri10ge_slice_state *ss; | 1834 | struct myri10ge_slice_state *ss; |
1835 | struct rtnl_link_stats64 link_stats; | ||
1834 | int slice; | 1836 | int slice; |
1835 | int i; | 1837 | int i; |
1836 | 1838 | ||
1837 | /* force stats update */ | 1839 | /* force stats update */ |
1838 | (void)myri10ge_get_stats(netdev); | 1840 | (void)myri10ge_get_stats(netdev, &link_stats); |
1839 | for (i = 0; i < MYRI10GE_NET_STATS_LEN; i++) | 1841 | for (i = 0; i < MYRI10GE_NET_STATS_LEN; i++) |
1840 | data[i] = ((unsigned long *)&netdev->stats)[i]; | 1842 | data[i] = ((u64 *)&link_stats)[i]; |
1841 | 1843 | ||
1842 | data[i++] = (unsigned int)mgp->tx_boundary; | 1844 | data[i++] = (unsigned int)mgp->tx_boundary; |
1843 | data[i++] = (unsigned int)mgp->wc_enabled; | 1845 | data[i++] = (unsigned int)mgp->wc_enabled; |
@@ -2976,11 +2978,11 @@ drop: | |||
2976 | return NETDEV_TX_OK; | 2978 | return NETDEV_TX_OK; |
2977 | } | 2979 | } |
2978 | 2980 | ||
2979 | static struct net_device_stats *myri10ge_get_stats(struct net_device *dev) | 2981 | static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev, |
2982 | struct rtnl_link_stats64 *stats) | ||
2980 | { | 2983 | { |
2981 | struct myri10ge_priv *mgp = netdev_priv(dev); | 2984 | struct myri10ge_priv *mgp = netdev_priv(dev); |
2982 | struct myri10ge_slice_netstats *slice_stats; | 2985 | struct myri10ge_slice_netstats *slice_stats; |
2983 | struct net_device_stats *stats = &dev->stats; | ||
2984 | int i; | 2986 | int i; |
2985 | 2987 | ||
2986 | spin_lock(&mgp->stats_lock); | 2988 | spin_lock(&mgp->stats_lock); |
@@ -3790,7 +3792,7 @@ static const struct net_device_ops myri10ge_netdev_ops = { | |||
3790 | .ndo_open = myri10ge_open, | 3792 | .ndo_open = myri10ge_open, |
3791 | .ndo_stop = myri10ge_close, | 3793 | .ndo_stop = myri10ge_close, |
3792 | .ndo_start_xmit = myri10ge_xmit, | 3794 | .ndo_start_xmit = myri10ge_xmit, |
3793 | .ndo_get_stats = myri10ge_get_stats, | 3795 | .ndo_get_stats64 = myri10ge_get_stats, |
3794 | .ndo_validate_addr = eth_validate_addr, | 3796 | .ndo_validate_addr = eth_validate_addr, |
3795 | .ndo_change_mtu = myri10ge_change_mtu, | 3797 | .ndo_change_mtu = myri10ge_change_mtu, |
3796 | .ndo_fix_features = myri10ge_fix_features, | 3798 | .ndo_fix_features = myri10ge_fix_features, |