• Home
  • Raw
  • Download

Lines Matching refs:tunnel

267 	struct ip_tunnel *tunnel;  in erspan_rcv()  local
277 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, in erspan_rcv()
283 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, in erspan_rcv()
288 if (tunnel) { in erspan_rcv()
303 if (tunnel->collect_md) { in erspan_rcv()
339 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in erspan_rcv()
354 struct ip_tunnel *tunnel; in __ipgre_rcv() local
357 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, in __ipgre_rcv()
360 if (tunnel) { in __ipgre_rcv()
367 if (tunnel->dev->type != ARPHRD_NONE) in __ipgre_rcv()
372 tnl_params = &tunnel->parms.iph; in __ipgre_rcv()
373 if (tunnel->collect_md || tnl_params->daddr == 0) { in __ipgre_rcv()
384 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in __ipgre_rcv()
456 struct ip_tunnel *tunnel = netdev_priv(dev); in __gre_xmit() local
457 __be16 flags = tunnel->parms.o_flags; in __gre_xmit()
460 gre_build_header(skb, tunnel->tun_hlen, in __gre_xmit()
461 flags, proto, tunnel->parms.o_key, in __gre_xmit()
462 (flags & TUNNEL_SEQ) ? htonl(atomic_fetch_inc(&tunnel->o_seqno)) : 0); in __gre_xmit()
475 struct ip_tunnel *tunnel = netdev_priv(dev); in gre_fb_xmit() local
500 (flags & TUNNEL_SEQ) ? htonl(atomic_fetch_inc(&tunnel->o_seqno)) : 0); in gre_fb_xmit()
513 struct ip_tunnel *tunnel = netdev_priv(dev); in erspan_fb_xmit() local
582 proto, 0, htonl(atomic_fetch_inc(&tunnel->o_seqno))); in erspan_fb_xmit()
620 struct ip_tunnel *tunnel = netdev_priv(dev); in ipgre_xmit() local
626 if (tunnel->collect_md) { in ipgre_xmit()
640 skb_pull(skb, tunnel->hlen + sizeof(struct iphdr)); in ipgre_xmit()
650 tnl_params = &tunnel->parms.iph; in ipgre_xmit()
653 if (gre_handle_offloads(skb, !!(tunnel->parms.o_flags & TUNNEL_CSUM))) in ipgre_xmit()
668 struct ip_tunnel *tunnel = netdev_priv(dev); in erspan_xmit() local
675 if (tunnel->collect_md) { in erspan_xmit()
692 if (tunnel->erspan_ver == 0) { in erspan_xmit()
694 tunnel->parms.o_flags &= ~TUNNEL_SEQ; in erspan_xmit()
695 } else if (tunnel->erspan_ver == 1) { in erspan_xmit()
696 erspan_build_header(skb, ntohl(tunnel->parms.o_key), in erspan_xmit()
697 tunnel->index, in erspan_xmit()
700 } else if (tunnel->erspan_ver == 2) { in erspan_xmit()
701 erspan_build_header_v2(skb, ntohl(tunnel->parms.o_key), in erspan_xmit()
702 tunnel->dir, tunnel->hwid, in erspan_xmit()
709 tunnel->parms.o_flags &= ~TUNNEL_KEY; in erspan_xmit()
710 __gre_xmit(skb, dev, &tunnel->parms.iph, proto); in erspan_xmit()
722 struct ip_tunnel *tunnel = netdev_priv(dev); in gre_tap_xmit() local
727 if (tunnel->collect_md) { in gre_tap_xmit()
732 if (gre_handle_offloads(skb, !!(tunnel->parms.o_flags & TUNNEL_CSUM))) in gre_tap_xmit()
738 __gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_TEB)); in gre_tap_xmit()
749 struct ip_tunnel *tunnel = netdev_priv(dev); in ipgre_link_update() local
752 len = tunnel->tun_hlen; in ipgre_link_update()
753 tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags); in ipgre_link_update()
754 len = tunnel->tun_hlen - len; in ipgre_link_update()
755 tunnel->hlen = tunnel->hlen + len; in ipgre_link_update()
765 if (!(tunnel->parms.o_flags & TUNNEL_SEQ)) { in ipgre_link_update()
766 if (!(tunnel->parms.o_flags & TUNNEL_CSUM) || in ipgre_link_update()
767 tunnel->encap.type == TUNNEL_ENCAP_NONE) { in ipgre_link_update()
950 struct ip_tunnel *tunnel; in __gre_tunnel_init() local
952 tunnel = netdev_priv(dev); in __gre_tunnel_init()
953 tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags); in __gre_tunnel_init()
954 tunnel->parms.iph.protocol = IPPROTO_GRE; in __gre_tunnel_init()
956 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen; in __gre_tunnel_init()
957 dev->needed_headroom = tunnel->hlen + sizeof(tunnel->parms.iph); in __gre_tunnel_init()
962 if (!(tunnel->parms.o_flags & TUNNEL_SEQ)) { in __gre_tunnel_init()
967 if (!(tunnel->parms.o_flags & TUNNEL_CSUM) || in __gre_tunnel_init()
968 (tunnel->encap.type == TUNNEL_ENCAP_NONE)) { in __gre_tunnel_init()
982 struct ip_tunnel *tunnel = netdev_priv(dev); in ipgre_tunnel_init() local
983 struct iphdr *iph = &tunnel->parms.iph; in ipgre_tunnel_init()
994 if (iph->daddr && !tunnel->collect_md) { in ipgre_tunnel_init()
1001 dev->hard_header_len = tunnel->hlen + sizeof(*iph); in ipgre_tunnel_init()
1005 } else if (!tunnel->collect_md) { in ipgre_tunnel_init()
1007 dev->hard_header_len = tunnel->hlen + sizeof(*iph); in ipgre_tunnel_init()
1293 struct ip_tunnel *tunnel = netdev_priv(dev); in erspan_tunnel_init() local
1295 if (tunnel->erspan_ver == 0) in erspan_tunnel_init()
1296 tunnel->tun_hlen = 4; /* 4-byte GRE hdr. */ in erspan_tunnel_init()
1298 tunnel->tun_hlen = 8; /* 8-byte GRE hdr. */ in erspan_tunnel_init()
1300 tunnel->parms.iph.protocol = IPPROTO_GRE; in erspan_tunnel_init()
1301 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen + in erspan_tunnel_init()
1302 erspan_hdr_len(tunnel->erspan_ver); in erspan_tunnel_init()