summaryrefslogtreecommitdiff
path: root/include/net/ipip.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-05 00:11:22 -0700
committerDavid S. Miller <davem@davemloft.net>2009-10-05 00:21:57 -0700
commit0bfbedb14a8a96c529341bec88991a92b41fac72 (patch)
treed52ccb4758fd58cbf74c7a9001e6885275d3ddc8 /include/net/ipip.h
parent16c6cf8bb471392fd09b48b7c27e7d83a446b4bc (diff)
tunnels: Optimize tx path
We currently dirty a cache line to update tunnel device stats (tx_packets/tx_bytes). We better use the txq->tx_bytes/tx_packets counters that already are present in cpu cache, in the cache line shared with txq->_xmit_lock This patch extends IPTUNNEL_XMIT() macro to use txq pointer provided by the caller. Also &tunnel->dev->stats can be replaced by &dev->stats Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipip.h')
-rw-r--r--include/net/ipip.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 87acf8f3a155..0159221a8509 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -42,9 +42,9 @@ struct ip_tunnel_prl_entry
ip_select_ident(iph, &rt->u.dst, NULL); \
\
err = ip_local_out(skb); \
- if (net_xmit_eval(err) == 0) { \
- stats->tx_bytes += pkt_len; \
- stats->tx_packets++; \
+ if (likely(net_xmit_eval(err) == 0)) { \
+ txq->tx_bytes += pkt_len; \
+ txq->tx_packets++; \
} else { \
stats->tx_errors++; \
stats->tx_aborted_errors++; \