aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipip.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ipip.h')
-rw-r--r--include/net/ipip.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/include/net/ipip.h b/include/net/ipip.h
index ddc077c51f32..21947cf4fa46 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry {
48 struct rcu_head rcu_head; 48 struct rcu_head rcu_head;
49}; 49};
50 50
51#define __IPTUNNEL_XMIT(stats1, stats2) do { \ 51static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev)
52 int err; \ 52{
53 int pkt_len = skb->len - skb_transport_offset(skb); \ 53 int err;
54 \ 54 struct iphdr *iph = ip_hdr(skb);
55 skb->ip_summed = CHECKSUM_NONE; \ 55 int pkt_len = skb->len - skb_transport_offset(skb);
56 ip_select_ident(iph, &rt->dst, NULL); \ 56 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
57 \
58 err = ip_local_out(skb); \
59 if (likely(net_xmit_eval(err) == 0)) { \
60 u64_stats_update_begin(&(stats1)->syncp); \
61 (stats1)->tx_bytes += pkt_len; \
62 (stats1)->tx_packets++; \
63 u64_stats_update_end(&(stats1)->syncp); \
64 } else { \
65 (stats2)->tx_errors++; \
66 (stats2)->tx_aborted_errors++; \
67 } \
68} while (0)
69 57
70#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) 58 nf_reset(skb);
59 skb->ip_summed = CHECKSUM_NONE;
60 ip_select_ident(iph, skb_dst(skb), NULL);
61
62 err = ip_local_out(skb);
63 if (likely(net_xmit_eval(err) == 0)) {
64 u64_stats_update_begin(&tstats->syncp);
65 tstats->tx_bytes += pkt_len;
66 tstats->tx_packets++;
67 u64_stats_update_end(&tstats->syncp);
68 } else {
69 dev->stats.tx_errors++;
70 dev->stats.tx_aborted_errors++;
71 }
72}
71 73
72#endif 74#endif