Lines Matching refs:nexthop
19 static void remove_nexthop(struct net *net, struct nexthop *nh,
41 struct nexthop *nh) in call_nexthop_notifiers()
45 err = blocking_notifier_call_chain(&net->nexthop.notifier_chain, in call_nexthop_notifiers()
68 head = &net->nexthop.devhash[hash]; in nexthop_devhash_add()
72 static void nexthop_free_mpath(struct nexthop *nh) in nexthop_free_mpath()
91 static void nexthop_free_single(struct nexthop *nh) in nexthop_free_single()
109 struct nexthop *nh = container_of(head, struct nexthop, rcu); in nexthop_free_rcu()
120 static struct nexthop *nexthop_alloc(void) in nexthop_alloc()
122 struct nexthop *nh; in nexthop_alloc()
124 nh = kzalloc(sizeof(struct nexthop), GFP_KERNEL); in nexthop_alloc()
147 while (++net->nexthop.seq == 0) in nh_base_seq_inc()
152 struct nexthop *nexthop_find_by_id(struct net *net, u32 id) in nexthop_find_by_id()
156 pp = &net->nexthop.rb_root.rb_node; in nexthop_find_by_id()
158 struct nexthop *nh; in nexthop_find_by_id()
165 nh = rb_entry(parent, struct nexthop, rb_node); in nexthop_find_by_id()
180 u32 id_start = net->nexthop.last_id_allocated; in nh_find_unused_id()
183 net->nexthop.last_id_allocated++; in nh_find_unused_id()
184 if (net->nexthop.last_id_allocated == id_start) in nh_find_unused_id()
187 if (!nexthop_find_by_id(net, net->nexthop.last_id_allocated)) in nh_find_unused_id()
188 return net->nexthop.last_id_allocated; in nh_find_unused_id()
224 static int nh_fill_node(struct sk_buff *skb, struct nexthop *nh, in nh_fill_node()
305 static size_t nh_nlmsg_size_grp(struct nexthop *nh) in nh_nlmsg_size_grp()
314 static size_t nh_nlmsg_size_single(struct nexthop *nh) in nh_nlmsg_size_single()
345 static size_t nh_nlmsg_size(struct nexthop *nh) in nh_nlmsg_size()
359 static void nexthop_notify(int event, struct nexthop *nh, struct nl_info *info) in nexthop_notify()
386 static bool valid_group_nh(struct nexthop *nh, unsigned int npaths, in valid_group_nh()
415 static int nh_check_attr_fdb_group(struct nexthop *nh, u8 *nh_family, in nh_check_attr_fdb_group()
477 struct nexthop *nh; in nh_check_attr_group()
542 struct nexthop *nexthop_select_path(struct nexthop *nh, int hash) in nexthop_select_path()
544 struct nexthop *rc = NULL; in nexthop_select_path()
585 int nexthop_for_each_fib6_nh(struct nexthop *nh, in nexthop_for_each_fib6_nh()
626 int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg, in fib6_check_nexthop()
670 static int fib6_check_nh_list(struct nexthop *old, struct nexthop *new, in fib6_check_nh_list()
707 int fib_check_nexthop(struct nexthop *nh, u8 scope, in fib_check_nexthop()
746 static int fib_check_nh_list(struct nexthop *old, struct nexthop *new, in fib_check_nh_list()
784 struct nexthop *nhp = nhge->nh_parent; in remove_nh_grp_entry()
785 struct nexthop *nh = nhge->nh; in remove_nh_grp_entry()
839 static void remove_nexthop_from_groups(struct net *net, struct nexthop *nh, in remove_nexthop_from_groups()
851 static void remove_nexthop_group(struct nexthop *nh, struct nl_info *nlinfo) in remove_nexthop_group()
867 static void __remove_nexthop_fib(struct net *net, struct nexthop *nh) in __remove_nexthop_fib()
889 static void __remove_nexthop(struct net *net, struct nexthop *nh, in __remove_nexthop()
907 static void remove_nexthop(struct net *net, struct nexthop *nh, in remove_nexthop()
913 rb_erase(&nh->rb_node, &net->nexthop.rb_root); in remove_nexthop()
927 static void nh_rt_cache_flush(struct net *net, struct nexthop *nh) in nh_rt_cache_flush()
938 static int replace_nexthop_grp(struct net *net, struct nexthop *old, in replace_nexthop_grp()
939 struct nexthop *new, in replace_nexthop_grp()
984 static int replace_nexthop_single(struct net *net, struct nexthop *old, in replace_nexthop_single()
985 struct nexthop *new, in replace_nexthop_single()
1014 struct nexthop *nhp = nhge->nh_parent; in replace_nexthop_single()
1025 static void __nexthop_replace_notify(struct net *net, struct nexthop *nh, in __nexthop_replace_notify()
1054 static void nexthop_replace_notify(struct net *net, struct nexthop *nh, in nexthop_replace_notify()
1065 static int replace_nexthop(struct net *net, struct nexthop *old, in replace_nexthop()
1066 struct nexthop *new, struct netlink_ext_ack *extack) in replace_nexthop()
1124 static int insert_nexthop(struct net *net, struct nexthop *new_nh, in insert_nexthop()
1128 struct rb_root *root = &net->nexthop.rb_root; in insert_nexthop()
1137 struct nexthop *nh; in insert_nexthop()
1145 nh = rb_entry(parent, struct nexthop, rb_node); in insert_nexthop()
1189 struct hlist_head *head = &net->nexthop.devhash[hash]; in nexthop_flush_dev()
1204 struct rb_root *root = &net->nexthop.rb_root; in flush_all_nexthops()
1206 struct nexthop *nh; in flush_all_nexthops()
1209 nh = rb_entry(node, struct nexthop, rb_node); in flush_all_nexthops()
1215 static struct nexthop *nexthop_create_group(struct net *net, in nexthop_create_group()
1222 struct nexthop *nh; in nexthop_create_group()
1250 struct nexthop *nhe; in nexthop_create_group()
1290 static int nh_create_ipv4(struct net *net, struct nexthop *nh, in nh_create_ipv4()
1328 static int nh_create_ipv6(struct net *net, struct nexthop *nh, in nh_create_ipv6()
1358 static struct nexthop *nexthop_create(struct net *net, struct nh_config *cfg, in nexthop_create()
1362 struct nexthop *nh; in nexthop_create()
1415 static struct nexthop *nexthop_add(struct net *net, struct nh_config *cfg, in nexthop_add()
1418 struct nexthop *nh; in nexthop_add()
1644 struct nexthop *nh; in rtm_new_nexthop()
1712 struct nexthop *nh; in rtm_del_nexthop()
1735 struct nexthop *nh; in rtm_get_nexthop()
1768 static bool nh_dump_filtered(struct nexthop *nh, int dev_idx, int master_idx, in nh_dump_filtered()
1869 struct rb_root *root = &net->nexthop.rb_root; in rtm_dump_nexthop()
1881 struct nexthop *nh; in rtm_dump_nexthop()
1886 nh = rb_entry(node, struct nexthop, rb_node); in rtm_dump_nexthop()
1908 cb->seq = net->nexthop.seq; in rtm_dump_nexthop()
1918 struct hlist_head *head = &net->nexthop.devhash[hash]; in nexthop_sync_mtu()
1962 return blocking_notifier_chain_register(&net->nexthop.notifier_chain, in register_nexthop_notifier()
1969 return blocking_notifier_chain_unregister(&net->nexthop.notifier_chain, in unregister_nexthop_notifier()
1979 kfree(net->nexthop.devhash); in nexthop_net_exit()
1986 net->nexthop.rb_root = RB_ROOT; in nexthop_net_init()
1987 net->nexthop.devhash = kzalloc(sz, GFP_KERNEL); in nexthop_net_init()
1988 if (!net->nexthop.devhash) in nexthop_net_init()
1990 BLOCKING_INIT_NOTIFIER_HEAD(&net->nexthop.notifier_chain); in nexthop_net_init()