aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/veth.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-29 03:57:15 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-29 03:57:15 -0500
commit9b963e5d0e01461099a40117b05480f24b63381f (patch)
tree4756d554e37bf4ab7202f2c564cbe629af98b576 /drivers/net/veth.c
parent3b8626ba01a8a745a3fdf22dd347edd708b0af13 (diff)
parent5fdd4baef6195a1f2960e901c8877e2105f832ca (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/ieee802154/fakehard.c drivers/net/e1000e/ich8lan.c drivers/net/e1000e/phy.c drivers/net/netxen/netxen_nic_init.c drivers/net/wireless/ath/ath9k/main.c
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r--drivers/net/veth.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 6c4b5a2d787..63099c58a6d 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -199,32 +199,29 @@ rx_drop:
199static struct net_device_stats *veth_get_stats(struct net_device *dev) 199static struct net_device_stats *veth_get_stats(struct net_device *dev)
200{ 200{
201 struct veth_priv *priv; 201 struct veth_priv *priv;
202 struct net_device_stats *dev_stats;
203 int cpu; 202 int cpu;
204 struct veth_net_stats *stats; 203 struct veth_net_stats *stats, total = {0};
205 204
206 priv = netdev_priv(dev); 205 priv = netdev_priv(dev);
207 dev_stats = &dev->stats;
208
209 dev_stats->rx_packets = 0;
210 dev_stats->tx_packets = 0;
211 dev_stats->rx_bytes = 0;
212 dev_stats->tx_bytes = 0;
213 dev_stats->tx_dropped = 0;
214 dev_stats->rx_dropped = 0;
215 206
216 for_each_online_cpu(cpu) { 207 for_each_possible_cpu(cpu) {
217 stats = per_cpu_ptr(priv->stats, cpu); 208 stats = per_cpu_ptr(priv->stats, cpu);
218 209
219 dev_stats->rx_packets += stats->rx_packets; 210 total.rx_packets += stats->rx_packets;
220 dev_stats->tx_packets += stats->tx_packets; 211 total.tx_packets += stats->tx_packets;
221 dev_stats->rx_bytes += stats->rx_bytes; 212 total.rx_bytes += stats->rx_bytes;
222 dev_stats->tx_bytes += stats->tx_bytes; 213 total.tx_bytes += stats->tx_bytes;
223 dev_stats->tx_dropped += stats->tx_dropped; 214 total.tx_dropped += stats->tx_dropped;
224 dev_stats->rx_dropped += stats->rx_dropped; 215 total.rx_dropped += stats->rx_dropped;
225 } 216 }
226 217 dev->stats.rx_packets = total.rx_packets;
227 return dev_stats; 218 dev->stats.tx_packets = total.tx_packets;
219 dev->stats.rx_bytes = total.rx_bytes;
220 dev->stats.tx_bytes = total.tx_bytes;
221 dev->stats.tx_dropped = total.tx_dropped;
222 dev->stats.rx_dropped = total.rx_dropped;
223
224 return &dev->stats;
228} 225}
229 226
230static int veth_open(struct net_device *dev) 227static int veth_open(struct net_device *dev)