Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168930
b: refs/heads/master
c: 2b1c8b0
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 19, 2009
1 parent 982b0a9 commit 7f7e2a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56cf54831fd1be105e89a9df899e3b22442da180
refs/heads/master: 2b1c8b0f925c3f5943cf95d263d72927baae88e7
35 changes: 16 additions & 19 deletions trunk/drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,32 +210,29 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *veth_get_stats(struct net_device *dev)
{
struct veth_priv *priv;
struct net_device_stats *dev_stats;
int cpu;
struct veth_net_stats *stats;
struct veth_net_stats *stats, total = {0};

priv = netdev_priv(dev);
dev_stats = &dev->stats;

dev_stats->rx_packets = 0;
dev_stats->tx_packets = 0;
dev_stats->rx_bytes = 0;
dev_stats->tx_bytes = 0;
dev_stats->tx_dropped = 0;
dev_stats->rx_dropped = 0;

for_each_online_cpu(cpu) {
for_each_possible_cpu(cpu) {
stats = per_cpu_ptr(priv->stats, cpu);

dev_stats->rx_packets += stats->rx_packets;
dev_stats->tx_packets += stats->tx_packets;
dev_stats->rx_bytes += stats->rx_bytes;
dev_stats->tx_bytes += stats->tx_bytes;
dev_stats->tx_dropped += stats->tx_dropped;
dev_stats->rx_dropped += stats->rx_dropped;
total.rx_packets += stats->rx_packets;
total.tx_packets += stats->tx_packets;
total.rx_bytes += stats->rx_bytes;
total.tx_bytes += stats->tx_bytes;
total.tx_dropped += stats->tx_dropped;
total.rx_dropped += stats->rx_dropped;
}

return dev_stats;
dev->stats.rx_packets = total.rx_packets;
dev->stats.tx_packets = total.tx_packets;
dev->stats.rx_bytes = total.rx_bytes;
dev->stats.tx_bytes = total.tx_bytes;
dev->stats.tx_dropped = total.tx_dropped;
dev->stats.rx_dropped = total.rx_dropped;

return &dev->stats;
}

static int veth_open(struct net_device *dev)
Expand Down

0 comments on commit 7f7e2a1

Please sign in to comment.