Lines Matching full:router

519 	u16 id; /* virtual router ID */
539 lpm_tree = mlxsw_sp->router->lpm.proto_trees[proto]; in mlxsw_sp_fib_create()
579 for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { in mlxsw_sp_lpm_tree_find_unused()
580 lpm_tree = &mlxsw_sp->router->lpm.trees[i]; in mlxsw_sp_lpm_tree_find_unused()
679 for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { in mlxsw_sp_lpm_tree_get()
680 lpm_tree = &mlxsw_sp->router->lpm.trees[i]; in mlxsw_sp_lpm_tree_get()
717 mlxsw_sp->router->lpm.tree_count = max_trees - MLXSW_SP_LPM_TREE_MIN; in mlxsw_sp_lpm_init()
718 mlxsw_sp->router->lpm.trees = kcalloc(mlxsw_sp->router->lpm.tree_count, in mlxsw_sp_lpm_init()
721 if (!mlxsw_sp->router->lpm.trees) in mlxsw_sp_lpm_init()
724 for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { in mlxsw_sp_lpm_init()
725 lpm_tree = &mlxsw_sp->router->lpm.trees[i]; in mlxsw_sp_lpm_init()
735 mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4] = lpm_tree; in mlxsw_sp_lpm_init()
743 mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV6] = lpm_tree; in mlxsw_sp_lpm_init()
748 lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4]; in mlxsw_sp_lpm_init()
751 kfree(mlxsw_sp->router->lpm.trees); in mlxsw_sp_lpm_init()
759 lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV6]; in mlxsw_sp_lpm_fini()
762 lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4]; in mlxsw_sp_lpm_fini()
765 kfree(mlxsw_sp->router->lpm.trees); in mlxsw_sp_lpm_fini()
782 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vr_find_unused()
829 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vr_find()
842 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_tb_id_vr_id()
850 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_tb_id_vr_id()
997 old_tree = mlxsw_sp->router->lpm.proto_trees[proto]; in mlxsw_sp_vrs_lpm_tree_replace()
1001 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vrs_lpm_tree_replace()
1013 mlxsw_sp->router->lpm.proto_trees[proto] = new_tree; in mlxsw_sp_vrs_lpm_tree_replace()
1039 mlxsw_sp->router->vrs = kcalloc(max_vrs, sizeof(struct mlxsw_sp_vr), in mlxsw_sp_vrs_init()
1041 if (!mlxsw_sp->router->vrs) in mlxsw_sp_vrs_init()
1045 vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_vrs_init()
1065 kfree(mlxsw_sp->router->vrs); in mlxsw_sp_vrs_fini()
1113 static int mlxsw_sp_crif_insert(struct mlxsw_sp_router *router, in mlxsw_sp_crif_insert() argument
1116 return rhashtable_insert_fast(&router->crif_ht, &crif->ht_node, in mlxsw_sp_crif_insert()
1120 static void mlxsw_sp_crif_remove(struct mlxsw_sp_router *router, in mlxsw_sp_crif_remove() argument
1123 rhashtable_remove_fast(&router->crif_ht, &crif->ht_node, in mlxsw_sp_crif_remove()
1128 mlxsw_sp_crif_lookup(struct mlxsw_sp_router *router, in mlxsw_sp_crif_lookup() argument
1135 return rhashtable_lookup_fast(&router->crif_ht, &key, in mlxsw_sp_crif_lookup()
1154 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_ol_ipip_lb_create()
1178 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_entry_alloc()
1213 mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_ipip_entry_dealloc()
1231 if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto) in mlxsw_sp_ipip_entry_saddr_matches()
1244 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_decap_parsing_depth_inc()
1259 mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_ipip_decap_parsing_depth_dec()
1400 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_ipip_entry_find_decap()
1449 &mlxsw_sp->router->ipip_list); in mlxsw_sp_ipip_entry_create()
1472 if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto) in mlxsw_sp_ipip_entry_matches_decap()
1494 list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_decap()
1514 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_netdev_ipip_type() local
1519 ipip_ops = router->ipip_ops_arr[ipipt]; in mlxsw_sp_netdev_ipip_type()
1541 list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_ol_dev()
1556 ipip_entry = list_prepare_entry(start, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_ul_dev()
1558 list_for_each_entry_continue(ipip_entry, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_entry_find_by_ul_dev()
1585 = mlxsw_sp->router->ipip_ops_arr[ipipt]; in mlxsw_sp_netdevice_ipip_can_offload()
1602 ul_proto = mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto; in mlxsw_sp_netdevice_ipip_ol_reg_event()
1847 ul_proto = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]->ul_proto; in mlxsw_sp_netdevice_ipip_ul_vrf_event()
1906 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_netdevice_ipip_ol_change_event()
1936 list_for_each_entry_safe(ipip_entry, tmp, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_demote_tunnel_by_saddr()
1954 list_for_each_entry_safe(ipip_entry, tmp, &mlxsw_sp->router->ipip_list, in mlxsw_sp_ipip_demote_tunnel_by_ul_netdev()
2069 &mlxsw_sp->router->ipip_list)) in mlxsw_sp_netdevice_ipip_ul_event()
2091 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_nve_promote_decap() local
2095 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_promote_decap()
2097 if (WARN_ON_ONCE(router->nve_decap_config.valid)) { in mlxsw_sp_router_nve_promote_decap()
2102 router->nve_decap_config.ul_tb_id = ul_tb_id; in mlxsw_sp_router_nve_promote_decap()
2103 router->nve_decap_config.tunnel_index = tunnel_index; in mlxsw_sp_router_nve_promote_decap()
2104 router->nve_decap_config.ul_proto = ul_proto; in mlxsw_sp_router_nve_promote_decap()
2105 router->nve_decap_config.ul_sip = *ul_sip; in mlxsw_sp_router_nve_promote_decap()
2106 router->nve_decap_config.valid = true; in mlxsw_sp_router_nve_promote_decap()
2130 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_promote_decap()
2139 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_nve_demote_decap() local
2142 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_demote_decap()
2144 if (WARN_ON_ONCE(!router->nve_decap_config.valid)) in mlxsw_sp_router_nve_demote_decap()
2147 router->nve_decap_config.valid = false; in mlxsw_sp_router_nve_demote_decap()
2158 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_nve_demote_decap()
2166 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_nve_is_decap() local
2168 return router->nve_decap_config.valid && in mlxsw_sp_router_nve_is_decap()
2169 router->nve_decap_config.ul_tb_id == ul_tb_id && in mlxsw_sp_router_nve_is_decap()
2170 router->nve_decap_config.ul_proto == ul_proto && in mlxsw_sp_router_nve_is_decap()
2171 !memcmp(&router->nve_decap_config.ul_sip, ul_sip, in mlxsw_sp_router_nve_is_decap()
2282 return rhashtable_insert_fast(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_entry_insert()
2291 rhashtable_remove_fast(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_entry_remove()
2363 atomic_inc(&mlxsw_sp->router->neighs_update.neigh_count); in mlxsw_sp_neigh_entry_create()
2378 atomic_dec(&mlxsw_sp->router->neighs_update.neigh_count); in mlxsw_sp_neigh_entry_destroy()
2390 return rhashtable_lookup_fast(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_entry_lookup()
2406 mlxsw_sp->router->neighs_update.interval = jiffies_to_msecs(interval); in mlxsw_sp_router_neighs_update_interval_init()
2424 if (!mlxsw_sp->router->rifs[rif]) { in mlxsw_sp_router_neigh_ent_ipv4_process()
2430 dev = mlxsw_sp_rif_dev(mlxsw_sp->router->rifs[rif]); in mlxsw_sp_router_neigh_ent_ipv4_process()
2453 if (!mlxsw_sp->router->rifs[rif]) { in mlxsw_sp_router_neigh_ent_ipv6_process()
2458 dev = mlxsw_sp_rif_dev(mlxsw_sp->router->rifs[rif]); in mlxsw_sp_router_neigh_ent_ipv6_process()
2551 mutex_lock(&mlxsw_sp->router->lock); in __mlxsw_sp_router_neighs_update_rauhtd()
2565 mutex_unlock(&mlxsw_sp->router->lock); in __mlxsw_sp_router_neighs_update_rauhtd()
2576 if (!atomic_read(&mlxsw_sp->router->neighs_update.neigh_count)) in mlxsw_sp_router_neighs_update_rauhtd()
2599 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neighs_update_nh()
2600 list_for_each_entry(neigh_entry, &mlxsw_sp->router->nexthop_neighs_list, in mlxsw_sp_router_neighs_update_nh()
2606 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neighs_update_nh()
2612 unsigned long interval = mlxsw_sp->router->neighs_update.interval; in mlxsw_sp_router_neighs_update_work_schedule()
2614 mlxsw_core_schedule_dw(&mlxsw_sp->router->neighs_update.dw, in mlxsw_sp_router_neighs_update_work_schedule()
2620 struct mlxsw_sp_router *router; in mlxsw_sp_router_neighs_update_work() local
2623 router = container_of(work, struct mlxsw_sp_router, in mlxsw_sp_router_neighs_update_work()
2625 err = mlxsw_sp_router_neighs_update_rauhtd(router->mlxsw_sp); in mlxsw_sp_router_neighs_update_work()
2627 dev_err(router->mlxsw_sp->bus_info->dev, "Could not update kernel for neigh activity"); in mlxsw_sp_router_neighs_update_work()
2629 mlxsw_sp_router_neighs_update_nh(router->mlxsw_sp); in mlxsw_sp_router_neighs_update_work()
2631 mlxsw_sp_router_neighs_update_work_schedule(router->mlxsw_sp); in mlxsw_sp_router_neighs_update_work()
2637 struct mlxsw_sp_router *router; in mlxsw_sp_router_probe_unresolved_nexthops() local
2639 router = container_of(work, struct mlxsw_sp_router, in mlxsw_sp_router_probe_unresolved_nexthops()
2647 mutex_lock(&router->lock); in mlxsw_sp_router_probe_unresolved_nexthops()
2648 list_for_each_entry(neigh_entry, &router->nexthop_neighs_list, in mlxsw_sp_router_probe_unresolved_nexthops()
2652 mutex_unlock(&router->lock); in mlxsw_sp_router_probe_unresolved_nexthops()
2654 mlxsw_core_schedule_dw(&router->nexthop_probe_dw, in mlxsw_sp_router_probe_unresolved_nexthops()
2790 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neigh_event_work()
2816 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_neigh_event_work()
2846 struct mlxsw_sp_router *router, in mlxsw_sp_router_schedule_work() argument
2852 if (!net_eq(net, mlxsw_sp_net(router->mlxsw_sp))) in mlxsw_sp_router_schedule_work()
2860 net_work->mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_router_schedule_work()
2876 static int mlxsw_sp_router_schedule_neigh_work(struct mlxsw_sp_router *router, in mlxsw_sp_router_schedule_neigh_work() argument
2887 return mlxsw_sp_router_schedule_work(net, router, n, in mlxsw_sp_router_schedule_neigh_work()
2894 struct mlxsw_sp_router *router; in mlxsw_sp_router_netevent_event() local
2899 router = container_of(nb, struct mlxsw_sp_router, netevent_nb); in mlxsw_sp_router_netevent_event()
2917 router->neighs_update.interval = interval; in mlxsw_sp_router_netevent_event()
2928 return mlxsw_sp_router_schedule_neigh_work(router, n); in mlxsw_sp_router_netevent_event()
2932 return mlxsw_sp_router_schedule_work(ptr, router, NULL, in mlxsw_sp_router_netevent_event()
2936 return mlxsw_sp_router_schedule_work(ptr, router, NULL, in mlxsw_sp_router_netevent_event()
2947 err = rhashtable_init(&mlxsw_sp->router->neigh_ht, in mlxsw_sp_neigh_init()
2958 INIT_DELAYED_WORK(&mlxsw_sp->router->neighs_update.dw, in mlxsw_sp_neigh_init()
2960 INIT_DELAYED_WORK(&mlxsw_sp->router->nexthop_probe_dw, in mlxsw_sp_neigh_init()
2962 atomic_set(&mlxsw_sp->router->neighs_update.neigh_count, 0); in mlxsw_sp_neigh_init()
2963 mlxsw_core_schedule_dw(&mlxsw_sp->router->neighs_update.dw, 0); in mlxsw_sp_neigh_init()
2964 mlxsw_core_schedule_dw(&mlxsw_sp->router->nexthop_probe_dw, 0); in mlxsw_sp_neigh_init()
2970 cancel_delayed_work_sync(&mlxsw_sp->router->neighs_update.dw); in mlxsw_sp_neigh_fini()
2971 cancel_delayed_work_sync(&mlxsw_sp->router->nexthop_probe_dw); in mlxsw_sp_neigh_fini()
2972 rhashtable_destroy(&mlxsw_sp->router->neigh_ht); in mlxsw_sp_neigh_fini()
3002 rc = mlxsw_sp_router_schedule_neigh_work(rms->mlxsw_sp->router, n); in mlxsw_sp_neigh_rif_made_sync_each()
3188 struct mlxsw_sp_nexthop *mlxsw_sp_nexthop_next(struct mlxsw_sp_router *router, in mlxsw_sp_nexthop_next() argument
3192 if (list_empty(&router->nexthop_list)) in mlxsw_sp_nexthop_next()
3195 return list_first_entry(&router->nexthop_list, in mlxsw_sp_nexthop_next()
3198 if (list_is_last(&nh->router_list_node, &router->nexthop_list)) in mlxsw_sp_nexthop_next()
3507 return rhashtable_insert_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop_group_insert()
3519 rhashtable_remove_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop_group_remove()
3532 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop4_group_lookup()
3545 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop6_group_lookup()
3559 return rhashtable_insert_fast(&mlxsw_sp->router->nexthop_ht, in mlxsw_sp_nexthop_insert()
3566 rhashtable_remove_fast(&mlxsw_sp->router->nexthop_ht, &nh->ht_node, in mlxsw_sp_nexthop_remove()
3574 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_ht, &key, in mlxsw_sp_nexthop_lookup()
3636 mlxsw_sp->router->lb_crif->rif->rif_index; in __mlxsw_sp_nexthop_eth_update()
3691 ipip_ops = mlxsw_sp->router->ipip_ops_arr[nh->ipip_entry->ipipt]; in __mlxsw_sp_nexthop_ipip_update()
3811 for (i = 0; i < mlxsw_sp->router->adj_grp_size_ranges_count; i++) { in mlxsw_sp_adj_grp_size_round_up()
3814 size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; in mlxsw_sp_adj_grp_size_round_up()
3833 for (i = mlxsw_sp->router->adj_grp_size_ranges_count - 1; i >= 0; i--) { in mlxsw_sp_adj_grp_size_round_down()
3836 size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; in mlxsw_sp_adj_grp_size_round_down()
4315 &mlxsw_sp->router->nexthop_neighs_list); in mlxsw_sp_nexthop_neigh_init()
4381 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, ipip_entry->ol_dev); in mlxsw_sp_nexthop_ipip_init()
4425 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_nexthop_type_init()
4434 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, dev); in mlxsw_sp_nexthop_type_init()
4510 list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); in mlxsw_sp_nexthop4_init()
4643 &mlxsw_sp->router->adj_trap_index); in mlxsw_sp_adj_trap_entry_init()
4650 mlxsw_sp->router->adj_trap_index, in mlxsw_sp_adj_trap_entry_init()
4651 mlxsw_sp->router->lb_crif->rif->rif_index); in mlxsw_sp_adj_trap_entry_init()
4662 mlxsw_sp->router->adj_trap_index); in mlxsw_sp_adj_trap_entry_init()
4669 mlxsw_sp->router->adj_trap_index); in mlxsw_sp_adj_trap_entry_fini()
4676 if (refcount_inc_not_zero(&mlxsw_sp->router->num_groups)) in mlxsw_sp_nexthop_group_inc()
4683 refcount_set(&mlxsw_sp->router->num_groups, 1); in mlxsw_sp_nexthop_group_inc()
4690 if (!refcount_dec_and_test(&mlxsw_sp->router->num_groups)) in mlxsw_sp_nexthop_group_dec()
4748 mlxsw_core_schedule_dw(&mlxsw_sp->router->nh_grp_activity_dw, in mlxsw_sp_nh_grp_activity_work_schedule()
4755 struct mlxsw_sp_router *router; in mlxsw_sp_nh_grp_activity_work() local
4758 router = container_of(work, struct mlxsw_sp_router, in mlxsw_sp_nh_grp_activity_work()
4761 mutex_lock(&router->lock); in mlxsw_sp_nh_grp_activity_work()
4763 list_for_each_entry(nhgi, &router->nh_res_grp_list, list) { in mlxsw_sp_nh_grp_activity_work()
4764 mlxsw_sp_nh_grp_activity_update(router->mlxsw_sp, nhgi->nh_grp); in mlxsw_sp_nh_grp_activity_work()
4768 mutex_unlock(&router->lock); in mlxsw_sp_nh_grp_activity_work()
4772 mlxsw_sp_nh_grp_activity_work_schedule(router->mlxsw_sp); in mlxsw_sp_nh_grp_activity_work()
4855 for (i = 0; i < mlxsw_sp->router->adj_grp_size_ranges_count; i++) { in mlxsw_sp_nexthop_obj_res_group_size_validate()
4858 size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; in mlxsw_sp_nexthop_obj_res_group_size_validate()
4973 nh->crif = mlxsw_sp->router->lb_crif; in mlxsw_sp_nexthop_obj_blackhole_init()
5009 list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); in mlxsw_sp_nexthop_obj_init()
5121 if (list_empty(&mlxsw_sp->router->nh_res_grp_list)) in mlxsw_sp_nexthop_obj_group_info_init()
5123 list_add(&nhgi->list, &mlxsw_sp->router->nh_res_grp_list); in mlxsw_sp_nexthop_obj_group_info_init()
5146 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_nexthop_obj_group_info_fini() local
5151 if (list_empty(&mlxsw_sp->router->nh_res_grp_list)) in mlxsw_sp_nexthop_obj_group_info_fini()
5152 cancel_delayed_work(&router->nh_grp_activity_dw); in mlxsw_sp_nexthop_obj_group_info_fini()
5220 return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_nexthop_obj_group_lookup()
5482 struct mlxsw_sp_router *router; in mlxsw_sp_nexthop_obj_event() local
5485 router = container_of(nb, struct mlxsw_sp_router, nexthop_nb); in mlxsw_sp_nexthop_obj_event()
5486 err = mlxsw_sp_nexthop_obj_validate(router->mlxsw_sp, event, info); in mlxsw_sp_nexthop_obj_event()
5490 mutex_lock(&router->lock); in mlxsw_sp_nexthop_obj_event()
5494 err = mlxsw_sp_nexthop_obj_new(router->mlxsw_sp, info); in mlxsw_sp_nexthop_obj_event()
5497 mlxsw_sp_nexthop_obj_del(router->mlxsw_sp, info); in mlxsw_sp_nexthop_obj_event()
5500 err = mlxsw_sp_nexthop_obj_bucket_replace(router->mlxsw_sp, in mlxsw_sp_nexthop_obj_event()
5507 mutex_unlock(&router->lock); in mlxsw_sp_nexthop_obj_event()
5978 adjacency_index = mlxsw_sp->router->adj_trap_index; in mlxsw_sp_fib_entry_op_remote()
6069 ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; in mlxsw_sp_fib_entry_op_ipip_decap()
6153 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_fib4_entry_type_set() local
6173 tunnel_index = router->nve_decap_config.tunnel_index; in mlxsw_sp_fib4_entry_type_set()
6378 lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; in mlxsw_sp_fib_lpm_tree_link()
6738 list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); in mlxsw_sp_nexthop6_init()
7057 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_fib6_entry_type_set_local() local
7075 tunnel_index = router->nve_decap_config.tunnel_index; in mlxsw_sp_fib6_entry_type_set_local()
7526 struct mlxsw_sp_vr *vr = &mlxsw_sp->router->vrs[i]; in mlxsw_sp_router_fib_flush()
7535 /* If virtual router was only used for IPv4, then it's no in mlxsw_sp_router_fib_flush()
7619 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib4_event_work()
7644 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib4_event_work()
7656 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib6_event_work()
7691 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fib6_event_work()
7704 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fibmr_event_work()
7733 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_fibmr_event_work()
7858 struct mlxsw_sp_router *router; in mlxsw_sp_router_fib_event() local
7866 router = container_of(nb, struct mlxsw_sp_router, fib_nb); in mlxsw_sp_router_fib_event()
7872 router->mlxsw_sp); in mlxsw_sp_router_fib_event()
7892 fib_work->mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_router_fib_event()
7930 if (mlxsw_sp->router->rifs[i] && in mlxsw_sp_rif_find_by_dev()
7931 mlxsw_sp_rif_dev_is(mlxsw_sp->router->rifs[i], dev)) in mlxsw_sp_rif_find_by_dev()
7932 return mlxsw_sp->router->rifs[i]; in mlxsw_sp_rif_find_by_dev()
7942 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_exists()
7944 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_exists()
7954 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_vid()
7968 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_vid()
8100 *p_rif_index = gen_pool_alloc(mlxsw_sp->router->rifs_table, in mlxsw_sp_rif_index_alloc()
8115 gen_pool_free(mlxsw_sp->router->rifs_table, in mlxsw_sp_rif_index_free()
8157 return mlxsw_sp->router->rifs[rif_index]; in mlxsw_sp_rif_by_index()
8335 * acquire the router lock again. Just postpone the notification until in mlxsw_sp_router_hwstats_notify_schedule()
8392 ops = mlxsw_sp->router->rif_ops_arr[type]; in mlxsw_sp_rif_create()
8401 NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interfaces"); in mlxsw_sp_rif_create()
8405 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, params->dev); in mlxsw_sp_rif_create()
8417 mlxsw_sp->router->rifs[rif_index] = rif; in mlxsw_sp_rif_create()
8458 atomic_add(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_rif_create()
8472 mlxsw_sp->router->rifs[rif_index] = NULL; in mlxsw_sp_rif_create()
8496 atomic_sub(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_rif_destroy()
8498 vr = &mlxsw_sp->router->vrs[rif->vr_id]; in mlxsw_sp_rif_destroy()
8514 mlxsw_sp->router->rifs[rif->rif_index] = NULL; in mlxsw_sp_rif_destroy()
8530 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_destroy_by_dev()
8536 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_destroy_by_dev()
8553 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, upper_dev); in mlxsw_sp_rif_destroy_vlan_upper()
8578 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_bridge_vlan_add()
8639 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_bridge_vlan_add()
8695 u8 max_rif_mac_profiles = mlxsw_sp->router->max_rif_mac_profile; in mlxsw_sp_rif_mac_profile_index_alloc()
8696 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_rif_mac_profile_index_alloc() local
8699 id = idr_alloc(&router->rif_mac_profiles_idr, profile, 0, in mlxsw_sp_rif_mac_profile_index_alloc()
8709 "Exceeded number of supported router interface MAC profiles"); in mlxsw_sp_rif_mac_profile_index_alloc()
8719 profile = idr_remove(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_index_free()
8742 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_rif_mac_profile_find() local
8746 idr_for_each_entry(&router->rif_mac_profiles_idr, profile, id) { in mlxsw_sp_rif_mac_profile_find()
8759 return atomic_read(&mlxsw_sp->router->rif_mac_profiles_count); in mlxsw_sp_rif_mac_profiles_occ_get()
8766 return atomic_read(&mlxsw_sp->router->rifs_count); in mlxsw_sp_rifs_occ_get()
8784 atomic_inc(&mlxsw_sp->router->rif_mac_profiles_count); in mlxsw_sp_rif_mac_profile_create()
8797 atomic_dec(&mlxsw_sp->router->rif_mac_profiles_count); in mlxsw_sp_rif_mac_profile_destroy()
8828 profile = idr_find(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_put()
8844 profile = idr_find(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_is_shared()
8858 profile = idr_find(&mlxsw_sp->router->rif_mac_profiles_idr, in mlxsw_sp_rif_mac_profile_edit()
8968 lockdep_assert_held(&mlxsw_sp->router->lock); in mlxsw_sp_port_vlan_router_join_existing()
8982 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_port_vlan_router_leave()
8984 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_port_vlan_router_leave()
9236 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_macvlan_del()
9238 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_rif_macvlan_del()
9286 struct mlxsw_sp_router *router; in mlxsw_sp_inetaddr_event() local
9294 router = container_of(nb, struct mlxsw_sp_router, inetaddr_nb); in mlxsw_sp_inetaddr_event()
9295 mutex_lock(&router->lock); in mlxsw_sp_inetaddr_event()
9296 rif = mlxsw_sp_rif_find_by_dev(router->mlxsw_sp, dev); in mlxsw_sp_inetaddr_event()
9300 err = __mlxsw_sp_inetaddr_event(router->mlxsw_sp, dev, event, false, in mlxsw_sp_inetaddr_event()
9303 mutex_unlock(&router->lock); in mlxsw_sp_inetaddr_event()
9320 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_inetaddr_valid_event()
9328 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_inetaddr_valid_event()
9350 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_event_work()
9358 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_event_work()
9371 struct mlxsw_sp_router *router; in mlxsw_sp_inet6addr_event() local
9381 router = container_of(nb, struct mlxsw_sp_router, inet6addr_nb); in mlxsw_sp_inet6addr_event()
9383 inet6addr_work->mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_inet6addr_event()
9405 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_valid_event()
9413 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_inet6addr_valid_event()
9474 vr = &mlxsw_sp->router->vrs[rif->vr_id]; in mlxsw_sp_router_port_change_event()
9512 max_rif_mac_profiles = mlxsw_sp->router->max_rif_mac_profile; in mlxsw_sp_router_port_pre_changeaddr_event()
9520 NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interface MAC profiles"); in mlxsw_sp_router_port_pre_changeaddr_event()
9546 mlxsw_sp_crif_register(struct mlxsw_sp_router *router, struct net_device *dev) in mlxsw_sp_crif_register() argument
9551 if (WARN_ON(mlxsw_sp_crif_lookup(router, dev))) in mlxsw_sp_crif_register()
9558 err = mlxsw_sp_crif_insert(router, crif); in mlxsw_sp_crif_register()
9569 static void mlxsw_sp_crif_unregister(struct mlxsw_sp_router *router, in mlxsw_sp_crif_unregister() argument
9574 mlxsw_sp_crif_remove(router, crif); in mlxsw_sp_crif_unregister()
9577 mlxsw_sp_nexthop_type_fini(router->mlxsw_sp, nh); in mlxsw_sp_crif_unregister()
9585 static int mlxsw_sp_netdevice_register(struct mlxsw_sp_router *router, in mlxsw_sp_netdevice_register() argument
9590 if (!mlxsw_sp_router_netdevice_interesting(router->mlxsw_sp, dev)) in mlxsw_sp_netdevice_register()
9593 crif = mlxsw_sp_crif_register(router, dev); in mlxsw_sp_netdevice_register()
9597 static void mlxsw_sp_netdevice_unregister(struct mlxsw_sp_router *router, in mlxsw_sp_netdevice_unregister() argument
9602 if (!mlxsw_sp_router_netdevice_interesting(router->mlxsw_sp, dev)) in mlxsw_sp_netdevice_unregister()
9611 crif = mlxsw_sp_crif_lookup(router, dev); in mlxsw_sp_netdevice_unregister()
9619 mlxsw_sp_crif_unregister(router, crif); in mlxsw_sp_netdevice_unregister()
9727 * destroy it and create a new one with the new virtual router ID. in mlxsw_sp_port_vrf_join()
9766 * direct more MAC addresses to the router. in mlxsw_sp_netdevice_vrf_event()
9807 crif = mlxsw_sp_crif_lookup(ctx->mlxsw_sp->router, dev); in mlxsw_sp_router_replay_inetaddr_up()
9836 crif = mlxsw_sp_crif_lookup(ctx->mlxsw_sp->router, dev); in mlxsw_sp_router_unreplay_inetaddr_up()
10001 mutex_lock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_join_lag()
10003 mutex_unlock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_join_lag()
10011 mutex_lock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_leave_lag()
10013 mutex_unlock(&mlxsw_sp_port->mlxsw_sp->router->lock); in mlxsw_sp_router_port_leave_lag()
10020 struct mlxsw_sp_router *router; in mlxsw_sp_router_netdevice_event() local
10024 router = container_of(nb, struct mlxsw_sp_router, netdevice_nb); in mlxsw_sp_router_netdevice_event()
10025 mlxsw_sp = router->mlxsw_sp; in mlxsw_sp_router_netdevice_event()
10027 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_netdevice_event()
10030 err = mlxsw_sp_netdevice_register(router, dev); in mlxsw_sp_router_netdevice_event()
10053 mlxsw_sp_netdevice_unregister(router, dev); in mlxsw_sp_router_netdevice_event()
10056 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_netdevice_event()
10586 ul_vr = &mlxsw_sp->router->vrs[lb_rif->ul_vr_id]; in mlxsw_sp1_rif_ipip_lb_deconfigure()
10634 NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interfaces"); in mlxsw_sp_ul_rif_create()
10645 mlxsw_sp->router->rifs[rif_index] = ul_rif; in mlxsw_sp_ul_rif_create()
10652 atomic_add(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_ul_rif_create()
10656 mlxsw_sp->router->rifs[rif_index] = NULL; in mlxsw_sp_ul_rif_create()
10669 atomic_sub(rif_entries, &mlxsw_sp->router->rifs_count); in mlxsw_sp_ul_rif_destroy()
10671 mlxsw_sp->router->rifs[ul_rif->rif_index] = NULL; in mlxsw_sp_ul_rif_destroy()
10712 vr = &mlxsw_sp->router->vrs[ul_rif->vr_id]; in mlxsw_sp_ul_rif_put()
10728 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_get()
10736 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_get()
10744 mutex_lock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_put()
10745 ul_rif = mlxsw_sp->router->rifs[ul_rif_index]; in mlxsw_sp_router_ul_rif_put()
10751 mutex_unlock(&mlxsw_sp->router->lock); in mlxsw_sp_router_ul_rif_put()
10826 mlxsw_sp->router->rifs_table = rifs_table; in mlxsw_sp_rifs_table_init()
10837 gen_pool_destroy(mlxsw_sp->router->rifs_table); in mlxsw_sp_rifs_table_fini()
10849 mlxsw_sp->router->max_rif_mac_profile = in mlxsw_sp_rifs_init()
10852 mlxsw_sp->router->rifs = kcalloc(max_rifs, in mlxsw_sp_rifs_init()
10855 if (!mlxsw_sp->router->rifs) in mlxsw_sp_rifs_init()
10862 idr_init(&mlxsw_sp->router->rif_mac_profiles_idr); in mlxsw_sp_rifs_init()
10863 atomic_set(&mlxsw_sp->router->rif_mac_profiles_count, 0); in mlxsw_sp_rifs_init()
10864 atomic_set(&mlxsw_sp->router->rifs_count, 0); in mlxsw_sp_rifs_init()
10877 kfree(mlxsw_sp->router->rifs); in mlxsw_sp_rifs_init()
10887 WARN_ON_ONCE(atomic_read(&mlxsw_sp->router->rifs_count)); in mlxsw_sp_rifs_fini()
10889 WARN_ON_ONCE(mlxsw_sp->router->rifs[i]); in mlxsw_sp_rifs_fini()
10894 WARN_ON(!idr_is_empty(&mlxsw_sp->router->rif_mac_profiles_idr)); in mlxsw_sp_rifs_fini()
10895 idr_destroy(&mlxsw_sp->router->rif_mac_profiles_idr); in mlxsw_sp_rifs_fini()
10897 kfree(mlxsw_sp->router->rifs); in mlxsw_sp_rifs_fini()
10913 INIT_LIST_HEAD(&mlxsw_sp->router->ipip_list); in mlxsw_sp_ipips_init()
10927 mlxsw_sp->router->ipip_ops_arr = mlxsw_sp1_ipip_ops_arr; in mlxsw_sp1_ipips_init()
10933 mlxsw_sp->router->ipip_ops_arr = mlxsw_sp2_ipip_ops_arr; in mlxsw_sp2_ipips_init()
10939 WARN_ON(!list_empty(&mlxsw_sp->router->ipip_list)); in mlxsw_sp_ipips_fini()
10944 struct mlxsw_sp_router *router; in mlxsw_sp_router_fib_dump_flush() local
10951 router = container_of(nb, struct mlxsw_sp_router, fib_nb); in mlxsw_sp_router_fib_dump_flush()
10952 mlxsw_sp_router_fib_flush(router->mlxsw_sp); in mlxsw_sp_router_fib_dump_flush()
11173 mlxsw_sp->router->inc_parsing_depth = true; in mlxsw_sp_mp_hash_parsing_depth_adjust()
11176 mlxsw_sp->router->inc_parsing_depth = false; in mlxsw_sp_mp_hash_parsing_depth_adjust()
11196 old_inc_parsing_depth = mlxsw_sp->router->inc_parsing_depth; in mlxsw_sp_mp_hash_init()
11227 bool old_inc_parsing_depth = mlxsw_sp->router->inc_parsing_depth; in mlxsw_sp_mp_hash_fini()
11290 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_lb_rif_init() local
11294 router->lb_crif = mlxsw_sp_crif_alloc(NULL); in mlxsw_sp_lb_rif_init()
11295 if (!router->lb_crif) in mlxsw_sp_lb_rif_init()
11304 lb_rif = mlxsw_sp_ul_rif_get(mlxsw_sp, RT_TABLE_MAIN, router->lb_crif, in mlxsw_sp_lb_rif_init()
11314 mlxsw_sp_crif_free(router->lb_crif); in mlxsw_sp_lb_rif_init()
11320 mlxsw_sp_ul_rif_put(mlxsw_sp->router->lb_crif->rif); in mlxsw_sp_lb_rif_fini()
11321 mlxsw_sp_crif_free(mlxsw_sp->router->lb_crif); in mlxsw_sp_lb_rif_fini()
11328 mlxsw_sp->router->rif_ops_arr = mlxsw_sp1_rif_ops_arr; in mlxsw_sp1_router_init()
11329 mlxsw_sp->router->adj_grp_size_ranges = mlxsw_sp1_adj_grp_size_ranges; in mlxsw_sp1_router_init()
11330 mlxsw_sp->router->adj_grp_size_ranges_count = size_ranges_count; in mlxsw_sp1_router_init()
11344 mlxsw_sp->router->rif_ops_arr = mlxsw_sp2_rif_ops_arr; in mlxsw_sp2_router_init()
11345 mlxsw_sp->router->adj_grp_size_ranges = mlxsw_sp2_adj_grp_size_ranges; in mlxsw_sp2_router_init()
11346 mlxsw_sp->router->adj_grp_size_ranges_count = size_ranges_count; in mlxsw_sp2_router_init()
11359 struct mlxsw_sp_router *router; in mlxsw_sp_router_init() local
11363 router = kzalloc(sizeof(*mlxsw_sp->router), GFP_KERNEL); in mlxsw_sp_router_init()
11364 if (!router) in mlxsw_sp_router_init()
11366 mutex_init(&router->lock); in mlxsw_sp_router_init()
11367 mlxsw_sp->router = router; in mlxsw_sp_router_init()
11368 router->mlxsw_sp = mlxsw_sp; in mlxsw_sp_router_init()
11374 INIT_LIST_HEAD(&mlxsw_sp->router->nh_res_grp_list); in mlxsw_sp_router_init()
11375 INIT_DELAYED_WORK(&mlxsw_sp->router->nh_grp_activity_dw, in mlxsw_sp_router_init()
11377 INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_neighs_list); in mlxsw_sp_router_init()
11386 err = rhashtable_init(&mlxsw_sp->router->crif_ht, in mlxsw_sp_router_init()
11395 err = rhashtable_init(&mlxsw_sp->router->nexthop_ht, in mlxsw_sp_router_init()
11400 err = rhashtable_init(&mlxsw_sp->router->nexthop_group_ht, in mlxsw_sp_router_init()
11405 INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_list); in mlxsw_sp_router_init()
11434 router->inetaddr_nb.notifier_call = mlxsw_sp_inetaddr_event; in mlxsw_sp_router_init()
11435 err = register_inetaddr_notifier(&router->inetaddr_nb); in mlxsw_sp_router_init()
11439 router->inet6addr_nb.notifier_call = mlxsw_sp_inet6addr_event; in mlxsw_sp_router_init()
11440 err = register_inet6addr_notifier(&router->inet6addr_nb); in mlxsw_sp_router_init()
11444 router->inetaddr_valid_nb.notifier_call = mlxsw_sp_inetaddr_valid_event; in mlxsw_sp_router_init()
11445 err = register_inetaddr_validator_notifier(&router->inetaddr_valid_nb); in mlxsw_sp_router_init()
11449 nb = &router->inet6addr_valid_nb; in mlxsw_sp_router_init()
11455 mlxsw_sp->router->netevent_nb.notifier_call = in mlxsw_sp_router_init()
11457 err = register_netevent_notifier(&mlxsw_sp->router->netevent_nb); in mlxsw_sp_router_init()
11461 mlxsw_sp->router->nexthop_nb.notifier_call = in mlxsw_sp_router_init()
11464 &mlxsw_sp->router->nexthop_nb, in mlxsw_sp_router_init()
11469 mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event; in mlxsw_sp_router_init()
11471 &mlxsw_sp->router->fib_nb, in mlxsw_sp_router_init()
11476 mlxsw_sp->router->netdevice_nb.notifier_call = in mlxsw_sp_router_init()
11479 &mlxsw_sp->router->netdevice_nb); in mlxsw_sp_router_init()
11487 &mlxsw_sp->router->fib_nb); in mlxsw_sp_router_init()
11490 &mlxsw_sp->router->nexthop_nb); in mlxsw_sp_router_init()
11492 unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb); in mlxsw_sp_router_init()
11494 unregister_inet6addr_validator_notifier(&router->inet6addr_valid_nb); in mlxsw_sp_router_init()
11496 unregister_inetaddr_validator_notifier(&router->inetaddr_valid_nb); in mlxsw_sp_router_init()
11498 unregister_inet6addr_notifier(&router->inet6addr_nb); in mlxsw_sp_router_init()
11500 unregister_inetaddr_notifier(&router->inetaddr_nb); in mlxsw_sp_router_init()
11516 rhashtable_destroy(&mlxsw_sp->router->nexthop_group_ht); in mlxsw_sp_router_init()
11518 rhashtable_destroy(&mlxsw_sp->router->nexthop_ht); in mlxsw_sp_router_init()
11522 rhashtable_destroy(&mlxsw_sp->router->crif_ht); in mlxsw_sp_router_init()
11528 cancel_delayed_work_sync(&mlxsw_sp->router->nh_grp_activity_dw); in mlxsw_sp_router_init()
11530 mutex_destroy(&mlxsw_sp->router->lock); in mlxsw_sp_router_init()
11531 kfree(mlxsw_sp->router); in mlxsw_sp_router_init()
11537 struct mlxsw_sp_router *router = mlxsw_sp->router; in mlxsw_sp_router_fini() local
11540 &router->netdevice_nb); in mlxsw_sp_router_fini()
11541 unregister_fib_notifier(mlxsw_sp_net(mlxsw_sp), &router->fib_nb); in mlxsw_sp_router_fini()
11543 &router->nexthop_nb); in mlxsw_sp_router_fini()
11544 unregister_netevent_notifier(&router->netevent_nb); in mlxsw_sp_router_fini()
11545 unregister_inet6addr_validator_notifier(&router->inet6addr_valid_nb); in mlxsw_sp_router_fini()
11546 unregister_inetaddr_validator_notifier(&router->inetaddr_valid_nb); in mlxsw_sp_router_fini()
11547 unregister_inet6addr_notifier(&router->inet6addr_nb); in mlxsw_sp_router_fini()
11548 unregister_inetaddr_notifier(&router->inetaddr_nb); in mlxsw_sp_router_fini()
11556 rhashtable_destroy(&router->nexthop_group_ht); in mlxsw_sp_router_fini()
11557 rhashtable_destroy(&router->nexthop_ht); in mlxsw_sp_router_fini()
11559 rhashtable_destroy(&mlxsw_sp->router->crif_ht); in mlxsw_sp_router_fini()
11562 cancel_delayed_work_sync(&router->nh_grp_activity_dw); in mlxsw_sp_router_fini()
11563 mutex_destroy(&router->lock); in mlxsw_sp_router_fini()
11564 kfree(router); in mlxsw_sp_router_fini()