Lines Matching defs:itn

83 struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
94 head = &itn->tunnels[hash];
127 head = &itn->tunnels[hash];
162 t = rcu_dereference(itn->collect_md_tun);
166 ndev = READ_ONCE(itn->fb_tunnel_dev);
174 static struct hlist_head *ip_bucket(struct ip_tunnel_net *itn,
190 return &itn->tunnels[h];
193 static void ip_tunnel_add(struct ip_tunnel_net *itn, struct ip_tunnel *t)
195 struct hlist_head *head = ip_bucket(itn, &t->parms);
198 rcu_assign_pointer(itn->collect_md_tun, t);
202 static void ip_tunnel_del(struct ip_tunnel_net *itn, struct ip_tunnel *t)
205 rcu_assign_pointer(itn->collect_md_tun, NULL);
209 static struct ip_tunnel *ip_tunnel_find(struct ip_tunnel_net *itn,
219 struct hlist_head *head = ip_bucket(itn, parms);
329 struct ip_tunnel_net *itn,
338 dev = __ip_tunnel_create(net, itn->rtnl_link_ops, parms);
354 ip_tunnel_add(itn, nt);
872 static void ip_tunnel_update(struct ip_tunnel_net *itn,
879 ip_tunnel_del(itn, t);
888 ip_tunnel_add(itn, t);
912 struct ip_tunnel_net *itn = net_generic(net, t->ip_tnl_net_id);
916 if (dev == itn->fb_tunnel_dev) {
917 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type);
938 t = ip_tunnel_find(itn, p, itn->type);
942 t = ip_tunnel_create(net, itn, p);
950 if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
975 ip_tunnel_update(itn, t, dev, p, true, 0);
986 if (dev == itn->fb_tunnel_dev) {
988 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type);
992 if (t == netdev_priv(itn->fb_tunnel_dev))
1066 struct ip_tunnel_net *itn;
1068 itn = net_generic(tunnel->net, tunnel->ip_tnl_net_id);
1070 if (itn->fb_tunnel_dev != dev) {
1071 ip_tunnel_del(itn, netdev_priv(dev));
1096 struct ip_tunnel_net *itn = net_generic(net, ip_tnl_net_id);
1100 itn->rtnl_link_ops = ops;
1102 INIT_HLIST_HEAD(&itn->tunnels[i]);
1108 itn->type = it_init_net->type;
1109 itn->fb_tunnel_dev = NULL;
1118 itn->fb_tunnel_dev = __ip_tunnel_create(net, ops, &parms);
1122 if (!IS_ERR(itn->fb_tunnel_dev)) {
1123 itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
1124 itn->fb_tunnel_dev->mtu = ip_tunnel_bind_dev(itn->fb_tunnel_dev);
1125 ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev));
1126 itn->type = itn->fb_tunnel_dev->type;
1130 return PTR_ERR_OR_ZERO(itn->fb_tunnel_dev);
1134 static void ip_tunnel_destroy(struct net *net, struct ip_tunnel_net *itn,
1148 struct hlist_head *thead = &itn->tunnels[h];
1162 struct ip_tunnel_net *itn;
1168 itn = net_generic(net, id);
1169 ip_tunnel_destroy(net, itn, &list, ops);
1181 struct ip_tunnel_net *itn;
1186 itn = net_generic(net, nt->ip_tnl_net_id);
1189 if (rtnl_dereference(itn->collect_md_tun))
1192 if (ip_tunnel_find(itn, p, dev->type))
1220 ip_tunnel_add(itn, nt);
1236 struct ip_tunnel_net *itn = net_generic(net, tunnel->ip_tnl_net_id);
1238 if (dev == itn->fb_tunnel_dev)
1241 t = ip_tunnel_find(itn, p, dev->type);
1263 ip_tunnel_update(itn, t, dev, p, !tb[IFLA_MTU], fwmark);
1309 struct ip_tunnel_net *itn;
1311 itn = net_generic(net, tunnel->ip_tnl_net_id);
1312 ip_tunnel_del(itn, netdev_priv(dev));
1313 if (itn->fb_tunnel_dev == dev)
1314 WRITE_ONCE(itn->fb_tunnel_dev, NULL);