aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipip.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-26 20:33:35 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-28 00:30:42 -0400
commit290b895e0ba4552dfcfc4bd35759c192345b934a (patch)
tree439ffccea9fa87b28b6af2a06e562cc5a0c01f80 /include/net/ipip.h
parentaf5ef241133b602a77b682009f112e7c3f7604e5 (diff)
tunnels: prepare percpu accounting
Tunnels are going to use percpu for their accounting. They are going to use a new tstats field in net_device. skb_tunnel_rx() is changed to be a wrapper around __skb_tunnel_rx() IPTUNNEL_XMIT() is changed to be a wrapper around __IPTUNNEL_XMIT() 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.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 65caea8b414f..58abbf966b0c 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -45,7 +45,7 @@ struct ip_tunnel_prl_entry {
45 struct rcu_head rcu_head; 45 struct rcu_head rcu_head;
46}; 46};
47 47
48#define IPTUNNEL_XMIT() do { \ 48#define __IPTUNNEL_XMIT(stats1, stats2) do { \
49 int err; \ 49 int err; \
50 int pkt_len = skb->len - skb_transport_offset(skb); \ 50 int pkt_len = skb->len - skb_transport_offset(skb); \
51 \ 51 \
@@ -54,12 +54,14 @@ struct ip_tunnel_prl_entry {
54 \ 54 \
55 err = ip_local_out(skb); \ 55 err = ip_local_out(skb); \
56 if (likely(net_xmit_eval(err) == 0)) { \ 56 if (likely(net_xmit_eval(err) == 0)) { \
57 txq->tx_bytes += pkt_len; \ 57 (stats1)->tx_bytes += pkt_len; \
58 txq->tx_packets++; \ 58 (stats1)->tx_packets++; \
59 } else { \ 59 } else { \
60 stats->tx_errors++; \ 60 (stats2)->tx_errors++; \
61 stats->tx_aborted_errors++; \ 61 (stats2)->tx_aborted_errors++; \
62 } \ 62 } \
63} while (0) 63} while (0)
64 64
65#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats)
66
65#endif 67#endif