Lines Matching full:router

520 	u16 id; /* virtual router ID */
540 lpm_tree = mlxsw_sp->router->lpm.proto_trees[proto]; in mlxsw_sp_fib_create()
580 for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { in mlxsw_sp_lpm_tree_find_unused()
581 lpm_tree = &mlxsw_sp->router->lpm.trees[i]; in mlxsw_sp_lpm_tree_find_unused()
680 for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { in mlxsw_sp_lpm_tree_get()
681 lpm_tree = &mlxsw_sp->router->lpm.trees[i]; in mlxsw_sp_lpm_tree_get()
719 mlxsw_sp->router->lpm.tree_count = max_trees - MLXSW_SP_LPM_TREE_MIN; in mlxsw_sp_lpm_init()
720 mlxsw_sp->router->lpm.trees = kcalloc(mlxsw_sp->router->lpm.tree_count, in mlxsw_sp_lpm_init()
723 if (!mlxsw_sp->router->lpm.trees) in mlxsw_sp_lpm_init()
726 for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { in mlxsw_sp_lpm_init()
727 lpm_tree = &mlxsw_sp->router->lpm.trees[i]; in mlxsw_sp_lpm_init()
737 mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4] = lpm_tree; in mlxsw_sp_lpm_init()
745 mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV6] = lpm_tree; in mlxsw_sp_lpm_init()
750 lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4]; in mlxsw_sp_lpm_init()
753 kfree(mlxsw_sp->router->lpm.trees); in mlxsw_sp_lpm_init()
761 lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV6]; in mlxsw_sp_lpm_fini()
764 lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4]; in mlxsw_sp_lpm_fini()
767 kfree(mlxsw_sp->router->lpm.trees); in mlxsw_sp_lpm_fini()
784 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vr_find_unused()
831 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vr_find()
844 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_tb_id_vr_id()
852 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_tb_id_vr_id()
999 old_tree = mlxsw_sp->router->lpm.proto_trees[proto]; in mlxsw_sp_vrs_lpm_tree_replace()
1003 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vrs_lpm_tree_replace()
1015 mlxsw_sp->router->lpm.proto_trees[proto] = new_tree; in mlxsw_sp_vrs_lpm_tree_replace()
1041 mlxsw_sp->router->vrs = kcalloc(max_vrs, sizeof(struct mlxsw_sp_vr), in mlxsw_sp_vrs_init()
1043 if (!mlxsw_sp->router->vrs) in mlxsw_sp_vrs_init()
1047 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vrs_init()
1067 kfree(mlxsw_sp->router->vrs); in mlxsw_sp_vrs_fini()
1115 static int mlxsw_sp_crif_insert(struct mlxsw_sp_router *router, in mlxsw_sp_crif_insert() argument
1118 return rhashtable_insert_fast(&router->crif_ht, &crif->ht_node, in mlxsw_sp_crif_insert()
1122 static void mlxsw_sp_crif_remove(struct mlxsw_sp_router *router, in mlxsw_sp_crif_remove() argument
1125 rhashtable_remove_fast(&router->crif_ht, &crif->ht_node, in mlxsw_sp_crif_remove()
1130 mlxsw_sp_crif_lookup(struct mlxsw_sp_router *router, in mlxsw_sp_crif_lookup() argument
1137 return rhashtable_lookup_fast(&router->crif_ht, &key, in mlxsw_sp_crif_lookup()
1156 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_ol_ipip_lb_create()
1180 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_entry_alloc()
1215 mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_ipip_entry_dealloc()
1233 if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto) in mlxsw_sp_ipip_entry_saddr_matches()
1246 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_decap_parsing_depth_inc()
1261 mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_decap_parsing_depth_dec()
1402 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_ipip_entry_find_decap()
1451 &mlxsw_sp->router->ipip_list); in mlxsw_sp_ipip_entry_create()
1474 if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto) in mlxsw_sp_ipip_entry_matches_decap()
1496 list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_decap()
1516 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_netdev_ipip_type() local
1521 ipip_ops = router->ipip_ops_arr[ipipt]; in mlxsw_sp_netdev_ipip_type()
1543 list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_ol_dev()
1558 ipip_entry = list_prepare_entry(start, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_ul_dev()
1560 list_for_each_entry_continue(ipip_entry, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_ul_dev()
1587 = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_netdevice_ipip_can_offload()
1604 ul_proto = mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto; in mlxsw_sp_netdevice_ipip_ol_reg_event()
1849 ul_proto = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]->ul_proto; in mlxsw_sp_netdevice_ipip_ul_vrf_event()
1908 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_netdevice_ipip_ol_change_event()
1938 list_for_each_entry_safe(ipip_entry, tmp, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_demote_tunnel_by_saddr()
1956 list_for_each_entry_safe(ipip_entry, tmp, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_demote_tunnel_by_ul_netdev()
2071 &mlxsw_sp->router->ipip_list)) in mlxsw_sp_netdevice_ipip_ul_event()
2093 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_nve_promote_decap() local
2097 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_promote_decap()
2099 if (WARN_ON_ONCE(router->nve_decap_config.valid)) { in mlxsw_sp_router_nve_promote_decap()
2104 router->nve_decap_config.ul_tb_id = ul_tb_id; in mlxsw_sp_router_nve_promote_decap()
2105 router->nve_decap_config.tunnel_index = tunnel_index; in mlxsw_sp_router_nve_promote_decap()
2106 router->nve_decap_config.ul_proto = ul_proto; in mlxsw_sp_router_nve_promote_decap()
2107 router->nve_decap_config.ul_sip = *ul_sip; in mlxsw_sp_router_nve_promote_decap()
2108 router->nve_decap_config.valid = true; in mlxsw_sp_router_nve_promote_decap()
2132 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_promote_decap()
2141 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_nve_demote_decap() local
2144 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_demote_decap()
2146 if (WARN_ON_ONCE(!router->nve_decap_config.valid)) in mlxsw_sp_router_nve_demote_decap()
2149 router->nve_decap_config.valid = false; in mlxsw_sp_router_nve_demote_decap()
2160 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_demote_decap()
2168 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_nve_is_decap() local
2170 return router->nve_decap_config.valid && in mlxsw_sp_router_nve_is_decap()
2171 router->nve_decap_config.ul_tb_id == ul_tb_id && in mlxsw_sp_router_nve_is_decap()
2172 router->nve_decap_config.ul_proto == ul_proto && in mlxsw_sp_router_nve_is_decap()
2173 !memcmp(&router->nve_decap_config.ul_sip, ul_sip, in mlxsw_sp_router_nve_is_decap()
2284 return rhashtable_insert_fast(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_entry_insert()
2293 rhashtable_remove_fast(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_entry_remove()
2365 atomic_inc(&mlxsw_sp->router->neighs_update.neigh_count); in mlxsw_sp_neigh_entry_create()
2380 atomic_dec(&mlxsw_sp->router->neighs_update.neigh_count); in mlxsw_sp_neigh_entry_destroy()
2392 return rhashtable_lookup_fast(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_entry_lookup()
2408 mlxsw_sp->router->neighs_update.interval = jiffies_to_msecs(interval); in mlxsw_sp_router_neighs_update_interval_init()
2426 if (!mlxsw_sp->router->rifs[rif]) { in mlxsw_sp_router_neigh_ent_ipv4_process()
2432 dev = mlxsw_sp_rif_dev(mlxsw_sp->router->rifs[rif]); in mlxsw_sp_router_neigh_ent_ipv4_process()
2455 if (!mlxsw_sp->router->rifs[rif]) { in mlxsw_sp_router_neigh_ent_ipv6_process()
2460 dev = mlxsw_sp_rif_dev(mlxsw_sp->router->rifs[rif]); in mlxsw_sp_router_neigh_ent_ipv6_process()
2553 mutex_lock(&mlxsw_sp->router->lock); in __mlxsw_sp_router_neighs_update_rauhtd()
2567 mutex_unlock(&mlxsw_sp->router->lock); in __mlxsw_sp_router_neighs_update_rauhtd()
2578 if (!atomic_read(&mlxsw_sp->router->neighs_update.neigh_count)) in mlxsw_sp_router_neighs_update_rauhtd()
2601 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neighs_update_nh()
2602 list_for_each_entry(neigh_entry, &mlxsw_sp->router->nexthop_neighs_list, in mlxsw_sp_router_neighs_update_nh()
2608 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neighs_update_nh()
2614 unsigned long interval = mlxsw_sp->router->neighs_update.interval; in mlxsw_sp_router_neighs_update_work_schedule()
2616 mlxsw_core_schedule_dw(&mlxsw_sp->router->neighs_update.dw, in mlxsw_sp_router_neighs_update_work_schedule()
2622 struct mlxsw_sp_router *router; in mlxsw_sp_router_neighs_update_work() local
2625 router = container_of(work, struct mlxsw_sp_router, in mlxsw_sp_router_neighs_update_work()
2627 err = mlxsw_sp_router_neighs_update_rauhtd(router->mlxsw_sp); in mlxsw_sp_router_neighs_update_work()
2629 dev_err(router->mlxsw_sp->bus_info->dev, "Could not update kernel for neigh activity"); in mlxsw_sp_router_neighs_update_work()
2631 mlxsw_sp_router_neighs_update_nh(router->mlxsw_sp); in mlxsw_sp_router_neighs_update_work()
2633 mlxsw_sp_router_neighs_update_work_schedule(router->mlxsw_sp); in mlxsw_sp_router_neighs_update_work()
2639 struct mlxsw_sp_router *router; in mlxsw_sp_router_probe_unresolved_nexthops() local
2641 router = container_of(work, struct mlxsw_sp_router, in mlxsw_sp_router_probe_unresolved_nexthops()
2649 mutex_lock(&router->lock); in mlxsw_sp_router_probe_unresolved_nexthops()
2650 list_for_each_entry(neigh_entry, &router->nexthop_neighs_list, in mlxsw_sp_router_probe_unresolved_nexthops()
2654 mutex_unlock(&router->lock); in mlxsw_sp_router_probe_unresolved_nexthops()
2656 mlxsw_core_schedule_dw(&router->nexthop_probe_dw, in mlxsw_sp_router_probe_unresolved_nexthops()
2792 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neigh_event_work()
2818 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neigh_event_work()
2848 struct mlxsw_sp_router *router, in mlxsw_sp_router_schedule_work() argument
2854 if (!net_eq(net, mlxsw_sp_net(router->mlxsw_sp))) in mlxsw_sp_router_schedule_work()
2862 net_work->mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_router_schedule_work()
2878 static int mlxsw_sp_router_schedule_neigh_work(struct mlxsw_sp_router *router, in mlxsw_sp_router_schedule_neigh_work() argument
2889 return mlxsw_sp_router_schedule_work(net, router, n, in mlxsw_sp_router_schedule_neigh_work()
2896 struct mlxsw_sp_router *router; in mlxsw_sp_router_netevent_event() local
2901 router = container_of(nb, struct mlxsw_sp_router, netevent_nb); in mlxsw_sp_router_netevent_event()
2919 router->neighs_update.interval = interval; in mlxsw_sp_router_netevent_event()
2930 return mlxsw_sp_router_schedule_neigh_work(router, n); in mlxsw_sp_router_netevent_event()
2934 return mlxsw_sp_router_schedule_work(ptr, router, NULL, in mlxsw_sp_router_netevent_event()
2938 return mlxsw_sp_router_schedule_work(ptr, router, NULL, in mlxsw_sp_router_netevent_event()
2949 err = rhashtable_init(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_init()
2960 INIT_DELAYED_WORK(&mlxsw_sp->router->neighs_update.dw, in mlxsw_sp_neigh_init()
2962 INIT_DELAYED_WORK(&mlxsw_sp->router->nexthop_probe_dw, in mlxsw_sp_neigh_init()
2964 atomic_set(&mlxsw_sp->router->neighs_update.neigh_count, 0); in mlxsw_sp_neigh_init()
2965 mlxsw_core_schedule_dw(&mlxsw_sp->router->neighs_update.dw, 0); in mlxsw_sp_neigh_init()
2966 mlxsw_core_schedule_dw(&mlxsw_sp->router->nexthop_probe_dw, 0); in mlxsw_sp_neigh_init()
2972 cancel_delayed_work_sync(&mlxsw_sp->router->neighs_update.dw); in mlxsw_sp_neigh_fini()
2973 cancel_delayed_work_sync(&mlxsw_sp->router->nexthop_probe_dw); in mlxsw_sp_neigh_fini()
2974 rhashtable_destroy(&mlxsw_sp->router->neigh_ht); in mlxsw_sp_neigh_fini()
3004 rc = mlxsw_sp_router_schedule_neigh_work(rms->mlxsw_sp->router, n); in mlxsw_sp_neigh_rif_made_sync_each()
3300 struct mlxsw_sp_nexthop *mlxsw_sp_nexthop_next(struct mlxsw_sp_router *router, in mlxsw_sp_nexthop_next() argument
3304 if (list_empty(&router->nexthop_list)) in mlxsw_sp_nexthop_next()
3307 return list_first_entry(&router->nexthop_list, in mlxsw_sp_nexthop_next()
3310 if (list_is_last(&nh->router_list_node, &router->nexthop_list)) in mlxsw_sp_nexthop_next()
3619 return rhashtable_insert_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop_group_insert()
3631 rhashtable_remove_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop_group_remove()
3644 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop4_group_lookup()
3657 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop6_group_lookup()
3671 return rhashtable_insert_fast(&mlxsw_sp->router->nexthop_ht, in mlxsw_sp_nexthop_insert()
3678 rhashtable_remove_fast(&mlxsw_sp->router->nexthop_ht, &nh->ht_node, in mlxsw_sp_nexthop_remove()
3686 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_ht, &key, in mlxsw_sp_nexthop_lookup()
3748 mlxsw_sp->router->lb_crif->rif->rif_index; in __mlxsw_sp_nexthop_eth_update()
3804 ipip_ops = mlxsw_sp->router->ipip_ops_arr[nh->ipip_entry->ipipt]; in __mlxsw_sp_nexthop_ipip_update()
3929 for (i = 0; i < mlxsw_sp->router->adj_grp_size_ranges_count; i++) { in mlxsw_sp_adj_grp_size_round_up()
3932 size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; in mlxsw_sp_adj_grp_size_round_up()
3951 for (i = mlxsw_sp->router->adj_grp_size_ranges_count - 1; i >= 0; i--) { in mlxsw_sp_adj_grp_size_round_down()
3954 size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; in mlxsw_sp_adj_grp_size_round_down()
4433 &mlxsw_sp->router->nexthop_neighs_list); in mlxsw_sp_nexthop_neigh_init()
4499 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, ipip_entry->ol_dev); in mlxsw_sp_nexthop_ipip_init()
4543 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_nexthop_type_init()
4552 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, dev); in mlxsw_sp_nexthop_type_init()
4631 list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); in mlxsw_sp_nexthop4_init()
4765 &mlxsw_sp->router->adj_trap_index); in mlxsw_sp_adj_trap_entry_init()
4772 mlxsw_sp->router->adj_trap_index, in mlxsw_sp_adj_trap_entry_init()
4773 mlxsw_sp->router->lb_crif->rif->rif_index); in mlxsw_sp_adj_trap_entry_init()
4784 mlxsw_sp->router->adj_trap_index); in mlxsw_sp_adj_trap_entry_init()
4791 mlxsw_sp->router->adj_trap_index); in mlxsw_sp_adj_trap_entry_fini()
4798 if (refcount_inc_not_zero(&mlxsw_sp->router->num_groups)) in mlxsw_sp_nexthop_group_inc()
4805 refcount_set(&mlxsw_sp->router->num_groups, 1); in mlxsw_sp_nexthop_group_inc()
4812 if (!refcount_dec_and_test(&mlxsw_sp->router->num_groups)) in mlxsw_sp_nexthop_group_dec()
4870 mlxsw_core_schedule_dw(&mlxsw_sp->router->nh_grp_activity_dw, in mlxsw_sp_nh_grp_activity_work_schedule()
4877 struct mlxsw_sp_router *router; in mlxsw_sp_nh_grp_activity_work() local
4880 router = container_of(work, struct mlxsw_sp_router, in mlxsw_sp_nh_grp_activity_work()
4883 mutex_lock(&router->lock); in mlxsw_sp_nh_grp_activity_work()
4885 list_for_each_entry(nhgi, &router->nh_res_grp_list, list) { in mlxsw_sp_nh_grp_activity_work()
4886 mlxsw_sp_nh_grp_activity_update(router->mlxsw_sp, nhgi->nh_grp); in mlxsw_sp_nh_grp_activity_work()
4890 mutex_unlock(&router->lock); in mlxsw_sp_nh_grp_activity_work()
4894 mlxsw_sp_nh_grp_activity_work_schedule(router->mlxsw_sp); in mlxsw_sp_nh_grp_activity_work()
4977 for (i = 0; i < mlxsw_sp->router->adj_grp_size_ranges_count; i++) { in mlxsw_sp_nexthop_obj_res_group_size_validate()
4980 size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; in mlxsw_sp_nexthop_obj_res_group_size_validate()
5095 nh->crif = mlxsw_sp->router->lb_crif; in mlxsw_sp_nexthop_obj_blackhole_init()
5130 list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); in mlxsw_sp_nexthop_obj_init()
5249 if (list_empty(&mlxsw_sp->router->nh_res_grp_list)) in mlxsw_sp_nexthop_obj_group_info_init()
5251 list_add(&nhgi->list, &mlxsw_sp->router->nh_res_grp_list); in mlxsw_sp_nexthop_obj_group_info_init()
5274 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_nexthop_obj_group_info_fini() local
5279 if (list_empty(&mlxsw_sp->router->nh_res_grp_list)) in mlxsw_sp_nexthop_obj_group_info_fini()
5280 cancel_delayed_work(&router->nh_grp_activity_dw); in mlxsw_sp_nexthop_obj_group_info_fini()
5350 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop_obj_group_lookup()
5722 struct mlxsw_sp_router *router; in mlxsw_sp_nexthop_obj_event() local
5725 router = container_of(nb, struct mlxsw_sp_router, nexthop_nb); in mlxsw_sp_nexthop_obj_event()
5726 err = mlxsw_sp_nexthop_obj_validate(router->mlxsw_sp, event, info); in mlxsw_sp_nexthop_obj_event()
5730 mutex_lock(&router->lock); in mlxsw_sp_nexthop_obj_event()
5734 err = mlxsw_sp_nexthop_obj_res_group_pre(router->mlxsw_sp, in mlxsw_sp_nexthop_obj_event()
5738 err = mlxsw_sp_nexthop_obj_new(router->mlxsw_sp, info); in mlxsw_sp_nexthop_obj_event()
5741 mlxsw_sp_nexthop_obj_del(router->mlxsw_sp, info); in mlxsw_sp_nexthop_obj_event()
5744 err = mlxsw_sp_nexthop_obj_bucket_replace(router->mlxsw_sp, in mlxsw_sp_nexthop_obj_event()
5748 mlxsw_sp_nexthop_obj_hw_stats_get(router->mlxsw_sp, info); in mlxsw_sp_nexthop_obj_event()
5754 mutex_unlock(&router->lock); in mlxsw_sp_nexthop_obj_event()
6225 adjacency_index = mlxsw_sp->router->adj_trap_index; in mlxsw_sp_fib_entry_op_remote()
6316 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_fib_entry_op_ipip_decap()
6400 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_fib4_entry_type_set() local
6420 tunnel_index = router->nve_decap_config.tunnel_index; in mlxsw_sp_fib4_entry_type_set()
6625 lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; in mlxsw_sp_fib_lpm_tree_link()
6988 list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); in mlxsw_sp_nexthop6_init()
7307 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_fib6_entry_type_set_local() local
7325 tunnel_index = router->nve_decap_config.tunnel_index; in mlxsw_sp_fib6_entry_type_set_local()
7776 struct mlxsw_sp_vr *vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_router_fib_flush()
7785 /* If virtual router was only used for IPv4, then it's no in mlxsw_sp_router_fib_flush()
7869 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib4_event_work()
7894 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib4_event_work()
7906 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib6_event_work()
7941 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib6_event_work()
7954 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fibmr_event_work()
7983 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fibmr_event_work()
8108 struct mlxsw_sp_router *router; in mlxsw_sp_router_fib_event() local
8116 router = container_of(nb, struct mlxsw_sp_router, fib_nb); in mlxsw_sp_router_fib_event()
8122 router->mlxsw_sp); in mlxsw_sp_router_fib_event()
8142 fib_work->mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_router_fib_event()
8180 if (mlxsw_sp->router->rifs[i] && in mlxsw_sp_rif_find_by_dev()
8181 mlxsw_sp_rif_dev_is(mlxsw_sp->router->rifs[i], dev)) in mlxsw_sp_rif_find_by_dev()
8182 return mlxsw_sp->router->rifs[i]; in mlxsw_sp_rif_find_by_dev()
8192 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_exists()
8194 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_exists()
8204 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_vid()
8218 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_vid()
8350 *p_rif_index = gen_pool_alloc(mlxsw_sp->router->rifs_table, in mlxsw_sp_rif_index_alloc()
8365 gen_pool_free(mlxsw_sp->router->rifs_table, in mlxsw_sp_rif_index_free()
8407 return mlxsw_sp->router->rifs[rif_index]; in mlxsw_sp_rif_by_index()
8585 * acquire the router lock again. Just postpone the notification until in mlxsw_sp_router_hwstats_notify_schedule()
8642 ops = mlxsw_sp->router->rif_ops_arr[type]; in mlxsw_sp_rif_create()
8651 NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interfaces"); in mlxsw_sp_rif_create()
8655 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, params->dev); in mlxsw_sp_rif_create()
8667 mlxsw_sp->router->rifs[rif_index] = rif; in mlxsw_sp_rif_create()
8708 atomic_add(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_rif_create()
8722 mlxsw_sp->router->rifs[rif_index] = NULL; in mlxsw_sp_rif_create()
8746 atomic_sub(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_rif_destroy()
8748 vr = &mlxsw_sp->router->vrs[rif->vr_id]; in mlxsw_sp_rif_destroy()
8764 mlxsw_sp->router->rifs[rif->rif_index] = NULL; in mlxsw_sp_rif_destroy()
8780 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_destroy_by_dev()
8786 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_destroy_by_dev()
8803 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, upper_dev); in mlxsw_sp_rif_destroy_vlan_upper()
8828 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_bridge_vlan_add()
8889 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_bridge_vlan_add()
8959 u8 max_rif_mac_profiles = mlxsw_sp->router->max_rif_mac_profile; in mlxsw_sp_rif_mac_profile_index_alloc()
8960 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_rif_mac_profile_index_alloc() local
8963 id = idr_alloc(&router->rif_mac_profiles_idr, profile, 0, in mlxsw_sp_rif_mac_profile_index_alloc()
8973 "Exceeded number of supported router interface MAC profiles"); in mlxsw_sp_rif_mac_profile_index_alloc()
8983 profile = idr_remove(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_index_free()
9006 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_rif_mac_profile_find() local
9010 idr_for_each_entry(&router->rif_mac_profiles_idr, profile, id) { in mlxsw_sp_rif_mac_profile_find()
9023 return atomic_read(&mlxsw_sp->router->rif_mac_profiles_count); in mlxsw_sp_rif_mac_profiles_occ_get()
9030 return atomic_read(&mlxsw_sp->router->rifs_count); in mlxsw_sp_rifs_occ_get()
9048 atomic_inc(&mlxsw_sp->router->rif_mac_profiles_count); in mlxsw_sp_rif_mac_profile_create()
9061 atomic_dec(&mlxsw_sp->router->rif_mac_profiles_count); in mlxsw_sp_rif_mac_profile_destroy()
9092 profile = idr_find(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_put()
9108 profile = idr_find(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_is_shared()
9122 profile = idr_find(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_edit()
9232 lockdep_assert_held(&mlxsw_sp->router->lock); in mlxsw_sp_port_vlan_router_join_existing()
9246 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_port_vlan_router_leave()
9248 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_port_vlan_router_leave()
9500 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_macvlan_del()
9502 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_macvlan_del()
9550 struct mlxsw_sp_router *router; in mlxsw_sp_inetaddr_event() local
9558 router = container_of(nb, struct mlxsw_sp_router, inetaddr_nb); in mlxsw_sp_inetaddr_event()
9559 mutex_lock(&router->lock); in mlxsw_sp_inetaddr_event()
9560 rif = mlxsw_sp_rif_find_by_dev(router->mlxsw_sp, dev); in mlxsw_sp_inetaddr_event()
9564 err = __mlxsw_sp_inetaddr_event(router->mlxsw_sp, dev, event, false, in mlxsw_sp_inetaddr_event()
9567 mutex_unlock(&router->lock); in mlxsw_sp_inetaddr_event()
9584 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_inetaddr_valid_event()
9592 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_inetaddr_valid_event()
9614 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_event_work()
9622 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_event_work()
9635 struct mlxsw_sp_router *router; in mlxsw_sp_inet6addr_event() local
9645 router = container_of(nb, struct mlxsw_sp_router, inet6addr_nb); in mlxsw_sp_inet6addr_event()
9647 inet6addr_work->mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_inet6addr_event()
9669 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_valid_event()
9677 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_valid_event()
9738 vr = &mlxsw_sp->router->vrs[rif->vr_id]; in mlxsw_sp_router_port_change_event()
9776 max_rif_mac_profiles = mlxsw_sp->router->max_rif_mac_profile; in mlxsw_sp_router_port_pre_changeaddr_event()
9784 NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interface MAC profiles"); in mlxsw_sp_router_port_pre_changeaddr_event()
9810 mlxsw_sp_crif_register(struct mlxsw_sp_router *router, struct net_device *dev) in mlxsw_sp_crif_register() argument
9815 if (WARN_ON(mlxsw_sp_crif_lookup(router, dev))) in mlxsw_sp_crif_register()
9822 err = mlxsw_sp_crif_insert(router, crif); in mlxsw_sp_crif_register()
9833 static void mlxsw_sp_crif_unregister(struct mlxsw_sp_router *router, in mlxsw_sp_crif_unregister() argument
9838 mlxsw_sp_crif_remove(router, crif); in mlxsw_sp_crif_unregister()
9841 mlxsw_sp_nexthop_type_fini(router->mlxsw_sp, nh); in mlxsw_sp_crif_unregister()
9849 static int mlxsw_sp_netdevice_register(struct mlxsw_sp_router *router, in mlxsw_sp_netdevice_register() argument
9854 if (!mlxsw_sp_router_netdevice_interesting(router->mlxsw_sp, dev)) in mlxsw_sp_netdevice_register()
9857 crif = mlxsw_sp_crif_register(router, dev); in mlxsw_sp_netdevice_register()
9861 static void mlxsw_sp_netdevice_unregister(struct mlxsw_sp_router *router, in mlxsw_sp_netdevice_unregister() argument
9866 if (!mlxsw_sp_router_netdevice_interesting(router->mlxsw_sp, dev)) in mlxsw_sp_netdevice_unregister()
9875 crif = mlxsw_sp_crif_lookup(router, dev); in mlxsw_sp_netdevice_unregister()
9883 mlxsw_sp_crif_unregister(router, crif); in mlxsw_sp_netdevice_unregister()
9991 * destroy it and create a new one with the new virtual router ID. in mlxsw_sp_port_vrf_join()
10030 * direct more MAC addresses to the router. in mlxsw_sp_netdevice_vrf_event()
10071 crif = mlxsw_sp_crif_lookup(ctx->mlxsw_sp->router, dev); in mlxsw_sp_router_replay_inetaddr_up()
10100 crif = mlxsw_sp_crif_lookup(ctx->mlxsw_sp->router, dev); in mlxsw_sp_router_unreplay_inetaddr_up()
10265 mutex_lock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_join_lag()
10267 mutex_unlock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_join_lag()
10275 mutex_lock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_leave_lag()
10277 mutex_unlock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_leave_lag()
10284 struct mlxsw_sp_router *router; in mlxsw_sp_router_netdevice_event() local
10288 router = container_of(nb, struct mlxsw_sp_router, netdevice_nb); in mlxsw_sp_router_netdevice_event()
10289 mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_router_netdevice_event()
10291 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_netdevice_event()
10294 err = mlxsw_sp_netdevice_register(router, dev); in mlxsw_sp_router_netdevice_event()
10317 mlxsw_sp_netdevice_unregister(router, dev); in mlxsw_sp_router_netdevice_event()
10320 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_netdevice_event()
10850 ul_vr = &mlxsw_sp->router->vrs[lb_rif->ul_vr_id]; in mlxsw_sp1_rif_ipip_lb_deconfigure()
10898 NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interfaces"); in mlxsw_sp_ul_rif_create()
10909 mlxsw_sp->router->rifs[rif_index] = ul_rif; in mlxsw_sp_ul_rif_create()
10916 atomic_add(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_ul_rif_create()
10920 mlxsw_sp->router->rifs[rif_index] = NULL; in mlxsw_sp_ul_rif_create()
10933 atomic_sub(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_ul_rif_destroy()
10935 mlxsw_sp->router->rifs[ul_rif->rif_index] = NULL; in mlxsw_sp_ul_rif_destroy()
10976 vr = &mlxsw_sp->router->vrs[ul_rif->vr_id]; in mlxsw_sp_ul_rif_put()
10992 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_get()
11000 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_get()
11008 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_put()
11009 ul_rif = mlxsw_sp->router->rifs[ul_rif_index]; in mlxsw_sp_router_ul_rif_put()
11015 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_put()
11090 mlxsw_sp->router->rifs_table = rifs_table; in mlxsw_sp_rifs_table_init()
11101 gen_pool_destroy(mlxsw_sp->router->rifs_table); in mlxsw_sp_rifs_table_fini()
11113 mlxsw_sp->router->max_rif_mac_profile = in mlxsw_sp_rifs_init()
11116 mlxsw_sp->router->rifs = kcalloc(max_rifs, in mlxsw_sp_rifs_init()
11119 if (!mlxsw_sp->router->rifs) in mlxsw_sp_rifs_init()
11126 idr_init(&mlxsw_sp->router->rif_mac_profiles_idr); in mlxsw_sp_rifs_init()
11127 atomic_set(&mlxsw_sp->router->rif_mac_profiles_count, 0); in mlxsw_sp_rifs_init()
11128 atomic_set(&mlxsw_sp->router->rifs_count, 0); in mlxsw_sp_rifs_init()
11141 kfree(mlxsw_sp->router->rifs); in mlxsw_sp_rifs_init()
11151 WARN_ON_ONCE(atomic_read(&mlxsw_sp->router->rifs_count)); in mlxsw_sp_rifs_fini()
11153 WARN_ON_ONCE(mlxsw_sp->router->rifs[i]); in mlxsw_sp_rifs_fini()
11158 WARN_ON(!idr_is_empty(&mlxsw_sp->router->rif_mac_profiles_idr)); in mlxsw_sp_rifs_fini()
11159 idr_destroy(&mlxsw_sp->router->rif_mac_profiles_idr); in mlxsw_sp_rifs_fini()
11161 kfree(mlxsw_sp->router->rifs); in mlxsw_sp_rifs_fini()
11177 INIT_LIST_HEAD(&mlxsw_sp->router->ipip_list); in mlxsw_sp_ipips_init()
11191 mlxsw_sp->router->ipip_ops_arr = mlxsw_sp1_ipip_ops_arr; in mlxsw_sp1_ipips_init()
11197 mlxsw_sp->router->ipip_ops_arr = mlxsw_sp2_ipip_ops_arr; in mlxsw_sp2_ipips_init()
11203 WARN_ON(!list_empty(&mlxsw_sp->router->ipip_list)); in mlxsw_sp_ipips_fini()
11208 struct mlxsw_sp_router *router; in mlxsw_sp_router_fib_dump_flush() local
11215 router = container_of(nb, struct mlxsw_sp_router, fib_nb); in mlxsw_sp_router_fib_dump_flush()
11216 mlxsw_sp_router_fib_flush(router->mlxsw_sp); in mlxsw_sp_router_fib_dump_flush()
11437 mlxsw_sp->router->inc_parsing_depth = true; in mlxsw_sp_mp_hash_parsing_depth_adjust()
11440 mlxsw_sp->router->inc_parsing_depth = false; in mlxsw_sp_mp_hash_parsing_depth_adjust()
11464 old_inc_parsing_depth = mlxsw_sp->router->inc_parsing_depth; in mlxsw_sp_mp_hash_init()
11495 bool old_inc_parsing_depth = mlxsw_sp->router->inc_parsing_depth; in mlxsw_sp_mp_hash_fini()
11558 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_lb_rif_init() local
11562 router->lb_crif = mlxsw_sp_crif_alloc(NULL); in mlxsw_sp_lb_rif_init()
11563 if (!router->lb_crif) in mlxsw_sp_lb_rif_init()
11572 lb_rif = mlxsw_sp_ul_rif_get(mlxsw_sp, RT_TABLE_MAIN, router->lb_crif, in mlxsw_sp_lb_rif_init()
11582 mlxsw_sp_crif_free(router->lb_crif); in mlxsw_sp_lb_rif_init()
11588 mlxsw_sp_ul_rif_put(mlxsw_sp->router->lb_crif->rif); in mlxsw_sp_lb_rif_fini()
11589 mlxsw_sp_crif_free(mlxsw_sp->router->lb_crif); in mlxsw_sp_lb_rif_fini()
11596 mlxsw_sp->router->rif_ops_arr = mlxsw_sp1_rif_ops_arr; in mlxsw_sp1_router_init()
11597 mlxsw_sp->router->adj_grp_size_ranges = mlxsw_sp1_adj_grp_size_ranges; in mlxsw_sp1_router_init()
11598 mlxsw_sp->router->adj_grp_size_ranges_count = size_ranges_count; in mlxsw_sp1_router_init()
11612 mlxsw_sp->router->rif_ops_arr = mlxsw_sp2_rif_ops_arr; in mlxsw_sp2_router_init()
11613 mlxsw_sp->router->adj_grp_size_ranges = mlxsw_sp2_adj_grp_size_ranges; in mlxsw_sp2_router_init()
11614 mlxsw_sp->router->adj_grp_size_ranges_count = size_ranges_count; in mlxsw_sp2_router_init()
11627 struct mlxsw_sp_router *router; in mlxsw_sp_router_init() local
11631 router = kzalloc(sizeof(*mlxsw_sp->router), GFP_KERNEL); in mlxsw_sp_router_init()
11632 if (!router) in mlxsw_sp_router_init()
11634 mutex_init(&router->lock); in mlxsw_sp_router_init()
11635 mlxsw_sp->router = router; in mlxsw_sp_router_init()
11636 router->mlxsw_sp = mlxsw_sp; in mlxsw_sp_router_init()
11642 INIT_LIST_HEAD(&mlxsw_sp->router->nh_res_grp_list); in mlxsw_sp_router_init()
11643 INIT_DELAYED_WORK(&mlxsw_sp->router->nh_grp_activity_dw, in mlxsw_sp_router_init()
11645 INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_neighs_list); in mlxsw_sp_router_init()
11654 err = rhashtable_init(&mlxsw_sp->router->crif_ht, in mlxsw_sp_router_init()
11663 err = rhashtable_init(&mlxsw_sp->router->nexthop_ht, in mlxsw_sp_router_init()
11668 err = rhashtable_init(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_router_init()
11673 INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_list); in mlxsw_sp_router_init()
11702 router->inetaddr_nb.notifier_call = mlxsw_sp_inetaddr_event; in mlxsw_sp_router_init()
11703 err = register_inetaddr_notifier(&router->inetaddr_nb); in mlxsw_sp_router_init()
11707 router->inet6addr_nb.notifier_call = mlxsw_sp_inet6addr_event; in mlxsw_sp_router_init()
11708 err = register_inet6addr_notifier(&router->inet6addr_nb); in mlxsw_sp_router_init()
11712 router->inetaddr_valid_nb.notifier_call = mlxsw_sp_inetaddr_valid_event; in mlxsw_sp_router_init()
11713 err = register_inetaddr_validator_notifier(&router->inetaddr_valid_nb); in mlxsw_sp_router_init()
11717 nb = &router->inet6addr_valid_nb; in mlxsw_sp_router_init()
11723 mlxsw_sp->router->netevent_nb.notifier_call = in mlxsw_sp_router_init()
11725 err = register_netevent_notifier(&mlxsw_sp->router->netevent_nb); in mlxsw_sp_router_init()
11729 mlxsw_sp->router->netdevice_nb.notifier_call = in mlxsw_sp_router_init()
11732 &mlxsw_sp->router->netdevice_nb); in mlxsw_sp_router_init()
11736 mlxsw_sp->router->nexthop_nb.notifier_call = in mlxsw_sp_router_init()
11739 &mlxsw_sp->router->nexthop_nb, in mlxsw_sp_router_init()
11744 mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event; in mlxsw_sp_router_init()
11746 &mlxsw_sp->router->fib_nb, in mlxsw_sp_router_init()
11755 &mlxsw_sp->router->nexthop_nb); in mlxsw_sp_router_init()
11758 &router->netdevice_nb); in mlxsw_sp_router_init()
11760 unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb); in mlxsw_sp_router_init()
11762 unregister_inet6addr_validator_notifier(&router->inet6addr_valid_nb); in mlxsw_sp_router_init()
11764 unregister_inetaddr_validator_notifier(&router->inetaddr_valid_nb); in mlxsw_sp_router_init()
11766 unregister_inet6addr_notifier(&router->inet6addr_nb); in mlxsw_sp_router_init()
11768 unregister_inetaddr_notifier(&router->inetaddr_nb); in mlxsw_sp_router_init()
11784 rhashtable_destroy(&mlxsw_sp->router->nexthop_group_ht); in mlxsw_sp_router_init()
11786 rhashtable_destroy(&mlxsw_sp->router->nexthop_ht); in mlxsw_sp_router_init()
11790 rhashtable_destroy(&mlxsw_sp->router->crif_ht); in mlxsw_sp_router_init()
11796 cancel_delayed_work_sync(&mlxsw_sp->router->nh_grp_activity_dw); in mlxsw_sp_router_init()
11798 mutex_destroy(&mlxsw_sp->router->lock); in mlxsw_sp_router_init()
11799 kfree(mlxsw_sp->router); in mlxsw_sp_router_init()
11805 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_fini() local
11807 unregister_fib_notifier(mlxsw_sp_net(mlxsw_sp), &router->fib_nb); in mlxsw_sp_router_fini()
11809 &router->nexthop_nb); in mlxsw_sp_router_fini()
11811 &router->netdevice_nb); in mlxsw_sp_router_fini()
11812 unregister_netevent_notifier(&router->netevent_nb); in mlxsw_sp_router_fini()
11813 unregister_inet6addr_validator_notifier(&router->inet6addr_valid_nb); in mlxsw_sp_router_fini()
11814 unregister_inetaddr_validator_notifier(&router->inetaddr_valid_nb); in mlxsw_sp_router_fini()
11815 unregister_inet6addr_notifier(&router->inet6addr_nb); in mlxsw_sp_router_fini()
11816 unregister_inetaddr_notifier(&router->inetaddr_nb); in mlxsw_sp_router_fini()
11824 rhashtable_destroy(&router->nexthop_group_ht); in mlxsw_sp_router_fini()
11825 rhashtable_destroy(&router->nexthop_ht); in mlxsw_sp_router_fini()
11827 rhashtable_destroy(&mlxsw_sp->router->crif_ht); in mlxsw_sp_router_fini()
11830 cancel_delayed_work_sync(&router->nh_grp_activity_dw); in mlxsw_sp_router_fini()
11831 mutex_destroy(&router->lock); in mlxsw_sp_router_fini()
11832 kfree(router); in mlxsw_sp_router_fini()