Lines Matching refs:fnhe

605 static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
609 rt = rcu_dereference(fnhe->fnhe_rth_input);
611 RCU_INIT_POINTER(fnhe->fnhe_rth_input, NULL);
615 rt = rcu_dereference(fnhe->fnhe_rth_output);
617 RCU_INIT_POINTER(fnhe->fnhe_rth_output, NULL);
626 struct fib_nh_exception *fnhe, *oldest = NULL;
628 for (fnhe_p = &hash->chain; ; fnhe_p = &fnhe->fnhe_next) {
629 fnhe = rcu_dereference_protected(*fnhe_p,
631 if (!fnhe)
634 time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp)) {
635 oldest = fnhe;
654 static void fill_route_from_fnhe(struct rtable *rt, struct fib_nh_exception *fnhe)
656 rt->rt_pmtu = fnhe->fnhe_pmtu;
657 rt->rt_mtu_locked = fnhe->fnhe_mtu_locked;
658 rt->dst.expires = fnhe->fnhe_expires;
660 if (fnhe->fnhe_gw) {
664 rt->rt_gw4 = fnhe->fnhe_gw;
673 struct fib_nh_exception *fnhe;
695 for (fnhe = rcu_dereference(hash->chain); fnhe;
696 fnhe = rcu_dereference(fnhe->fnhe_next)) {
697 if (fnhe->fnhe_daddr == daddr)
702 if (fnhe) {
703 if (fnhe->fnhe_genid != genid)
704 fnhe->fnhe_genid = genid;
706 fnhe->fnhe_gw = gw;
708 fnhe->fnhe_pmtu = pmtu;
709 fnhe->fnhe_mtu_locked = lock;
711 fnhe->fnhe_expires = max(1UL, expires);
713 rt = rcu_dereference(fnhe->fnhe_rth_input);
715 fill_route_from_fnhe(rt, fnhe);
716 rt = rcu_dereference(fnhe->fnhe_rth_output);
718 fill_route_from_fnhe(rt, fnhe);
729 fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC);
730 if (!fnhe)
733 fnhe->fnhe_next = hash->chain;
735 fnhe->fnhe_genid = genid;
736 fnhe->fnhe_daddr = daddr;
737 fnhe->fnhe_gw = gw;
738 fnhe->fnhe_pmtu = pmtu;
739 fnhe->fnhe_mtu_locked = lock;
740 fnhe->fnhe_expires = max(1UL, expires);
742 rcu_assign_pointer(hash->chain, fnhe);
761 fnhe->fnhe_stamp = jiffies;
1371 struct fib_nh_exception *fnhe, __rcu **fnhe_p;
1381 fnhe = rcu_dereference_protected(*fnhe_p, lockdep_is_held(&fnhe_lock));
1382 while (fnhe) {
1383 if (fnhe->fnhe_daddr == daddr) {
1385 fnhe->fnhe_next, lockdep_is_held(&fnhe_lock)));
1389 fnhe->fnhe_daddr = 0;
1390 fnhe_flush_routes(fnhe);
1391 kfree_rcu(fnhe, rcu);
1394 fnhe_p = &fnhe->fnhe_next;
1395 fnhe = rcu_dereference_protected(fnhe->fnhe_next,
1406 struct fib_nh_exception *fnhe;
1414 for (fnhe = rcu_dereference(hash[hval].chain); fnhe;
1415 fnhe = rcu_dereference(fnhe->fnhe_next)) {
1416 if (fnhe->fnhe_daddr == daddr) {
1417 if (fnhe->fnhe_expires &&
1418 time_after(jiffies, fnhe->fnhe_expires)) {
1422 return fnhe;
1446 struct fib_nh_exception *fnhe;
1448 fnhe = find_exception(nhc, daddr);
1449 if (fnhe && !time_after_eq(jiffies, fnhe->fnhe_expires))
1450 mtu = fnhe->fnhe_pmtu;
1459 static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe,
1466 if (daddr == fnhe->fnhe_daddr) {
1472 porig = &fnhe->fnhe_rth_input;
1474 porig = &fnhe->fnhe_rth_output;
1477 if (fnhe->fnhe_genid != genid) {
1478 fnhe->fnhe_genid = genid;
1479 fnhe->fnhe_gw = 0;
1480 fnhe->fnhe_pmtu = 0;
1481 fnhe->fnhe_expires = 0;
1482 fnhe->fnhe_mtu_locked = false;
1483 fnhe_flush_routes(fnhe);
1486 fill_route_from_fnhe(rt, fnhe);
1502 fnhe->fnhe_stamp = jiffies;
1605 struct fib_nh_exception *fnhe,
1635 if (unlikely(fnhe))
1636 cached = rt_bind_exception(rt, fnhe, daddr, do_cache);
1835 struct fib_nh_exception *fnhe;
1888 fnhe = find_exception(nhc, daddr);
1890 if (fnhe)
1891 rth = rcu_dereference(fnhe->fnhe_rth_input);
1912 rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag,
2430 struct fib_nh_exception *fnhe;
2487 fnhe = NULL;
2493 fnhe = find_exception(nhc, fl4->daddr);
2496 if (fnhe) {
2497 prth = &fnhe->fnhe_rth_output;
2541 rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0, do_cache);
3005 struct fib_nh_exception *fnhe;
3007 for (fnhe = rcu_dereference(bucket[i].chain); fnhe;
3008 fnhe = rcu_dereference(fnhe->fnhe_next)) {
3015 if (fnhe->fnhe_genid != genid)
3018 if (fnhe->fnhe_expires &&
3019 time_after(jiffies, fnhe->fnhe_expires))
3022 rt = rcu_dereference(fnhe->fnhe_rth_input);
3024 rt = rcu_dereference(fnhe->fnhe_rth_output);
3028 err = rt_fill_info(net, fnhe->fnhe_daddr, 0, rt,