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()
3143 struct list_head fib_list; /* list of fib entries that use this group */
3384 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_entry_lookup() argument
3389 key.vr_id = fib->vr->id; in mlxsw_sp_nexthop_group_vr_entry_lookup()
3390 key.proto = fib->proto; in mlxsw_sp_nexthop_group_vr_entry_lookup()
3397 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_entry_create() argument
3406 vr_entry->key.vr_id = fib->vr->id; in mlxsw_sp_nexthop_group_vr_entry_create()
3407 vr_entry->key.proto = fib->proto; in mlxsw_sp_nexthop_group_vr_entry_create()
3436 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_link() argument
3440 vr_entry = mlxsw_sp_nexthop_group_vr_entry_lookup(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_link()
3446 return mlxsw_sp_nexthop_group_vr_entry_create(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_link()
3451 const struct mlxsw_sp_fib *fib) in mlxsw_sp_nexthop_group_vr_unlink() argument
3455 vr_entry = mlxsw_sp_nexthop_group_vr_entry_lookup(nh_grp, fib); in mlxsw_sp_nexthop_group_vr_unlink()
4237 /* The trap was set for fib entries, so we have to call in mlxsw_sp_nexthop_group_refresh()
4238 * fib entry update to unset it and use adjacency index. in mlxsw_sp_nexthop_group_refresh()
4242 dev_warn(mlxsw_sp->bus_info->dev, "Failed to add adjacency index to fib entries.\n"); in mlxsw_sp_nexthop_group_refresh()
4268 dev_warn(mlxsw_sp->bus_info->dev, "Failed to set traps for fib entries.\n"); in mlxsw_sp_nexthop_group_refresh()
5947 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_should_offload()
6135 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_set()
6149 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_clear()
6181 struct mlxsw_sp_fib *fib = fib_entry->fib_node->fib; in mlxsw_sp_fib_entry_ralue_pack() local
6185 proto = (enum mlxsw_reg_ralxx_protocol) fib->proto; in mlxsw_sp_fib_entry_ralue_pack()
6187 switch (fib->proto) { in mlxsw_sp_fib_entry_ralue_pack()
6190 mlxsw_reg_ralue_pack4(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
6195 mlxsw_reg_ralue_pack6(ralue_pl, proto, op, fib->vr->id, in mlxsw_sp_fib_entry_ralue_pack()
6490 fib_node->fib); in mlxsw_sp_fib4_entry_create()
6509 mlxsw_sp_nexthop_group_vr_unlink(fib_entry->nh_group, fib_node->fib); in mlxsw_sp_fib4_entry_create()
6525 fib_node->fib); in mlxsw_sp_fib4_entry_destroy()
6536 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib4_entry_lookup() local
6542 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV4); in mlxsw_sp_fib4_entry_lookup()
6544 fib_node = mlxsw_sp_fib_node_lookup(fib, &fen_info->dst, in mlxsw_sp_fib4_entry_lookup()
6568 static int mlxsw_sp_fib_node_insert(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_insert() argument
6571 return rhashtable_insert_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_insert()
6575 static void mlxsw_sp_fib_node_remove(struct mlxsw_sp_fib *fib, in mlxsw_sp_fib_node_remove() argument
6578 rhashtable_remove_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_remove()
6583 mlxsw_sp_fib_node_lookup(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_lookup() argument
6591 return rhashtable_lookup_fast(&fib->ht, &key, mlxsw_sp_fib_ht_params); in mlxsw_sp_fib_node_lookup()
6595 mlxsw_sp_fib_node_create(struct mlxsw_sp_fib *fib, const void *addr, in mlxsw_sp_fib_node_create() argument
6604 list_add(&fib_node->list, &fib->node_list); in mlxsw_sp_fib_node_create()
6621 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_link() local
6625 lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; in mlxsw_sp_fib_lpm_tree_link()
6632 fib->proto); in mlxsw_sp_fib_lpm_tree_link()
6636 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_link()
6652 struct mlxsw_sp_lpm_tree *lpm_tree = fib_node->fib->lpm_tree; in mlxsw_sp_fib_lpm_tree_unlink()
6654 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_unlink() local
6666 fib->proto); in mlxsw_sp_fib_lpm_tree_unlink()
6670 err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); in mlxsw_sp_fib_lpm_tree_unlink()
6682 struct mlxsw_sp_fib *fib) in mlxsw_sp_fib_node_init() argument
6686 err = mlxsw_sp_fib_node_insert(fib, fib_node); in mlxsw_sp_fib_node_init()
6689 fib_node->fib = fib; in mlxsw_sp_fib_node_init()
6698 fib_node->fib = NULL; in mlxsw_sp_fib_node_init()
6699 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_init()
6706 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_node_fini() local
6709 fib_node->fib = NULL; in mlxsw_sp_fib_node_fini()
6710 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_fini()
6719 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib_node_get() local
6726 fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_fib_node_get()
6728 fib_node = mlxsw_sp_fib_node_lookup(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
6732 fib_node = mlxsw_sp_fib_node_create(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
6738 err = mlxsw_sp_fib_node_init(mlxsw_sp, fib_node, fib); in mlxsw_sp_fib_node_get()
6754 struct mlxsw_sp_vr *vr = fib_node->fib->vr; in mlxsw_sp_fib_node_put()
6827 dev_warn(mlxsw_sp->bus_info->dev, "Failed to get FIB node\n"); in mlxsw_sp_router_fib4_replace()
6833 dev_warn(mlxsw_sp->bus_info->dev, "Failed to create FIB entry\n"); in mlxsw_sp_router_fib4_replace()
6847 dev_warn(mlxsw_sp->bus_info->dev, "Failed to link FIB entry to node\n"); in mlxsw_sp_router_fib4_replace()
7202 mlxsw_sp_nexthop_group_vr_unlink(old_nh_grp, fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7211 fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7230 fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7237 mlxsw_sp_nexthop_group_vr_link(old_nh_grp, fib_node->fib); in mlxsw_sp_nexthop6_group_update()
7399 fib_node->fib); in mlxsw_sp_fib6_entry_create()
7412 mlxsw_sp_nexthop_group_vr_unlink(fib_entry->nh_group, fib_node->fib); in mlxsw_sp_fib6_entry_create()
7441 fib_node->fib); in mlxsw_sp_fib6_entry_destroy()
7454 struct mlxsw_sp_fib *fib; in mlxsw_sp_fib6_entry_lookup() local
7461 fib = mlxsw_sp_vr_fib(vr, MLXSW_SP_L3_PROTO_IPV6); in mlxsw_sp_fib6_entry_lookup()
7463 fib_node = mlxsw_sp_fib_node_lookup(fib, &rt->fib6_dst.addr, in mlxsw_sp_fib6_entry_lookup()
7618 /* Multipath routes are first added to the FIB trie and only then in mlxsw_sp_router_fib6_del()
7744 switch (fib_node->fib->proto) { in mlxsw_sp_fib_node_flush()
7758 struct mlxsw_sp_fib *fib = mlxsw_sp_vr_fib(vr, proto); in mlxsw_sp_vr_fib_flush() local
7761 list_for_each_entry_safe(fib_node, tmp, &fib->node_list, list) { in mlxsw_sp_vr_fib_flush()
7762 bool do_break = &tmp->list == &fib->node_list; in mlxsw_sp_vr_fib_flush()
7877 dev_warn(mlxsw_sp->bus_info->dev, "FIB replace failed.\n"); in mlxsw_sp_router_fib4_event_work()
7915 dev_warn(mlxsw_sp->bus_info->dev, "FIB replace failed.\n"); in mlxsw_sp_router_fib6_event_work()
7927 dev_warn(mlxsw_sp->bus_info->dev, "FIB append failed.\n"); in mlxsw_sp_router_fib6_event_work()
8097 NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported"); in mlxsw_sp_router_fib_rule_event()
11210 /* Flush pending FIB notifications and then flush the device's in mlxsw_sp_router_fib_dump_flush()
11211 * table before requesting another dump. The FIB notification in mlxsw_sp_router_fib_dump_flush()