Searched refs:fnhe (Results 1 - 2 of 2) sorted by relevance

/linux-4.1.27/net/ipv4/
H A Droute.c567 static void fnhe_flush_routes(struct fib_nh_exception *fnhe) fnhe_flush_routes() argument
571 rt = rcu_dereference(fnhe->fnhe_rth_input); fnhe_flush_routes()
573 RCU_INIT_POINTER(fnhe->fnhe_rth_input, NULL); fnhe_flush_routes()
576 rt = rcu_dereference(fnhe->fnhe_rth_output); fnhe_flush_routes()
578 RCU_INIT_POINTER(fnhe->fnhe_rth_output, NULL); fnhe_flush_routes()
585 struct fib_nh_exception *fnhe, *oldest; fnhe_oldest() local
588 for (fnhe = rcu_dereference(oldest->fnhe_next); fnhe; fnhe_oldest()
589 fnhe = rcu_dereference(fnhe->fnhe_next)) { fnhe_oldest()
590 if (time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp)) fnhe_oldest()
591 oldest = fnhe; fnhe_oldest()
607 static void fill_route_from_fnhe(struct rtable *rt, struct fib_nh_exception *fnhe) fill_route_from_fnhe() argument
609 rt->rt_pmtu = fnhe->fnhe_pmtu; fill_route_from_fnhe()
610 rt->dst.expires = fnhe->fnhe_expires; fill_route_from_fnhe()
612 if (fnhe->fnhe_gw) { fill_route_from_fnhe()
614 rt->rt_gateway = fnhe->fnhe_gw; fill_route_from_fnhe()
623 struct fib_nh_exception *fnhe; update_or_create_fnhe() local
642 for (fnhe = rcu_dereference(hash->chain); fnhe; update_or_create_fnhe()
643 fnhe = rcu_dereference(fnhe->fnhe_next)) { update_or_create_fnhe()
644 if (fnhe->fnhe_daddr == daddr) update_or_create_fnhe()
649 if (fnhe) { update_or_create_fnhe()
651 fnhe->fnhe_gw = gw; update_or_create_fnhe()
653 fnhe->fnhe_pmtu = pmtu; update_or_create_fnhe()
654 fnhe->fnhe_expires = max(1UL, expires); update_or_create_fnhe()
657 rt = rcu_dereference(fnhe->fnhe_rth_input); update_or_create_fnhe()
659 fill_route_from_fnhe(rt, fnhe); update_or_create_fnhe()
660 rt = rcu_dereference(fnhe->fnhe_rth_output); update_or_create_fnhe()
662 fill_route_from_fnhe(rt, fnhe); update_or_create_fnhe()
665 fnhe = fnhe_oldest(hash); update_or_create_fnhe()
667 fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC); update_or_create_fnhe()
668 if (!fnhe) update_or_create_fnhe()
671 fnhe->fnhe_next = hash->chain; update_or_create_fnhe()
672 rcu_assign_pointer(hash->chain, fnhe); update_or_create_fnhe()
674 fnhe->fnhe_genid = fnhe_genid(dev_net(nh->nh_dev)); update_or_create_fnhe()
675 fnhe->fnhe_daddr = daddr; update_or_create_fnhe()
676 fnhe->fnhe_gw = gw; update_or_create_fnhe()
677 fnhe->fnhe_pmtu = pmtu; update_or_create_fnhe()
678 fnhe->fnhe_expires = expires; update_or_create_fnhe()
697 fnhe->fnhe_stamp = jiffies;
1250 struct fib_nh_exception *fnhe; find_exception() local
1258 for (fnhe = rcu_dereference(hash[hval].chain); fnhe; find_exception()
1259 fnhe = rcu_dereference(fnhe->fnhe_next)) { find_exception()
1260 if (fnhe->fnhe_daddr == daddr) find_exception()
1261 return fnhe; find_exception()
1266 static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe, rt_bind_exception() argument
1273 if (daddr == fnhe->fnhe_daddr) { rt_bind_exception()
1279 porig = &fnhe->fnhe_rth_input; rt_bind_exception()
1281 porig = &fnhe->fnhe_rth_output; rt_bind_exception()
1284 if (fnhe->fnhe_genid != genid) { rt_bind_exception()
1285 fnhe->fnhe_genid = genid; rt_bind_exception()
1286 fnhe->fnhe_gw = 0; rt_bind_exception()
1287 fnhe->fnhe_pmtu = 0; rt_bind_exception()
1288 fnhe->fnhe_expires = 0; rt_bind_exception()
1289 fnhe_flush_routes(fnhe); rt_bind_exception()
1292 fill_route_from_fnhe(rt, fnhe); rt_bind_exception()
1303 fnhe->fnhe_stamp = jiffies; rt_bind_exception()
1393 struct fib_nh_exception *fnhe, rt_set_nexthop()
1409 if (unlikely(fnhe)) rt_set_nexthop()
1410 cached = rt_bind_exception(rt, fnhe, daddr); rt_set_nexthop()
1545 struct fib_nh_exception *fnhe, __rcu **fnhe_p; ip_del_fnhe() local
1555 fnhe = rcu_dereference_protected(*fnhe_p, lockdep_is_held(&fnhe_lock)); ip_del_fnhe()
1556 while (fnhe) { ip_del_fnhe()
1557 if (fnhe->fnhe_daddr == daddr) { ip_del_fnhe()
1559 fnhe->fnhe_next, lockdep_is_held(&fnhe_lock))); ip_del_fnhe()
1560 fnhe_flush_routes(fnhe); ip_del_fnhe()
1561 kfree_rcu(fnhe, rcu); ip_del_fnhe()
1564 fnhe_p = &fnhe->fnhe_next; ip_del_fnhe()
1565 fnhe = rcu_dereference_protected(fnhe->fnhe_next, ip_del_fnhe()
1578 struct fib_nh_exception *fnhe; __mkroute_input() local
1624 fnhe = find_exception(&FIB_RES_NH(*res), daddr); __mkroute_input()
1626 if (fnhe) { __mkroute_input()
1627 rth = rcu_dereference(fnhe->fnhe_rth_input); __mkroute_input()
1631 fnhe = NULL; __mkroute_input()
1668 rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag); __mkroute_input()
1938 struct fib_nh_exception *fnhe; __mkroute_output() local
1981 fnhe = NULL; __mkroute_output()
1987 fnhe = find_exception(nh, fl4->daddr); __mkroute_output()
1988 if (fnhe) { __mkroute_output()
1989 prth = &fnhe->fnhe_rth_output; __mkroute_output()
1994 fnhe = NULL; __mkroute_output()
2058 rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0); __mkroute_output()
1391 rt_set_nexthop(struct rtable *rt, __be32 daddr, const struct fib_result *res, struct fib_nh_exception *fnhe, struct fib_info *fi, u16 type, u32 itag) rt_set_nexthop() argument
H A Dfib_semantics.c167 struct fib_nh_exception *fnhe; free_nh_exceptions() local
169 fnhe = rcu_dereference_protected(hash[i].chain, 1); free_nh_exceptions()
170 while (fnhe) { free_nh_exceptions()
173 next = rcu_dereference_protected(fnhe->fnhe_next, 1); free_nh_exceptions()
175 rt_fibinfo_free(&fnhe->fnhe_rth_input); free_nh_exceptions()
176 rt_fibinfo_free(&fnhe->fnhe_rth_output); free_nh_exceptions()
178 kfree(fnhe); free_nh_exceptions()
180 fnhe = next; free_nh_exceptions()

Completed in 138 milliseconds