tree a273c9fe65d970a10490b838f95e2d52e2193ed3
parent d2ae1d2ff9282ca061b6f5244eee4c28ee2b3ffa
author Chuck Ebbert <[EMAIL PROTECTED]> Sun, 03 Jul 2005 05:28:22 -0400
committer Jeff Garzik <[EMAIL PROTECTED]> Sun, 31 Jul 2005 09:06:10 -0400

[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 <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>

 drivers/net/loopback.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -151,9 +151,9 @@ static int loopback_xmit(struct sk_buff 
 
        lb_stats = &per_cpu(loopback_stats, get_cpu());
        lb_stats->rx_bytes += skb->len;
-       lb_stats->tx_bytes += skb->len;
+       lb_stats->tx_bytes = lb_stats->rx_bytes;
        lb_stats->rx_packets++;
-       lb_stats->tx_packets++;
+       lb_stats->tx_packets = lb_stats->rx_packets;
        put_cpu();
 
        netif_rx(skb);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to