Lines Matching refs:tunnel
491 struct ip6_tnl *tunnel; in ip6gre_rcv() local
494 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6gre_rcv()
497 if (tunnel) { in ip6gre_rcv()
498 if (tunnel->parms.collect_md) { in ip6gre_rcv()
510 ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ip6gre_rcv()
512 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error); in ip6gre_rcv()
528 struct ip6_tnl *tunnel; in ip6erspan_rcv() local
538 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6erspan_rcv()
541 if (tunnel) { in ip6erspan_rcv()
552 if (tunnel->parms.collect_md) { in ip6erspan_rcv()
587 ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ip6erspan_rcv()
590 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error); in ip6erspan_rcv()
751 struct ip6_tnl *tunnel = netdev_priv(dev); in __gre6_xmit() local
761 fl6->daddr = tunnel->parms.raddr; in __gre6_xmit()
766 if (tunnel->parms.collect_md) { in __gre6_xmit()
792 if (skb_cow_head(skb, dev->needed_headroom ?: tun_hlen + tunnel->encap_hlen)) in __gre6_xmit()
799 htonl(atomic_fetch_inc(&tunnel->o_seqno)) : in __gre6_xmit()
803 if (skb_cow_head(skb, dev->needed_headroom ?: tunnel->hlen)) in __gre6_xmit()
806 ip_tunnel_flags_copy(flags, tunnel->parms.o_flags); in __gre6_xmit()
808 gre_build_header(skb, tunnel->tun_hlen, flags, in __gre6_xmit()
809 protocol, tunnel->parms.o_key, in __gre6_xmit()
811 htonl(atomic_fetch_inc(&tunnel->o_seqno)) : in __gre6_xmit()
1191 static int ip6gre_calc_hlen(struct ip6_tnl *tunnel) in ip6gre_calc_hlen() argument
1195 tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags); in ip6gre_calc_hlen()
1196 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen; in ip6gre_calc_hlen()
1198 t_hlen = tunnel->hlen + sizeof(struct ipv6hdr); in ip6gre_calc_hlen()
1200 if (tunnel->dev->header_ops) in ip6gre_calc_hlen()
1201 tunnel->dev->hard_header_len = LL_MAX_HEADER + t_hlen; in ip6gre_calc_hlen()
1203 tunnel->dev->needed_headroom = LL_MAX_HEADER + t_hlen; in ip6gre_calc_hlen()
1494 struct ip6_tnl *tunnel; in ip6gre_tunnel_init_common() local
1498 tunnel = netdev_priv(dev); in ip6gre_tunnel_init_common()
1500 tunnel->dev = dev; in ip6gre_tunnel_init_common()
1501 tunnel->net = dev_net(dev); in ip6gre_tunnel_init_common()
1502 strcpy(tunnel->parms.name, dev->name); in ip6gre_tunnel_init_common()
1504 ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL); in ip6gre_tunnel_init_common()
1508 ret = gro_cells_init(&tunnel->gro_cells, dev); in ip6gre_tunnel_init_common()
1512 t_hlen = ip6gre_calc_hlen(tunnel); in ip6gre_tunnel_init_common()
1516 if (!(tunnel->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) in ip6gre_tunnel_init_common()
1519 if (tunnel->parms.collect_md) { in ip6gre_tunnel_init_common()
1524 netdev_hold(dev, &tunnel->dev_tracker, GFP_KERNEL); in ip6gre_tunnel_init_common()
1529 dst_cache_destroy(&tunnel->dst_cache); in ip6gre_tunnel_init_common()
1535 struct ip6_tnl *tunnel; in ip6gre_tunnel_init() local
1542 tunnel = netdev_priv(dev); in ip6gre_tunnel_init()
1544 if (tunnel->parms.collect_md) in ip6gre_tunnel_init()
1547 __dev_addr_set(dev, &tunnel->parms.laddr, sizeof(struct in6_addr)); in ip6gre_tunnel_init()
1548 memcpy(dev->broadcast, &tunnel->parms.raddr, sizeof(struct in6_addr)); in ip6gre_tunnel_init()
1550 if (ipv6_addr_any(&tunnel->parms.raddr)) in ip6gre_tunnel_init()
1558 struct ip6_tnl *tunnel = netdev_priv(dev); in ip6gre_fb_tunnel_init() local
1560 tunnel->dev = dev; in ip6gre_fb_tunnel_init()
1561 tunnel->net = dev_net(dev); in ip6gre_fb_tunnel_init()
1562 strcpy(tunnel->parms.name, dev->name); in ip6gre_fb_tunnel_init()
1564 tunnel->hlen = sizeof(struct ipv6hdr) + 4; in ip6gre_fb_tunnel_init()
1863 static int ip6erspan_calc_hlen(struct ip6_tnl *tunnel) in ip6erspan_calc_hlen() argument
1867 tunnel->tun_hlen = 8; in ip6erspan_calc_hlen()
1868 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen + in ip6erspan_calc_hlen()
1869 erspan_hdr_len(tunnel->parms.erspan_ver); in ip6erspan_calc_hlen()
1871 t_hlen = tunnel->hlen + sizeof(struct ipv6hdr); in ip6erspan_calc_hlen()
1872 tunnel->dev->needed_headroom = LL_MAX_HEADER + t_hlen; in ip6erspan_calc_hlen()
1878 struct ip6_tnl *tunnel; in ip6erspan_tap_init() local
1882 tunnel = netdev_priv(dev); in ip6erspan_tap_init()
1884 tunnel->dev = dev; in ip6erspan_tap_init()
1885 tunnel->net = dev_net(dev); in ip6erspan_tap_init()
1886 strcpy(tunnel->parms.name, dev->name); in ip6erspan_tap_init()
1888 ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL); in ip6erspan_tap_init()
1892 ret = gro_cells_init(&tunnel->gro_cells, dev); in ip6erspan_tap_init()
1896 t_hlen = ip6erspan_calc_hlen(tunnel); in ip6erspan_tap_init()
1900 if (!(tunnel->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) in ip6erspan_tap_init()
1904 ip6erspan_tnl_link_config(tunnel, 1); in ip6erspan_tap_init()
1906 netdev_hold(dev, &tunnel->dev_tracker, GFP_KERNEL); in ip6erspan_tap_init()
1911 dst_cache_destroy(&tunnel->dst_cache); in ip6erspan_tap_init()