4 #include <linux/if_tunnel.h>
5 #include <net/gro_cells.h>
8 /* Keep error state on tunnel for 30 sec */
9 #define IPTUNNEL_ERR_TIMEO (30*HZ)
11 /* 6rd prefix/relay information */
12 struct ip_tunnel_6rd_parm
{
13 struct in6_addr prefix
;
20 struct ip_tunnel __rcu
*next
;
21 struct net_device
*dev
;
23 int err_count
; /* Number of arrived ICMP errors */
24 unsigned long err_time
; /* Time when the last ICMP error arrived */
26 /* These four fields used only by GRE */
27 __u32 i_seqno
; /* The last seen seqno */
28 __u32 o_seqno
; /* The last output seqno */
29 int hlen
; /* Precalculated GRE header length */
32 struct ip_tunnel_parm parms
;
35 #ifdef CONFIG_IPV6_SIT_6RD
36 struct ip_tunnel_6rd_parm ip6rd
;
38 struct ip_tunnel_prl_entry __rcu
*prl
; /* potential router list */
39 unsigned int prl_count
; /* # of entries in PRL */
41 struct gro_cells gro_cells
;
44 struct ip_tunnel_prl_entry
{
45 struct ip_tunnel_prl_entry __rcu
*next
;
48 struct rcu_head rcu_head
;
51 #define __IPTUNNEL_XMIT(stats1, stats2) do { \
53 int pkt_len = skb->len - skb_transport_offset(skb); \
55 skb->ip_summed = CHECKSUM_NONE; \
56 ip_select_ident(iph, &rt->dst, NULL); \
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); \
65 (stats2)->tx_errors++; \
66 (stats2)->tx_aborted_errors++; \
70 #define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats)