From 468f1b867466394892c1b97e23c02e09f6a6f6da Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sun, 24 Dec 2006 13:25:44 +0000 Subject: Use long long for byte/packet counters on X86. --- include/linux/netdevice.h | 7 +++++++ net/core/dev.c | 11 +++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6be767c..ec12dac 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -113,10 +113,17 @@ struct netpoll_info; struct net_device_stats { +#ifdef CONFIG_X86 + unsigned long long rx_packets; /* total packets received */ + unsigned long long tx_packets; /* total packets transmitted */ + unsigned long long rx_bytes; /* total bytes received */ + unsigned long long tx_bytes; /* total bytes transmitted */ +#else unsigned long rx_packets; /* total packets received */ unsigned long tx_packets; /* total packets transmitted */ unsigned long rx_bytes; /* total bytes received */ unsigned long tx_bytes; /* total bytes transmitted */ +#endif unsigned long rx_errors; /* bad packets received */ unsigned long tx_errors; /* packet transmit problems */ unsigned long rx_dropped; /* no space in linux buffers */ diff --git a/net/core/dev.c b/net/core/dev.c index e660cb5..5feb3c8 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2111,8 +2111,13 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev) if (dev->get_stats) { struct net_device_stats *stats = dev->get_stats(dev); +#ifdef CONFIG_X86 + seq_printf(seq, "%6s:%14llu %13llu %4lu %4lu %4lu %5lu %10lu %9lu " + "%14llu %13llu %4lu %4lu %4lu %5lu %7lu %10lu\n", +#else seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu " "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n", +#endif dev->name, stats->rx_bytes, stats->rx_packets, stats->rx_errors, stats->rx_dropped + stats->rx_missed_errors, @@ -2140,9 +2145,15 @@ static int dev_seq_show(struct seq_file *seq, void *v) { if (v == SEQ_START_TOKEN) seq_puts(seq, "Inter-| Receive " +#ifdef CONFIG_X86 + " | Transmit\n" + " face |bytes packets errs drop fifo frame " + "compressed multicast|bytes packets errs " +#else " | Transmit\n" " face |bytes packets errs drop fifo frame " "compressed multicast|bytes packets errs " +#endif "drop fifo colls carrier compressed\n"); else dev_seq_printf_stats(seq, v); -- 1.5.0.1