Lines Matching refs:tunnel

271 	struct ip_tunnel *tunnel;  in erspan_rcv()  local
284 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, flags, in erspan_rcv()
295 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, flags, in erspan_rcv()
299 if (tunnel) { in erspan_rcv()
314 if (tunnel->collect_md) { in erspan_rcv()
350 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in erspan_rcv()
365 struct ip_tunnel *tunnel; in __ipgre_rcv() local
368 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, in __ipgre_rcv()
371 if (tunnel) { in __ipgre_rcv()
381 if (tunnel->dev->header_ops == &ipgre_header_ops) in __ipgre_rcv()
386 tnl_params = &tunnel->parms.iph; in __ipgre_rcv()
387 if (tunnel->collect_md || tnl_params->daddr == 0) { in __ipgre_rcv()
401 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in __ipgre_rcv()
473 struct ip_tunnel *tunnel = netdev_priv(dev); in __gre_xmit() local
476 ip_tunnel_flags_copy(flags, tunnel->parms.o_flags); in __gre_xmit()
479 gre_build_header(skb, tunnel->tun_hlen, in __gre_xmit()
480 flags, proto, tunnel->parms.o_key, in __gre_xmit()
482 htonl(atomic_fetch_inc(&tunnel->o_seqno)) : 0); in __gre_xmit()
495 struct ip_tunnel *tunnel = netdev_priv(dev); in gre_fb_xmit() local
514 tunnel->parms.o_flags))) in gre_fb_xmit()
525 htonl(atomic_fetch_inc(&tunnel->o_seqno)) : 0); in gre_fb_xmit()
538 struct ip_tunnel *tunnel = netdev_priv(dev); in erspan_fb_xmit() local
610 htonl(atomic_fetch_inc(&tunnel->o_seqno))); in erspan_fb_xmit()
648 struct ip_tunnel *tunnel = netdev_priv(dev); in ipgre_xmit() local
654 if (tunnel->collect_md) { in ipgre_xmit()
660 int pull_len = tunnel->hlen + sizeof(struct iphdr); in ipgre_xmit()
681 tnl_params = &tunnel->parms.iph; in ipgre_xmit()
685 tunnel->parms.o_flags))) in ipgre_xmit()
700 struct ip_tunnel *tunnel = netdev_priv(dev); in erspan_xmit() local
707 if (tunnel->collect_md) { in erspan_xmit()
725 if (tunnel->erspan_ver == 0) { in erspan_xmit()
727 __clear_bit(IP_TUNNEL_SEQ_BIT, tunnel->parms.o_flags); in erspan_xmit()
728 } else if (tunnel->erspan_ver == 1) { in erspan_xmit()
729 erspan_build_header(skb, ntohl(tunnel->parms.o_key), in erspan_xmit()
730 tunnel->index, in erspan_xmit()
733 } else if (tunnel->erspan_ver == 2) { in erspan_xmit()
734 erspan_build_header_v2(skb, ntohl(tunnel->parms.o_key), in erspan_xmit()
735 tunnel->dir, tunnel->hwid, in erspan_xmit()
742 __clear_bit(IP_TUNNEL_KEY_BIT, tunnel->parms.o_flags); in erspan_xmit()
743 __gre_xmit(skb, dev, &tunnel->parms.iph, proto); in erspan_xmit()
755 struct ip_tunnel *tunnel = netdev_priv(dev); in gre_tap_xmit() local
760 if (tunnel->collect_md) { in gre_tap_xmit()
766 tunnel->parms.o_flags))) in gre_tap_xmit()
772 __gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_TEB)); in gre_tap_xmit()
783 struct ip_tunnel *tunnel = netdev_priv(dev); in ipgre_link_update() local
786 len = tunnel->tun_hlen; in ipgre_link_update()
787 tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags); in ipgre_link_update()
788 len = tunnel->tun_hlen - len; in ipgre_link_update()
789 tunnel->hlen = tunnel->hlen + len; in ipgre_link_update()
799 if (test_bit(IP_TUNNEL_SEQ_BIT, tunnel->parms.o_flags) || in ipgre_link_update()
800 (test_bit(IP_TUNNEL_CSUM_BIT, tunnel->parms.o_flags) && in ipgre_link_update()
801 tunnel->encap.type != TUNNEL_ENCAP_NONE)) { in ipgre_link_update()
991 struct ip_tunnel *tunnel; in __gre_tunnel_init() local
993 tunnel = netdev_priv(dev); in __gre_tunnel_init()
994 tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags); in __gre_tunnel_init()
995 tunnel->parms.iph.protocol = IPPROTO_GRE; in __gre_tunnel_init()
997 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen; in __gre_tunnel_init()
998 dev->needed_headroom = tunnel->hlen + sizeof(tunnel->parms.iph); in __gre_tunnel_init()
1006 if (test_bit(IP_TUNNEL_SEQ_BIT, tunnel->parms.o_flags)) in __gre_tunnel_init()
1008 if (test_bit(IP_TUNNEL_CSUM_BIT, tunnel->parms.o_flags) && in __gre_tunnel_init()
1009 tunnel->encap.type != TUNNEL_ENCAP_NONE) in __gre_tunnel_init()
1020 struct ip_tunnel *tunnel = netdev_priv(dev); in ipgre_tunnel_init() local
1021 struct iphdr *iph = &tunnel->parms.iph; in ipgre_tunnel_init()
1032 if (iph->daddr && !tunnel->collect_md) { in ipgre_tunnel_init()
1039 dev->hard_header_len = tunnel->hlen + sizeof(*iph); in ipgre_tunnel_init()
1043 } else if (!tunnel->collect_md) { in ipgre_tunnel_init()
1045 dev->hard_header_len = tunnel->hlen + sizeof(*iph); in ipgre_tunnel_init()
1335 struct ip_tunnel *tunnel = netdev_priv(dev); in erspan_tunnel_init() local
1337 if (tunnel->erspan_ver == 0) in erspan_tunnel_init()
1338 tunnel->tun_hlen = 4; /* 4-byte GRE hdr. */ in erspan_tunnel_init()
1340 tunnel->tun_hlen = 8; /* 8-byte GRE hdr. */ in erspan_tunnel_init()
1342 tunnel->parms.iph.protocol = IPPROTO_GRE; in erspan_tunnel_init()
1343 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen + in erspan_tunnel_init()
1344 erspan_hdr_len(tunnel->erspan_ver); in erspan_tunnel_init()