Lines Matching refs:nexthop

22 static void remove_nexthop(struct net *net, struct nexthop *nh,
80 return !net->nexthop.notifier_chain.head; in nexthop_notifiers_is_empty()
100 const struct nexthop *nh) in nh_notifier_single_info_init()
180 const struct nexthop *nh) in nh_notifier_grp_info_init()
192 const struct nexthop *nh) in nh_notifier_grp_info_fini()
203 const struct nexthop *nh) in nh_notifier_info_init()
214 const struct nexthop *nh) in nh_notifier_info_fini()
224 struct nexthop *nh, in call_nexthop_notifiers()
244 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in call_nexthop_notifiers()
257 struct nexthop *nh; in nh_notifier_res_bucket_idle_timer_get()
345 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in __call_nexthop_res_bucket_notifiers()
378 struct nexthop *old_nh, in call_nexthop_res_bucket_notifiers()
379 struct nexthop *new_nh, in call_nexthop_res_bucket_notifiers()
389 static int call_nexthop_res_table_notifiers(struct net *net, struct nexthop *nh, in call_nexthop_res_table_notifiers()
415 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in call_nexthop_res_table_notifiers()
425 struct nexthop *nh, in call_nexthop_notifier()
462 head = &net->nexthop.devhash[hash]; in nexthop_devhash_add()
466 static void nexthop_free_group(struct nexthop *nh) in nexthop_free_group()
488 static void nexthop_free_single(struct nexthop *nh) in nexthop_free_single()
506 struct nexthop *nh = container_of(head, struct nexthop, rcu); in nexthop_free_rcu()
517 static struct nexthop *nexthop_alloc(void) in nexthop_alloc()
519 struct nexthop *nh; in nexthop_alloc()
521 nh = kzalloc(sizeof(struct nexthop), GFP_KERNEL); in nexthop_alloc()
568 while (++net->nexthop.seq == 0) in nh_base_seq_inc()
573 struct nexthop *nexthop_find_by_id(struct net *net, u32 id) in nexthop_find_by_id()
577 pp = &net->nexthop.rb_root.rb_node; in nexthop_find_by_id()
579 struct nexthop *nh; in nexthop_find_by_id()
586 nh = rb_entry(parent, struct nexthop, rb_node); in nexthop_find_by_id()
601 u32 id_start = net->nexthop.last_id_allocated; in nh_find_unused_id()
604 net->nexthop.last_id_allocated++; in nh_find_unused_id()
605 if (net->nexthop.last_id_allocated == id_start) in nh_find_unused_id()
608 if (!nexthop_find_by_id(net, net->nexthop.last_id_allocated)) in nh_find_unused_id()
609 return net->nexthop.last_id_allocated; in nh_find_unused_id()
692 static int nh_fill_node(struct sk_buff *skb, struct nexthop *nh, in nh_fill_node()
782 static size_t nh_nlmsg_size_grp(struct nexthop *nh) in nh_nlmsg_size_grp()
795 static size_t nh_nlmsg_size_single(struct nexthop *nh) in nh_nlmsg_size_single()
826 static size_t nh_nlmsg_size(struct nexthop *nh) in nh_nlmsg_size()
840 static void nexthop_notify(int event, struct nexthop *nh, struct nl_info *info) in nexthop_notify()
913 static int nh_fill_res_bucket(struct sk_buff *skb, struct nexthop *nh, in nh_fill_res_bucket()
965 struct nexthop *nh = nhge->nh_parent; in nexthop_bucket_notify()
988 static bool valid_group_nh(struct nexthop *nh, unsigned int npaths, in valid_group_nh()
1020 static int nh_check_attr_fdb_group(struct nexthop *nh, u8 *nh_family, in nh_check_attr_fdb_group()
1083 struct nexthop *nh; in nh_check_attr_group()
1154 static struct nexthop *nexthop_select_path_hthr(struct nh_group *nhg, int hash) in nexthop_select_path_hthr()
1156 struct nexthop *rc = NULL; in nexthop_select_path_hthr()
1191 static struct nexthop *nexthop_select_path_res(struct nh_group *nhg, int hash) in nexthop_select_path_res()
1207 struct nexthop *nexthop_select_path(struct nexthop *nh, int hash) in nexthop_select_path()
1225 int nexthop_for_each_fib6_nh(struct nexthop *nh, in nexthop_for_each_fib6_nh()
1266 int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg, in fib6_check_nexthop()
1310 static int fib6_check_nh_list(struct nexthop *old, struct nexthop *new, in fib6_check_nh_list()
1347 int fib_check_nexthop(struct nexthop *nh, u8 scope, in fib_check_nexthop()
1386 static int fib_check_nh_list(struct nexthop *old, struct nexthop *new, in fib_check_nh_list()
1736 struct nexthop *nhp = nhge->nh_parent; in remove_nh_grp_entry()
1738 struct nexthop *nh = nhge->nh; in remove_nh_grp_entry()
1808 static void remove_nexthop_from_groups(struct net *net, struct nexthop *nh, in remove_nexthop_from_groups()
1820 static void remove_nexthop_group(struct nexthop *nh, struct nl_info *nlinfo) in remove_nexthop_group()
1842 static void __remove_nexthop_fib(struct net *net, struct nexthop *nh) in __remove_nexthop_fib()
1864 static void __remove_nexthop(struct net *net, struct nexthop *nh, in __remove_nexthop()
1882 static void remove_nexthop(struct net *net, struct nexthop *nh, in remove_nexthop()
1888 rb_erase(&nh->rb_node, &net->nexthop.rb_root); in remove_nexthop()
1902 static void nh_rt_cache_flush(struct net *net, struct nexthop *nh, in nh_rt_cache_flush()
1903 struct nexthop *replaced_nh) in nh_rt_cache_flush()
1934 static int replace_nexthop_grp(struct net *net, struct nexthop *old, in replace_nexthop_grp()
1935 struct nexthop *new, const struct nh_config *cfg, in replace_nexthop_grp()
2039 struct nexthop *old, in replace_nexthop_single_notify_res()
2080 struct nexthop *group_nh, in replace_nexthop_single_notify()
2081 struct nexthop *old, in replace_nexthop_single_notify()
2102 static int replace_nexthop_single(struct net *net, struct nexthop *old, in replace_nexthop_single()
2103 struct nexthop *new, in replace_nexthop_single()
2142 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
2155 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
2173 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
2181 static void __nexthop_replace_notify(struct net *net, struct nexthop *nh, in __nexthop_replace_notify()
2210 static void nexthop_replace_notify(struct net *net, struct nexthop *nh, in nexthop_replace_notify()
2221 static int replace_nexthop(struct net *net, struct nexthop *old, in replace_nexthop()
2222 struct nexthop *new, const struct nh_config *cfg, in replace_nexthop()
2281 static int insert_nexthop(struct net *net, struct nexthop *new_nh, in insert_nexthop()
2285 struct rb_root *root = &net->nexthop.rb_root; in insert_nexthop()
2294 struct nexthop *nh; in insert_nexthop()
2302 nh = rb_entry(parent, struct nexthop, rb_node); in insert_nexthop()
2359 rb_erase(&new_nh->rb_node, &net->nexthop.rb_root); in insert_nexthop()
2378 struct hlist_head *head = &net->nexthop.devhash[hash]; in nexthop_flush_dev()
2397 struct rb_root *root = &net->nexthop.rb_root; in flush_all_nexthops()
2399 struct nexthop *nh; in flush_all_nexthops()
2402 nh = rb_entry(node, struct nexthop, rb_node); in flush_all_nexthops()
2408 static struct nexthop *nexthop_create_group(struct net *net, in nexthop_create_group()
2415 struct nexthop *nh; in nexthop_create_group()
2444 struct nexthop *nhe; in nexthop_create_group()
2506 static int nh_create_ipv4(struct net *net, struct nexthop *nh, in nh_create_ipv4()
2545 static int nh_create_ipv6(struct net *net, struct nexthop *nh, in nh_create_ipv6()
2580 static struct nexthop *nexthop_create(struct net *net, struct nh_config *cfg, in nexthop_create()
2584 struct nexthop *nh; in nexthop_create()
2637 static struct nexthop *nexthop_add(struct net *net, struct nh_config *cfg, in nexthop_add()
2640 struct nexthop *nh; in nexthop_add()
2933 struct nexthop *nh; in rtm_new_nexthop()
2996 struct nexthop *nh; in rtm_del_nexthop()
3019 struct nexthop *nh; in rtm_get_nexthop()
3061 static bool nh_dump_filtered(struct nexthop *nh, in nh_dump_filtered()
3168 struct nexthop *nh, void *data), in rtm_dump_walk_nexthops()
3177 struct nexthop *nh; in rtm_dump_walk_nexthops()
3179 nh = rb_entry(node, struct nexthop, rb_node); in rtm_dump_walk_nexthops()
3194 struct nexthop *nh, void *data) in rtm_dump_nexthop_cb()
3212 struct rb_root *root = &net->nexthop.rb_root; in rtm_dump_nexthop()
3231 cb->seq = net->nexthop.seq; in rtm_dump_nexthop()
3236 static struct nexthop *
3241 struct nexthop *nh; in nexthop_find_group_resilient()
3340 struct nexthop *nh, in rtm_dump_nexthop_bucket_nh()
3393 struct nexthop *nh, void *data) in rtm_dump_nexthop_bucket_cb()
3415 struct nexthop *nh; in rtm_dump_nexthop_bucket()
3429 struct rb_root *root = &net->nexthop.rb_root; in rtm_dump_nexthop_bucket()
3444 cb->seq = net->nexthop.seq; in rtm_dump_nexthop_bucket()
3508 struct nexthop *nh; in rtm_get_nexthop_bucket()
3552 struct hlist_head *head = &net->nexthop.devhash[hash]; in nexthop_sync_mtu()
3598 struct rb_root *root = &net->nexthop.rb_root; in nexthops_dump()
3603 struct nexthop *nh; in nexthops_dump()
3605 nh = rb_entry(node, struct nexthop, rb_node); in nexthops_dump()
3623 err = blocking_notifier_chain_register(&net->nexthop.notifier_chain, in register_nexthop_notifier()
3636 err = blocking_notifier_chain_unregister(&net->nexthop.notifier_chain, in unregister_nexthop_notifier()
3649 struct nexthop *nexthop; in nexthop_set_hw_flags() local
3653 nexthop = nexthop_find_by_id(net, id); in nexthop_set_hw_flags()
3654 if (!nexthop) in nexthop_set_hw_flags()
3657 nexthop->nh_flags &= ~(RTNH_F_OFFLOAD | RTNH_F_TRAP); in nexthop_set_hw_flags()
3659 nexthop->nh_flags |= RTNH_F_OFFLOAD; in nexthop_set_hw_flags()
3661 nexthop->nh_flags |= RTNH_F_TRAP; in nexthop_set_hw_flags()
3673 struct nexthop *nexthop; in nexthop_bucket_set_hw_flags() local
3678 nexthop = nexthop_find_by_id(net, id); in nexthop_bucket_set_hw_flags()
3679 if (!nexthop || !nexthop->is_group) in nexthop_bucket_set_hw_flags()
3682 nhg = rcu_dereference(nexthop->nh_grp); in nexthop_bucket_set_hw_flags()
3706 struct nexthop *nexthop; in nexthop_res_grp_activity_update() local
3712 nexthop = nexthop_find_by_id(net, id); in nexthop_res_grp_activity_update()
3713 if (!nexthop || !nexthop->is_group) in nexthop_res_grp_activity_update()
3716 nhg = rcu_dereference(nexthop->nh_grp); in nexthop_res_grp_activity_update()
3742 kfree(net->nexthop.devhash); in nexthop_net_exit()
3749 net->nexthop.rb_root = RB_ROOT; in nexthop_net_init()
3750 net->nexthop.devhash = kzalloc(sz, GFP_KERNEL); in nexthop_net_init()
3751 if (!net->nexthop.devhash) in nexthop_net_init()
3753 BLOCKING_INIT_NOTIFIER_HEAD(&net->nexthop.notifier_chain); in nexthop_net_init()