Lines Matching full:fib
168 const struct mlxsw_sp_fib *fib,
171 const struct mlxsw_sp_fib *fib);
451 * because that's a type of next hop, not of FIB entry. (There can be
467 struct mlxsw_sp_fib *fib; member
521 u32 tb_id; /* kernel fib table id */
537 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_create() local
541 fib = kzalloc(sizeof(*fib), GFP_KERNEL); in mlxsw_sp_fib_create()
542 if (!fib) in mlxsw_sp_fib_create()
544 err = rhashtable_init(&fib->ht, &mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_create()
547 INIT_LIST_HEAD(&fib->node_list); in mlxsw_sp_fib_create()
548 fib->proto = proto; in mlxsw_sp_fib_create()
549 fib->vr = vr; in mlxsw_sp_fib_create()
550 fib->lpm_tree = lpm_tree; in mlxsw_sp_fib_create()
552 err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, lpm_tree->id); in mlxsw_sp_fib_create()
555 return fib; in mlxsw_sp_fib_create()
560 kfree(fib); in mlxsw_sp_fib_create()
565 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_destroy() argument
567 mlxsw_sp_vr_lpm_tree_unbind(mlxsw_sp, fib); in mlxsw_sp_fib_destroy()
568 mlxsw_sp_lpm_tree_put(mlxsw_sp, fib->lpm_tree); in mlxsw_sp_fib_destroy()
569 WARN_ON(!list_empty(&fib->node_list)); in mlxsw_sp_fib_destroy()
570 rhashtable_destroy(&fib->ht); in mlxsw_sp_fib_destroy()
571 kfree(fib); in mlxsw_sp_fib_destroy()
792 const struct mlxsw_sp_fib *fib, u8 tree_id) in mlxsw_sp_vr_lpm_tree_bind() argument
796 mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id, in mlxsw_sp_vr_lpm_tree_bind()
797 (enum mlxsw_reg_ralxx_protocol) fib->proto, in mlxsw_sp_vr_lpm_tree_bind()
803 const struct mlxsw_sp_fib *fib) in mlxsw_sp_vr_lpm_tree_unbind() argument
808 mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id, in mlxsw_sp_vr_lpm_tree_unbind()
809 (enum mlxsw_reg_ralxx_protocol) fib->proto, 0); in mlxsw_sp_vr_lpm_tree_unbind()
958 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_lpm_tree_should_replace() local
962 if (fib->lpm_tree->id == tree_id) in mlxsw_sp_vr_lpm_tree_should_replace()
968 struct mlxsw_sp_fib *fib, in mlxsw_sp_vr_lpm_tree_replace() argument
971 struct mlxsw_sp_lpm_tree *old_tree = fib->lpm_tree; in mlxsw_sp_vr_lpm_tree_replace()
974 fib->lpm_tree = new_tree; in mlxsw_sp_vr_lpm_tree_replace()
976 err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, new_tree->id); in mlxsw_sp_vr_lpm_tree_replace()
984 fib->lpm_tree = old_tree; in mlxsw_sp_vr_lpm_tree_replace()
989 struct mlxsw_sp_fib *fib, in mlxsw_sp_vrs_lpm_tree_replace() argument
993 enum mlxsw_sp_l3proto proto = fib->proto; in mlxsw_sp_vrs_lpm_tree_replace()
1059 * FIB notifications and the work queue is free from FIBs in mlxsw_sp_vrs_fini()
1311 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr,
1350 struct mlxsw_sp_fib *fib; in mlxsw_sp_router_ip2me_fib_entry_find() local
1359 fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_router_ip2me_fib_entry_find()
1378 fib_node = mlxsw_sp_fib_node_lookup(fib, addrp, addr_len, in mlxsw_sp_router_ip2me_fib_entry_find()
3146 struct list_head fib_list; /* list of fib entries that use this group */
3387 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_entry_lookup() argument
3392 key.vr_id = fib->vr->id; in mlxsw_sp_nexthop_group_vr_entry_lookup()
3393 key.proto = fib->proto; in mlxsw_sp_nexthop_group_vr_entry_lookup()
3400 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_entry_create() argument
3409 vr_entry->key.vr_id = fib->vr->id; in mlxsw_sp_nexthop_group_vr_entry_create()
3410 vr_entry->key.proto = fib->proto; in mlxsw_sp_nexthop_group_vr_entry_create()
3439 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_link() argument
3443 vr_entry = mlxsw_sp_nexthop_group_vr_entry_lookup(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_link()
3449 return mlxsw_sp_nexthop_group_vr_entry_create(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_link()
3454 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_unlink() argument
3458 vr_entry = mlxsw_sp_nexthop_group_vr_entry_lookup(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_unlink()
4240 /* The trap was set for fib entries, so we have to call in mlxsw_sp_nexthop_group_refresh()
4241 * fib entry update to unset it and use adjacency index. in mlxsw_sp_nexthop_group_refresh()
4245 dev_warn(mlxsw_sp->bus_info->dev, "Failed to add adjacency index to fib entries.\n"); in mlxsw_sp_nexthop_group_refresh()
4271 dev_warn(mlxsw_sp->bus_info->dev, "Failed to set traps for fib entries.\n"); in mlxsw_sp_nexthop_group_refresh()
5950 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_should_offload()
6138 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_set()
6152 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_clear()
6184 struct mlxsw_sp_fib *fib = fib_entry->fib_node->fib; in mlxsw_sp_fib_entry_ralue_pack() local
6188 proto = (enum mlxsw_reg_ralxx_protocol) fib->proto; in mlxsw_sp_fib_entry_ralue_pack()
6190 switch (fib->proto) { in mlxsw_sp_fib_entry_ralue_pack()
6193 mlxsw_reg_ralue_pack4(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
6198 mlxsw_reg_ralue_pack6(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
6493 fib_node->fib); in mlxsw_sp_fib4_entry_create()
6512 mlxsw_sp_nexthop_group_vr_unlink(fib_entry->nh_group, fib_node->fib); in mlxsw_sp_fib4_entry_create()
6528 fib_node->fib); in mlxsw_sp_fib4_entry_destroy()
6539 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib4_entry_lookup() local
6545 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV4); in mlxsw_sp_fib4_entry_lookup()
6547 fib_node = mlxsw_sp_fib_node_lookup(fib, &fen_info->dst, in mlxsw_sp_fib4_entry_lookup()
6571 static int mlxsw_sp_fib_node_insert(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_insert() argument
6574 return rhashtable_insert_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_insert()
6578 static void mlxsw_sp_fib_node_remove(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_remove() argument
6581 rhashtable_remove_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_remove()
6586 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_lookup() argument
6594 return rhashtable_lookup_fast(&fib->ht, &key, mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_node_lookup()
6598 mlxsw_sp_fib_node_create(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_create() argument
6607 list_add(&fib_node->list, &fib->node_list); in mlxsw_sp_fib_node_create()
6624 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_link() local
6628 lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; in mlxsw_sp_fib_lpm_tree_link()
6635 fib->proto); in mlxsw_sp_fib_lpm_tree_link()
6639 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_link()
6655 struct mlxsw_sp_lpm_tree *lpm_tree = fib_node->fib->lpm_tree; in mlxsw_sp_fib_lpm_tree_unlink()
6657 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_unlink() local
6669 fib->proto); in mlxsw_sp_fib_lpm_tree_unlink()
6673 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_unlink()
6685 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_node_init() argument
6689 err = mlxsw_sp_fib_node_insert(fib, fib_node); in mlxsw_sp_fib_node_init()
6692 fib_node->fib = fib; in mlxsw_sp_fib_node_init()
6701 fib_node->fib = NULL; in mlxsw_sp_fib_node_init()
6702 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_init()
6709 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_node_fini() local
6712 fib_node->fib = NULL; in mlxsw_sp_fib_node_fini()
6713 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_fini()
6722 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_node_get() local
6729 fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_fib_node_get()
6731 fib_node = mlxsw_sp_fib_node_lookup(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
6735 fib_node = mlxsw_sp_fib_node_create(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
6741 err = mlxsw_sp_fib_node_init(mlxsw_sp, fib_node, fib); in mlxsw_sp_fib_node_get()
6757 struct mlxsw_sp_vr *vr = fib_node->fib->vr; in mlxsw_sp_fib_node_put()
6830 dev_warn(mlxsw_sp->bus_info->dev, "Failed to get FIB node\n"); in mlxsw_sp_router_fib4_replace()
6836 dev_warn(mlxsw_sp->bus_info->dev, "Failed to create FIB entry\n"); in mlxsw_sp_router_fib4_replace()
6850 dev_warn(mlxsw_sp->bus_info->dev, "Failed to link FIB entry to node\n"); in mlxsw_sp_router_fib4_replace()
7205 mlxsw_sp_nexthop_group_vr_unlink(old_nh_grp, fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7214 fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7233 fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7240 mlxsw_sp_nexthop_group_vr_link(old_nh_grp, fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7402 fib_node->fib); in mlxsw_sp_fib6_entry_create()
7415 mlxsw_sp_nexthop_group_vr_unlink(fib_entry->nh_group, fib_node->fib); in mlxsw_sp_fib6_entry_create()
7444 fib_node->fib); in mlxsw_sp_fib6_entry_destroy()
7457 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib6_entry_lookup() local
7464 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV6); in mlxsw_sp_fib6_entry_lookup()
7466 fib_node = mlxsw_sp_fib_node_lookup(fib, &rt->fib6_dst.addr, in mlxsw_sp_fib6_entry_lookup()
7621 /* Multipath routes are first added to the FIB trie and only then in mlxsw_sp_router_fib6_del()
7747 switch (fib_node->fib->proto) { in mlxsw_sp_fib_node_flush()
7761 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_fib_flush() local
7764 list_for_each_entry_safe(fib_node, tmp, &fib->node_list, list) { in mlxsw_sp_vr_fib_flush()
7765 bool do_break = &tmp->list == &fib->node_list; in mlxsw_sp_vr_fib_flush()
7880 dev_warn(mlxsw_sp->bus_info->dev, "FIB replace failed.\n"); in mlxsw_sp_router_fib4_event_work()
7918 dev_warn(mlxsw_sp->bus_info->dev, "FIB replace failed.\n"); in mlxsw_sp_router_fib6_event_work()
7930 dev_warn(mlxsw_sp->bus_info->dev, "FIB append failed.\n"); in mlxsw_sp_router_fib6_event_work()
8100 NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported"); in mlxsw_sp_router_fib_rule_event()
11165 /* Flush pending FIB notifications and then flush the device's in mlxsw_sp_router_fib_dump_flush()
11166 * table before requesting another dump. The FIB notification in mlxsw_sp_router_fib_dump_flush()