Lines Matching refs:nexthop

23 static void remove_nexthop(struct net *net, struct nexthop *nh,
81 return !net->nexthop.notifier_chain.head; in nexthop_notifiers_is_empty()
101 const struct nexthop *nh) in nh_notifier_single_info_init()
181 const struct nexthop *nh) in nh_notifier_grp_info_init()
193 const struct nexthop *nh) in nh_notifier_grp_info_fini()
204 const struct nexthop *nh) in nh_notifier_info_init()
215 const struct nexthop *nh) in nh_notifier_info_fini()
225 struct nexthop *nh, in call_nexthop_notifiers()
245 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in call_nexthop_notifiers()
258 struct nexthop *nh; in nh_notifier_res_bucket_idle_timer_get()
346 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in __call_nexthop_res_bucket_notifiers()
379 struct nexthop *old_nh, in call_nexthop_res_bucket_notifiers()
380 struct nexthop *new_nh, in call_nexthop_res_bucket_notifiers()
390 static int call_nexthop_res_table_notifiers(struct net *net, struct nexthop *nh, in call_nexthop_res_table_notifiers()
416 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in call_nexthop_res_table_notifiers()
426 struct nexthop *nh, in call_nexthop_notifier()
463 head = &net->nexthop.devhash[hash]; in nexthop_devhash_add()
467 static void nexthop_free_group(struct nexthop *nh) in nexthop_free_group()
489 static void nexthop_free_single(struct nexthop *nh) in nexthop_free_single()
507 struct nexthop *nh = container_of(head, struct nexthop, rcu); in nexthop_free_rcu()
518 static struct nexthop *nexthop_alloc(void) in nexthop_alloc()
520 struct nexthop *nh; in nexthop_alloc()
522 nh = kzalloc(sizeof(struct nexthop), GFP_KERNEL); in nexthop_alloc()
569 while (++net->nexthop.seq == 0) in nh_base_seq_inc()
574 struct nexthop *nexthop_find_by_id(struct net *net, u32 id) in nexthop_find_by_id()
578 pp = &net->nexthop.rb_root.rb_node; in nexthop_find_by_id()
580 struct nexthop *nh; in nexthop_find_by_id()
587 nh = rb_entry(parent, struct nexthop, rb_node); in nexthop_find_by_id()
602 u32 id_start = net->nexthop.last_id_allocated; in nh_find_unused_id()
605 net->nexthop.last_id_allocated++; in nh_find_unused_id()
606 if (net->nexthop.last_id_allocated == id_start) in nh_find_unused_id()
609 if (!nexthop_find_by_id(net, net->nexthop.last_id_allocated)) in nh_find_unused_id()
610 return net->nexthop.last_id_allocated; in nh_find_unused_id()
693 static int nh_fill_node(struct sk_buff *skb, struct nexthop *nh, in nh_fill_node()
783 static size_t nh_nlmsg_size_grp(struct nexthop *nh) in nh_nlmsg_size_grp()
796 static size_t nh_nlmsg_size_single(struct nexthop *nh) in nh_nlmsg_size_single()
827 static size_t nh_nlmsg_size(struct nexthop *nh) in nh_nlmsg_size()
841 static void nexthop_notify(int event, struct nexthop *nh, struct nl_info *info) in nexthop_notify()
914 static int nh_fill_res_bucket(struct sk_buff *skb, struct nexthop *nh, in nh_fill_res_bucket()
966 struct nexthop *nh = nhge->nh_parent; in nexthop_bucket_notify()
989 static bool valid_group_nh(struct nexthop *nh, unsigned int npaths, in valid_group_nh()
1021 static int nh_check_attr_fdb_group(struct nexthop *nh, u8 *nh_family, in nh_check_attr_fdb_group()
1084 struct nexthop *nh; in nh_check_attr_group()
1155 static struct nexthop *nexthop_select_path_hthr(struct nh_group *nhg, int hash) in nexthop_select_path_hthr()
1157 struct nexthop *rc = NULL; in nexthop_select_path_hthr()
1192 static struct nexthop *nexthop_select_path_res(struct nh_group *nhg, int hash) in nexthop_select_path_res()
1208 struct nexthop *nexthop_select_path(struct nexthop *nh, int hash) in nexthop_select_path()
1226 int nexthop_for_each_fib6_nh(struct nexthop *nh, in nexthop_for_each_fib6_nh()
1267 int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg, in fib6_check_nexthop()
1311 static int fib6_check_nh_list(struct nexthop *old, struct nexthop *new, in fib6_check_nh_list()
1348 int fib_check_nexthop(struct nexthop *nh, u8 scope, in fib_check_nexthop()
1387 static int fib_check_nh_list(struct nexthop *old, struct nexthop *new, in fib_check_nh_list()
1737 struct nexthop *nhp = nhge->nh_parent; in remove_nh_grp_entry()
1739 struct nexthop *nh = nhge->nh; in remove_nh_grp_entry()
1809 static void remove_nexthop_from_groups(struct net *net, struct nexthop *nh, in remove_nexthop_from_groups()
1821 static void remove_nexthop_group(struct nexthop *nh, struct nl_info *nlinfo) in remove_nexthop_group()
1843 static void __remove_nexthop_fib(struct net *net, struct nexthop *nh) in __remove_nexthop_fib()
1865 static void __remove_nexthop(struct net *net, struct nexthop *nh, in __remove_nexthop()
1883 static void remove_nexthop(struct net *net, struct nexthop *nh, in remove_nexthop()
1889 rb_erase(&nh->rb_node, &net->nexthop.rb_root); in remove_nexthop()
1903 static void nh_rt_cache_flush(struct net *net, struct nexthop *nh, in nh_rt_cache_flush()
1904 struct nexthop *replaced_nh) in nh_rt_cache_flush()
1932 static int replace_nexthop_grp(struct net *net, struct nexthop *old, in replace_nexthop_grp()
1933 struct nexthop *new, const struct nh_config *cfg, in replace_nexthop_grp()
2038 struct nexthop *old, in replace_nexthop_single_notify_res()
2079 struct nexthop *group_nh, in replace_nexthop_single_notify()
2080 struct nexthop *old, in replace_nexthop_single_notify()
2101 static int replace_nexthop_single(struct net *net, struct nexthop *old, in replace_nexthop_single()
2102 struct nexthop *new, in replace_nexthop_single()
2141 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
2154 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
2172 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
2180 static void __nexthop_replace_notify(struct net *net, struct nexthop *nh, in __nexthop_replace_notify()
2209 static void nexthop_replace_notify(struct net *net, struct nexthop *nh, in nexthop_replace_notify()
2220 static int replace_nexthop(struct net *net, struct nexthop *old, in replace_nexthop()
2221 struct nexthop *new, const struct nh_config *cfg, in replace_nexthop()
2280 static int insert_nexthop(struct net *net, struct nexthop *new_nh, in insert_nexthop()
2284 struct rb_root *root = &net->nexthop.rb_root; in insert_nexthop()
2293 struct nexthop *nh; in insert_nexthop()
2301 nh = rb_entry(parent, struct nexthop, rb_node); in insert_nexthop()
2358 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()
3744 kfree(net->nexthop.devhash); in nexthop_net_exit_batch()
3753 net->nexthop.rb_root = RB_ROOT; in nexthop_net_init()
3754 net->nexthop.devhash = kzalloc(sz, GFP_KERNEL); in nexthop_net_init()
3755 if (!net->nexthop.devhash) in nexthop_net_init()
3757 BLOCKING_INIT_NOTIFIER_HEAD(&net->nexthop.notifier_chain); in nexthop_net_init()