aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/loopback.c
diff options
context:
space:
mode:
authorChuck Ebbert <76306.1226@compuserve.com>2005-07-02 21:28:22 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-07-31 01:06:10 -0400
commit18c16c696e8b2323a306af455c686df15c717206 (patch)
treea273c9fe65d970a10490b838f95e2d52e2193ed3 /drivers/net/loopback.c
parentd2ae1d2ff9282ca061b6f5244eee4c28ee2b3ffa (diff)
[PATCH] loopback: optimize stats
This patch slightly optimizes the loopback driver's stats update. Saves two loads, one add and one increment per packet sent. Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r--drivers/net/loopback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index c1e3cee8ec33..dba76169e774 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -151,9 +151,9 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
151 151
152 lb_stats = &per_cpu(loopback_stats, get_cpu()); 152 lb_stats = &per_cpu(loopback_stats, get_cpu());
153 lb_stats->rx_bytes += skb->len; 153 lb_stats->rx_bytes += skb->len;
154 lb_stats->tx_bytes += skb->len; 154 lb_stats->tx_bytes = lb_stats->rx_bytes;
155 lb_stats->rx_packets++; 155 lb_stats->rx_packets++;
156 lb_stats->tx_packets++; 156 lb_stats->tx_packets = lb_stats->rx_packets;
157 put_cpu(); 157 put_cpu();
158 158
159 netif_rx(skb); 159 netif_rx(skb);