diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-06-08 03:19:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-12 18:51:22 -0400 |
commit | be1f3c2c027cc5ad735df6a45a542ed1db7ec48b (patch) | |
tree | c97815a7cf25ea62e8f3a6b3597cfa8957f40b81 /net/8021q | |
parent | d19b51499967baddf4f9f12a0067146c2554527a (diff) |
net: Enable 64-bit net device statistics on 32-bit architectures
Use struct rtnl_link_stats64 as the statistics structure.
On 32-bit architectures, insert 32 bits of padding after/before each
field of struct net_device_stats to make its layout compatible with
struct rtnl_link_stats64. Add an anonymous union in net_device; move
stats into the union and add struct rtnl_link_stats64 stats64.
Add net_device_ops::ndo_get_stats64, implementations of which will
return a pointer to struct rtnl_link_stats64. Drivers that implement
this operation must not update the structure asynchronously.
Change dev_get_stats() to call ndo_get_stats64 if available, and to
return a pointer to struct rtnl_link_stats64. Change callers of
dev_get_stats() accordingly.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlanproc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index afead353e215..df56f5ce887c 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -278,8 +278,9 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset) | |||
278 | { | 278 | { |
279 | struct net_device *vlandev = (struct net_device *) seq->private; | 279 | struct net_device *vlandev = (struct net_device *) seq->private; |
280 | const struct vlan_dev_info *dev_info = vlan_dev_info(vlandev); | 280 | const struct vlan_dev_info *dev_info = vlan_dev_info(vlandev); |
281 | const struct net_device_stats *stats; | 281 | const struct rtnl_link_stats64 *stats; |
282 | static const char fmt[] = "%30s %12lu\n"; | 282 | static const char fmt[] = "%30s %12lu\n"; |
283 | static const char fmt64[] = "%30s %12llu\n"; | ||
283 | int i; | 284 | int i; |
284 | 285 | ||
285 | if (!is_vlan_dev(vlandev)) | 286 | if (!is_vlan_dev(vlandev)) |
@@ -291,12 +292,12 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset) | |||
291 | vlandev->name, dev_info->vlan_id, | 292 | vlandev->name, dev_info->vlan_id, |
292 | (int)(dev_info->flags & 1), vlandev->priv_flags); | 293 | (int)(dev_info->flags & 1), vlandev->priv_flags); |
293 | 294 | ||
294 | seq_printf(seq, fmt, "total frames received", stats->rx_packets); | 295 | seq_printf(seq, fmt64, "total frames received", stats->rx_packets); |
295 | seq_printf(seq, fmt, "total bytes received", stats->rx_bytes); | 296 | seq_printf(seq, fmt64, "total bytes received", stats->rx_bytes); |
296 | seq_printf(seq, fmt, "Broadcast/Multicast Rcvd", stats->multicast); | 297 | seq_printf(seq, fmt64, "Broadcast/Multicast Rcvd", stats->multicast); |
297 | seq_puts(seq, "\n"); | 298 | seq_puts(seq, "\n"); |
298 | seq_printf(seq, fmt, "total frames transmitted", stats->tx_packets); | 299 | seq_printf(seq, fmt64, "total frames transmitted", stats->tx_packets); |
299 | seq_printf(seq, fmt, "total bytes transmitted", stats->tx_bytes); | 300 | seq_printf(seq, fmt64, "total bytes transmitted", stats->tx_bytes); |
300 | seq_printf(seq, fmt, "total headroom inc", | 301 | seq_printf(seq, fmt, "total headroom inc", |
301 | dev_info->cnt_inc_headroom_on_tx); | 302 | dev_info->cnt_inc_headroom_on_tx); |
302 | seq_printf(seq, fmt, "total encap on xmit", | 303 | seq_printf(seq, fmt, "total encap on xmit", |