From: Stephen Hemminger <shemminger@vyatta.com>
To: "David S. Miller" <davem@davemloft.net>,
Andrew Gallatin <gallatin@myri.com>,
Brice Goglin <brice@myri.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 7/9] myricom: update to 64 bit stats
Date: Wed, 08 Jun 2011 17:54:03 -0700 [thread overview]
Message-ID: <20110609005417.688902862@vyatta.com> (raw)
In-Reply-To: 20110609005356.160260858@vyatta.com
[-- Attachment #1: myricom-stats.patch --]
[-- Type: text/plain, Size: 2184 bytes --]
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>
--- a/drivers/net/myri10ge/myri10ge.c 2011-06-07 16:58:31.333079418 -0700
+++ b/drivers/net/myri10ge/myri10ge.c 2011-06-07 17:29:13.298213223 -0700
@@ -377,7 +377,8 @@ static inline void put_be32(__be32 val,
__raw_writel((__force __u32) val, (__force void __iomem *)p);
}
-static struct net_device_stats *myri10ge_get_stats(struct net_device *dev);
+static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
+ struct rtnl_link_stats64 *stats);
static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated)
{
@@ -1831,13 +1832,14 @@ myri10ge_get_ethtool_stats(struct net_de
{
struct myri10ge_priv *mgp = netdev_priv(netdev);
struct myri10ge_slice_state *ss;
+ struct rtnl_link_stats64 link_stats;
int slice;
int i;
/* force stats update */
- (void)myri10ge_get_stats(netdev);
+ (void)myri10ge_get_stats(netdev, &link_stats);
for (i = 0; i < MYRI10GE_NET_STATS_LEN; i++)
- data[i] = ((unsigned long *)&netdev->stats)[i];
+ data[i] = ((u64 *)&link_stats)[i];
data[i++] = (unsigned int)mgp->tx_boundary;
data[i++] = (unsigned int)mgp->wc_enabled;
@@ -2976,11 +2978,11 @@ drop:
return NETDEV_TX_OK;
}
-static struct net_device_stats *myri10ge_get_stats(struct net_device *dev)
+static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev,
+ struct rtnl_link_stats64 *stats)
{
struct myri10ge_priv *mgp = netdev_priv(dev);
struct myri10ge_slice_netstats *slice_stats;
- struct net_device_stats *stats = &dev->stats;
int i;
spin_lock(&mgp->stats_lock);
@@ -3790,7 +3792,7 @@ static const struct net_device_ops myri1
.ndo_open = myri10ge_open,
.ndo_stop = myri10ge_close,
.ndo_start_xmit = myri10ge_xmit,
- .ndo_get_stats = myri10ge_get_stats,
+ .ndo_get_stats64 = myri10ge_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_change_mtu = myri10ge_change_mtu,
.ndo_fix_features = myri10ge_fix_features,
next prev parent reply other threads:[~2011-06-09 1:16 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 0:53 [PATCH 0/9] 64 bit statistics for VM and 10G drivers Stephen Hemminger
2011-06-09 0:53 ` [PATCH 1/9] vmxnet3: convert to 64 bit stats interface Stephen Hemminger
2011-06-09 5:17 ` [Pv-drivers] " Scott Goldman
2011-06-09 0:53 ` [PATCH 2/9] xen: " Stephen Hemminger
2011-06-09 1:56 ` Ben Hutchings
2011-06-14 21:07 ` Konrad Rzeszutek Wilk
2011-06-15 8:38 ` [Xen-devel] " Ian Campbell
2011-06-09 0:53 ` [PATCH 3/9] veth: convert to 64 bit statistics Stephen Hemminger
2011-06-09 2:00 ` Ben Hutchings
2011-06-09 3:22 ` Stephen Hemminger
2011-06-10 16:34 ` Ben Hutchings
2011-06-09 6:26 ` David Miller
2011-06-09 0:54 ` [PATCH 4/9] ifb: convert to 64 bit stats Stephen Hemminger
2011-06-09 3:29 ` Eric Dumazet
2011-06-09 3:32 ` Stephen Hemminger
2011-06-09 3:37 ` Eric Dumazet
2011-06-09 0:54 ` [PATCH 5/9] netxen: convert to 64 bit statistics Stephen Hemminger
2011-06-09 6:13 ` Amit Salecha
2011-06-09 6:27 ` David Miller
2011-06-09 0:54 ` [PATCH 6/9] enic: update to support 64 bit stats Stephen Hemminger
2011-06-09 6:27 ` David Miller
2011-06-09 17:43 ` roprabhu
2011-06-09 0:54 ` Stephen Hemminger [this message]
2011-06-09 6:27 ` [PATCH 7/9] myricom: update to " David Miller
2011-06-09 0:54 ` [PATCH 8/9] niu: support 64 bit stats interface Stephen Hemminger
2011-06-09 6:27 ` David Miller
2011-06-09 0:54 ` [PATCH 9/9] s2io: implement 64 bit stats Stephen Hemminger
2011-06-09 1:52 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110609005417.688902862@vyatta.com \
--to=shemminger@vyatta.com \
--cc=brice@myri.com \
--cc=davem@davemloft.net \
--cc=gallatin@myri.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.