Lines Matching refs:fib
138 const struct mlxsw_sp_fib *fib,
141 const struct mlxsw_sp_fib *fib);
437 struct mlxsw_sp_fib *fib; member
507 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_create() local
511 fib = kzalloc(sizeof(*fib), GFP_KERNEL); in mlxsw_sp_fib_create()
512 if (!fib) in mlxsw_sp_fib_create()
514 err = rhashtable_init(&fib->ht, &mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_create()
517 INIT_LIST_HEAD(&fib->node_list); in mlxsw_sp_fib_create()
518 fib->proto = proto; in mlxsw_sp_fib_create()
519 fib->vr = vr; in mlxsw_sp_fib_create()
520 fib->lpm_tree = lpm_tree; in mlxsw_sp_fib_create()
522 err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, lpm_tree->id); in mlxsw_sp_fib_create()
525 return fib; in mlxsw_sp_fib_create()
530 kfree(fib); in mlxsw_sp_fib_create()
535 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_destroy() argument
537 mlxsw_sp_vr_lpm_tree_unbind(mlxsw_sp, fib); in mlxsw_sp_fib_destroy()
538 mlxsw_sp_lpm_tree_put(mlxsw_sp, fib->lpm_tree); in mlxsw_sp_fib_destroy()
539 WARN_ON(!list_empty(&fib->node_list)); in mlxsw_sp_fib_destroy()
540 rhashtable_destroy(&fib->ht); in mlxsw_sp_fib_destroy()
541 kfree(fib); in mlxsw_sp_fib_destroy()
760 const struct mlxsw_sp_fib *fib, u8 tree_id) in mlxsw_sp_vr_lpm_tree_bind() argument
764 mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id, in mlxsw_sp_vr_lpm_tree_bind()
765 (enum mlxsw_reg_ralxx_protocol) fib->proto, in mlxsw_sp_vr_lpm_tree_bind()
771 const struct mlxsw_sp_fib *fib) in mlxsw_sp_vr_lpm_tree_unbind() argument
776 mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id, in mlxsw_sp_vr_lpm_tree_unbind()
777 (enum mlxsw_reg_ralxx_protocol) fib->proto, 0); in mlxsw_sp_vr_lpm_tree_unbind()
925 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_lpm_tree_should_replace() local
929 if (fib->lpm_tree->id == tree_id) in mlxsw_sp_vr_lpm_tree_should_replace()
935 struct mlxsw_sp_fib *fib, in mlxsw_sp_vr_lpm_tree_replace() argument
938 struct mlxsw_sp_lpm_tree *old_tree = fib->lpm_tree; in mlxsw_sp_vr_lpm_tree_replace()
941 fib->lpm_tree = new_tree; in mlxsw_sp_vr_lpm_tree_replace()
943 err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, new_tree->id); in mlxsw_sp_vr_lpm_tree_replace()
951 fib->lpm_tree = old_tree; in mlxsw_sp_vr_lpm_tree_replace()
956 struct mlxsw_sp_fib *fib, in mlxsw_sp_vrs_lpm_tree_replace() argument
959 enum mlxsw_sp_l3proto proto = fib->proto; in mlxsw_sp_vrs_lpm_tree_replace()
1221 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr,
1260 struct mlxsw_sp_fib *fib; in mlxsw_sp_router_ip2me_fib_entry_find() local
1269 fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_router_ip2me_fib_entry_find()
1288 fib_node = mlxsw_sp_fib_node_lookup(fib, addrp, addr_len, in mlxsw_sp_router_ip2me_fib_entry_find()
3101 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_entry_lookup() argument
3106 key.vr_id = fib->vr->id; in mlxsw_sp_nexthop_group_vr_entry_lookup()
3107 key.proto = fib->proto; in mlxsw_sp_nexthop_group_vr_entry_lookup()
3114 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_entry_create() argument
3123 vr_entry->key.vr_id = fib->vr->id; in mlxsw_sp_nexthop_group_vr_entry_create()
3124 vr_entry->key.proto = fib->proto; in mlxsw_sp_nexthop_group_vr_entry_create()
3153 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_link() argument
3157 vr_entry = mlxsw_sp_nexthop_group_vr_entry_lookup(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_link()
3163 return mlxsw_sp_nexthop_group_vr_entry_create(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_link()
3168 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_unlink() argument
3172 vr_entry = mlxsw_sp_nexthop_group_vr_entry_lookup(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_unlink()
5477 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_should_offload()
5664 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_set()
5678 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_clear()
5710 struct mlxsw_sp_fib *fib = fib_entry->fib_node->fib; in mlxsw_sp_fib_entry_ralue_pack() local
5714 proto = (enum mlxsw_reg_ralxx_protocol) fib->proto; in mlxsw_sp_fib_entry_ralue_pack()
5716 switch (fib->proto) { in mlxsw_sp_fib_entry_ralue_pack()
5719 mlxsw_reg_ralue_pack4(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
5724 mlxsw_reg_ralue_pack6(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
6018 fib_node->fib); in mlxsw_sp_fib4_entry_create()
6037 mlxsw_sp_nexthop_group_vr_unlink(fib_entry->nh_group, fib_node->fib); in mlxsw_sp_fib4_entry_create()
6053 fib_node->fib); in mlxsw_sp_fib4_entry_destroy()
6064 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib4_entry_lookup() local
6070 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV4); in mlxsw_sp_fib4_entry_lookup()
6072 fib_node = mlxsw_sp_fib_node_lookup(fib, &fen_info->dst, in mlxsw_sp_fib4_entry_lookup()
6096 static int mlxsw_sp_fib_node_insert(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_insert() argument
6099 return rhashtable_insert_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_insert()
6103 static void mlxsw_sp_fib_node_remove(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_remove() argument
6106 rhashtable_remove_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_remove()
6111 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_lookup() argument
6119 return rhashtable_lookup_fast(&fib->ht, &key, mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_node_lookup()
6123 mlxsw_sp_fib_node_create(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_create() argument
6132 list_add(&fib_node->list, &fib->node_list); in mlxsw_sp_fib_node_create()
6149 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_link() local
6153 lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; in mlxsw_sp_fib_lpm_tree_link()
6160 fib->proto); in mlxsw_sp_fib_lpm_tree_link()
6164 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_link()
6180 struct mlxsw_sp_lpm_tree *lpm_tree = fib_node->fib->lpm_tree; in mlxsw_sp_fib_lpm_tree_unlink()
6182 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_unlink() local
6194 fib->proto); in mlxsw_sp_fib_lpm_tree_unlink()
6198 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_unlink()
6210 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_node_init() argument
6214 err = mlxsw_sp_fib_node_insert(fib, fib_node); in mlxsw_sp_fib_node_init()
6217 fib_node->fib = fib; in mlxsw_sp_fib_node_init()
6226 fib_node->fib = NULL; in mlxsw_sp_fib_node_init()
6227 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_init()
6234 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_node_fini() local
6237 fib_node->fib = NULL; in mlxsw_sp_fib_node_fini()
6238 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_fini()
6247 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_node_get() local
6254 fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_fib_node_get()
6256 fib_node = mlxsw_sp_fib_node_lookup(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
6260 fib_node = mlxsw_sp_fib_node_create(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
6266 err = mlxsw_sp_fib_node_init(mlxsw_sp, fib_node, fib); in mlxsw_sp_fib_node_get()
6282 struct mlxsw_sp_vr *vr = fib_node->fib->vr; in mlxsw_sp_fib_node_put()
6727 mlxsw_sp_nexthop_group_vr_unlink(old_nh_grp, fib_node->fib); in mlxsw_sp_nexthop6_group_update()
6736 fib_node->fib); in mlxsw_sp_nexthop6_group_update()
6755 fib_node->fib); in mlxsw_sp_nexthop6_group_update()
6762 mlxsw_sp_nexthop_group_vr_link(old_nh_grp, fib_node->fib); in mlxsw_sp_nexthop6_group_update()
6924 fib_node->fib); in mlxsw_sp_fib6_entry_create()
6937 mlxsw_sp_nexthop_group_vr_unlink(fib_entry->nh_group, fib_node->fib); in mlxsw_sp_fib6_entry_create()
6966 fib_node->fib); in mlxsw_sp_fib6_entry_destroy()
6979 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib6_entry_lookup() local
6986 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV6); in mlxsw_sp_fib6_entry_lookup()
6988 fib_node = mlxsw_sp_fib_node_lookup(fib, &rt->fib6_dst.addr, in mlxsw_sp_fib6_entry_lookup()
7269 switch (fib_node->fib->proto) { in mlxsw_sp_fib_node_flush()
7283 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_fib_flush() local
7286 list_for_each_entry_safe(fib_node, tmp, &fib->node_list, list) { in mlxsw_sp_vr_fib_flush()
7287 bool do_break = &tmp->list == &fib->node_list; in mlxsw_sp_vr_fib_flush()