Lines Matching refs:nhc

638 static void update_or_create_fnhe(struct fib_nh_common *nhc, __be32 daddr,
649 genid = fnhe_genid(dev_net(nhc->nhc_dev));
654 hash = rcu_dereference(nhc->nhc_exceptions);
659 rcu_assign_pointer(nhc->nhc_exceptions, hash);
718 rt = rcu_dereference(nhc->nhc_rth_input);
725 prt = per_cpu_ptr(nhc->nhc_pcpu_rth_output, i);
791 struct fib_nh_common *nhc;
794 nhc = FIB_RES_NHC(res);
795 update_or_create_fnhe(nhc, fl4->daddr, new_gw,
1045 struct fib_nh_common *nhc;
1048 nhc = FIB_RES_NHC(res);
1049 update_or_create_fnhe(nhc, fl4->daddr, 0, mtu, lock,
1328 static void ip_del_fnhe(struct fib_nh_common *nhc, __be32 daddr)
1336 hash = rcu_dereference_protected(nhc->nhc_exceptions,
1362 static struct fib_nh_exception *find_exception(struct fib_nh_common *nhc,
1365 struct fnhe_hash_bucket *hash = rcu_dereference(nhc->nhc_exceptions);
1379 ip_del_fnhe(nhc, daddr);
1396 struct fib_nh_common *nhc = res->nhc;
1397 struct net_device *dev = nhc->nhc_dev;
1408 fnhe = find_exception(nhc, daddr);
1416 return mtu - lwtunnel_headroom(nhc->nhc_lwtstate, mtu);
1469 static bool rt_cache_route(struct fib_nh_common *nhc, struct rtable *rt)
1475 p = (struct rtable **)&nhc->nhc_rth_input;
1477 p = (struct rtable **)raw_cpu_ptr(nhc->nhc_pcpu_rth_output);
1577 struct fib_nh_common *nhc = FIB_RES_NHC(*res);
1579 if (nhc->nhc_gw_family && nhc->nhc_scope == RT_SCOPE_LINK) {
1581 rt->rt_gw_family = nhc->nhc_gw_family;
1583 if (likely(nhc->nhc_gw_family == AF_INET))
1584 rt->rt_gw4 = nhc->nhc_gw.ipv4;
1586 rt->rt_gw6 = nhc->nhc_gw.ipv6;
1592 if (nhc->nhc_family == AF_INET) {
1595 nh = container_of(nhc, struct fib_nh, nh_common);
1599 rt->dst.lwtstate = lwtstate_get(nhc->nhc_lwtstate);
1603 cached = rt_cache_route(nhc, rt);
1793 struct fib_nh_common *nhc = FIB_RES_NHC(*res);
1794 struct net_device *dev = nhc->nhc_dev;
1823 gw = nhc->nhc_gw_family == AF_INET ? nhc->nhc_gw.ipv4 : 0;
1847 fnhe = find_exception(nhc, daddr);
1852 rth = rcu_dereference(nhc->nhc_rth_input);
2202 struct fib_nh_common *nhc = res->fi ? res->nhc : NULL;
2205 if (nhc)
2206 dev = l3mdev_master_dev_rcu(nhc->nhc_dev);
2361 struct fib_nh_common *nhc = FIB_RES_NHC(*res);
2363 rth = rcu_dereference(nhc->nhc_rth_input);
2390 struct fib_nh_common *nhc = FIB_RES_NHC(*res);
2392 rth->dst.lwtstate = lwtstate_get(nhc->nhc_lwtstate);
2399 if (unlikely(!rt_cache_route(nhc, rth)))
2570 struct fib_nh_common *nhc = FIB_RES_NHC(*res);
2573 fnhe = find_exception(nhc, fl4->daddr);
2581 !(nhc->nhc_gw_family &&
2582 nhc->nhc_scope == RT_SCOPE_LINK))) {
2586 prth = raw_cpu_ptr(nhc->nhc_pcpu_rth_output);
3080 struct fib_nh_common *nhc = fib_info_nhc(fi, nhsel);
3084 if (nhc->nhc_flags & RTNH_F_DEAD)
3088 bucket = rcu_dereference(nhc->nhc_exceptions);