Lines Matching refs:fib
143 const struct mlxsw_sp_fib *fib,
146 const struct mlxsw_sp_fib *fib);
377 struct mlxsw_sp_fib *fib; member
446 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_create() local
450 fib = kzalloc(sizeof(*fib), GFP_KERNEL); in mlxsw_sp_fib_create()
451 if (!fib) in mlxsw_sp_fib_create()
453 err = rhashtable_init(&fib->ht, &mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_create()
456 INIT_LIST_HEAD(&fib->node_list); in mlxsw_sp_fib_create()
457 fib->proto = proto; in mlxsw_sp_fib_create()
458 fib->vr = vr; in mlxsw_sp_fib_create()
459 fib->lpm_tree = lpm_tree; in mlxsw_sp_fib_create()
461 err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, lpm_tree->id); in mlxsw_sp_fib_create()
464 return fib; in mlxsw_sp_fib_create()
469 kfree(fib); in mlxsw_sp_fib_create()
474 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_destroy() argument
476 mlxsw_sp_vr_lpm_tree_unbind(mlxsw_sp, fib); in mlxsw_sp_fib_destroy()
477 mlxsw_sp_lpm_tree_put(mlxsw_sp, fib->lpm_tree); in mlxsw_sp_fib_destroy()
478 WARN_ON(!list_empty(&fib->node_list)); in mlxsw_sp_fib_destroy()
479 rhashtable_destroy(&fib->ht); in mlxsw_sp_fib_destroy()
480 kfree(fib); in mlxsw_sp_fib_destroy()
699 const struct mlxsw_sp_fib *fib, u8 tree_id) in mlxsw_sp_vr_lpm_tree_bind() argument
703 mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id, in mlxsw_sp_vr_lpm_tree_bind()
704 (enum mlxsw_reg_ralxx_protocol) fib->proto, in mlxsw_sp_vr_lpm_tree_bind()
710 const struct mlxsw_sp_fib *fib) in mlxsw_sp_vr_lpm_tree_unbind() argument
715 mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id, in mlxsw_sp_vr_lpm_tree_unbind()
716 (enum mlxsw_reg_ralxx_protocol) fib->proto, 0); in mlxsw_sp_vr_lpm_tree_unbind()
846 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_lpm_tree_should_replace() local
850 if (fib->lpm_tree->id == tree_id) in mlxsw_sp_vr_lpm_tree_should_replace()
856 struct mlxsw_sp_fib *fib, in mlxsw_sp_vr_lpm_tree_replace() argument
859 struct mlxsw_sp_lpm_tree *old_tree = fib->lpm_tree; in mlxsw_sp_vr_lpm_tree_replace()
862 fib->lpm_tree = new_tree; in mlxsw_sp_vr_lpm_tree_replace()
864 err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, new_tree->id); in mlxsw_sp_vr_lpm_tree_replace()
872 fib->lpm_tree = old_tree; in mlxsw_sp_vr_lpm_tree_replace()
877 struct mlxsw_sp_fib *fib, in mlxsw_sp_vrs_lpm_tree_replace() argument
880 enum mlxsw_sp_l3proto proto = fib->proto; in mlxsw_sp_vrs_lpm_tree_replace()
1100 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr,
2941 const struct mlxsw_sp_fib *fib, in mlxsw_sp_adj_index_mass_update_vr() argument
2949 (enum mlxsw_reg_ralxx_protocol) fib->proto, in mlxsw_sp_adj_index_mass_update_vr()
2950 fib->vr->id, adj_index, ecmp_size, new_adj_index, in mlxsw_sp_adj_index_mass_update_vr()
2960 struct mlxsw_sp_fib *fib = NULL; in mlxsw_sp_adj_index_mass_update() local
2964 if (fib == fib_entry->fib_node->fib) in mlxsw_sp_adj_index_mass_update()
2966 fib = fib_entry->fib_node->fib; in mlxsw_sp_adj_index_mass_update()
2967 err = mlxsw_sp_adj_index_mass_update_vr(mlxsw_sp, fib, in mlxsw_sp_adj_index_mass_update()
3803 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_should_offload()
3926 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_offload_set()
3939 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_offload_unset()
3974 struct mlxsw_sp_fib *fib = fib_entry->fib_node->fib; in mlxsw_sp_fib_entry_ralue_pack() local
3978 proto = (enum mlxsw_reg_ralxx_protocol) fib->proto; in mlxsw_sp_fib_entry_ralue_pack()
3980 switch (fib->proto) { in mlxsw_sp_fib_entry_ralue_pack()
3983 mlxsw_reg_ralue_pack4(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
3988 mlxsw_reg_ralue_pack6(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
4212 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib4_entry_lookup() local
4218 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV4); in mlxsw_sp_fib4_entry_lookup()
4220 fib_node = mlxsw_sp_fib_node_lookup(fib, &fen_info->dst, in mlxsw_sp_fib4_entry_lookup()
4246 static int mlxsw_sp_fib_node_insert(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_insert() argument
4249 return rhashtable_insert_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_insert()
4253 static void mlxsw_sp_fib_node_remove(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_remove() argument
4256 rhashtable_remove_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_remove()
4261 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_lookup() argument
4269 return rhashtable_lookup_fast(&fib->ht, &key, mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_node_lookup()
4273 mlxsw_sp_fib_node_create(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_create() argument
4283 list_add(&fib_node->list, &fib->node_list); in mlxsw_sp_fib_node_create()
4309 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_link() local
4313 lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; in mlxsw_sp_fib_lpm_tree_link()
4320 fib->proto); in mlxsw_sp_fib_lpm_tree_link()
4324 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_link()
4340 struct mlxsw_sp_lpm_tree *lpm_tree = fib_node->fib->lpm_tree; in mlxsw_sp_fib_lpm_tree_unlink()
4342 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_unlink() local
4354 fib->proto); in mlxsw_sp_fib_lpm_tree_unlink()
4358 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_unlink()
4370 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_node_init() argument
4374 err = mlxsw_sp_fib_node_insert(fib, fib_node); in mlxsw_sp_fib_node_init()
4377 fib_node->fib = fib; in mlxsw_sp_fib_node_init()
4386 fib_node->fib = NULL; in mlxsw_sp_fib_node_init()
4387 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_init()
4394 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_node_fini() local
4397 fib_node->fib = NULL; in mlxsw_sp_fib_node_fini()
4398 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_fini()
4407 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_node_get() local
4414 fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_fib_node_get()
4416 fib_node = mlxsw_sp_fib_node_lookup(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
4420 fib_node = mlxsw_sp_fib_node_create(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
4426 err = mlxsw_sp_fib_node_init(mlxsw_sp, fib_node, fib); in mlxsw_sp_fib_node_get()
4442 struct mlxsw_sp_vr *vr = fib_node->fib->vr; in mlxsw_sp_fib_node_put()
5270 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib6_entry_lookup() local
5276 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV6); in mlxsw_sp_fib6_entry_lookup()
5278 fib_node = mlxsw_sp_fib_node_lookup(fib, &rt->fib6_dst.addr, in mlxsw_sp_fib6_entry_lookup()
5588 switch (fib_node->fib->proto) { in mlxsw_sp_fib_node_flush()
5602 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_fib_flush() local
5605 list_for_each_entry_safe(fib_node, tmp, &fib->node_list, list) { in mlxsw_sp_vr_fib_flush()
5606 bool do_break = &tmp->list == &fib->node_list; in mlxsw_sp_vr_fib_flush()