Lines Matching refs:fib_node

372 	struct mlxsw_sp_fib_node *fib_node;  member
1147 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_router_ip2me_fib_entry_find() local
1173 fib_node = mlxsw_sp_fib_node_lookup(fib, addrp, addr_len, in mlxsw_sp_router_ip2me_fib_entry_find()
1175 if (!fib_node || fib_node->fib_entry->type != type) in mlxsw_sp_router_ip2me_fib_entry_find()
1178 return fib_node->fib_entry; in mlxsw_sp_router_ip2me_fib_entry_find()
1186 static struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_ipip_entry_find_decap() local
1220 fib_node = mlxsw_sp_fib_node_lookup(ul_fib, saddrp, saddr_len, in mlxsw_sp_ipip_entry_find_decap()
1222 if (!fib_node || in mlxsw_sp_ipip_entry_find_decap()
1223 fib_node->fib_entry->type != MLXSW_SP_FIB_ENTRY_TYPE_TRAP) in mlxsw_sp_ipip_entry_find_decap()
1226 return fib_node->fib_entry; in mlxsw_sp_ipip_entry_find_decap()
3154 if (fib == fib_entry->fib_node->fib) in mlxsw_sp_adj_index_mass_update()
3156 fib = fib_entry->fib_node->fib; in mlxsw_sp_adj_index_mass_update()
4112 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_should_offload()
4160 u32 *p_dst = (u32 *) fib_entry->fib_node->key.addr; in mlxsw_sp_fib4_entry_hw_flags_set()
4161 int dst_len = fib_entry->fib_node->key.prefix_len; in mlxsw_sp_fib4_entry_hw_flags_set()
4185 u32 *p_dst = (u32 *) fib_entry->fib_node->key.addr; in mlxsw_sp_fib4_entry_hw_flags_clear()
4186 int dst_len = fib_entry->fib_node->key.prefix_len; in mlxsw_sp_fib4_entry_hw_flags_clear()
4240 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_set()
4254 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_clear()
4286 struct mlxsw_sp_fib *fib = fib_entry->fib_node->fib; in mlxsw_sp_fib_entry_ralue_pack()
4294 p_dip = (u32 *) fib_entry->fib_node->key.addr; in mlxsw_sp_fib_entry_ralue_pack()
4296 fib_entry->fib_node->key.prefix_len, in mlxsw_sp_fib_entry_ralue_pack()
4301 fib_entry->fib_node->key.prefix_len, in mlxsw_sp_fib_entry_ralue_pack()
4302 fib_entry->fib_node->key.addr); in mlxsw_sp_fib_entry_ralue_pack()
4599 struct mlxsw_sp_fib_node *fib_node, in mlxsw_sp_fib4_entry_create() argument
4624 fib_entry->fib_node = fib_node; in mlxsw_sp_fib4_entry_create()
4648 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_fib4_entry_lookup() local
4657 fib_node = mlxsw_sp_fib_node_lookup(fib, &fen_info->dst, in mlxsw_sp_fib4_entry_lookup()
4660 if (!fib_node) in mlxsw_sp_fib4_entry_lookup()
4663 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_entry_lookup()
4683 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_node_insert() argument
4685 return rhashtable_insert_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_insert()
4690 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_node_remove() argument
4692 rhashtable_remove_fast(&fib->ht, &fib_node->ht_node, in mlxsw_sp_fib_node_remove()
4712 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_fib_node_create() local
4714 fib_node = kzalloc(sizeof(*fib_node), GFP_KERNEL); in mlxsw_sp_fib_node_create()
4715 if (!fib_node) in mlxsw_sp_fib_node_create()
4718 list_add(&fib_node->list, &fib->node_list); in mlxsw_sp_fib_node_create()
4719 memcpy(fib_node->key.addr, addr, addr_len); in mlxsw_sp_fib_node_create()
4720 fib_node->key.prefix_len = prefix_len; in mlxsw_sp_fib_node_create()
4722 return fib_node; in mlxsw_sp_fib_node_create()
4725 static void mlxsw_sp_fib_node_destroy(struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_node_destroy() argument
4727 list_del(&fib_node->list); in mlxsw_sp_fib_node_destroy()
4728 kfree(fib_node); in mlxsw_sp_fib_node_destroy()
4732 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_lpm_tree_link() argument
4735 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_link()
4740 if (lpm_tree->prefix_ref_count[fib_node->key.prefix_len] != 0) in mlxsw_sp_fib_lpm_tree_link()
4744 mlxsw_sp_prefix_usage_set(&req_prefix_usage, fib_node->key.prefix_len); in mlxsw_sp_fib_lpm_tree_link()
4755 lpm_tree->prefix_ref_count[fib_node->key.prefix_len]++; in mlxsw_sp_fib_lpm_tree_link()
4764 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_lpm_tree_unlink() argument
4766 struct mlxsw_sp_lpm_tree *lpm_tree = fib_node->fib->lpm_tree; in mlxsw_sp_fib_lpm_tree_unlink()
4768 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_lpm_tree_unlink()
4771 if (--lpm_tree->prefix_ref_count[fib_node->key.prefix_len] != 0) in mlxsw_sp_fib_lpm_tree_unlink()
4778 fib_node->key.prefix_len); in mlxsw_sp_fib_lpm_tree_unlink()
4795 struct mlxsw_sp_fib_node *fib_node, in mlxsw_sp_fib_node_init() argument
4800 err = mlxsw_sp_fib_node_insert(fib, fib_node); in mlxsw_sp_fib_node_init()
4803 fib_node->fib = fib; in mlxsw_sp_fib_node_init()
4805 err = mlxsw_sp_fib_lpm_tree_link(mlxsw_sp, fib_node); in mlxsw_sp_fib_node_init()
4812 fib_node->fib = NULL; in mlxsw_sp_fib_node_init()
4813 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_init()
4818 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_node_fini() argument
4820 struct mlxsw_sp_fib *fib = fib_node->fib; in mlxsw_sp_fib_node_fini()
4822 mlxsw_sp_fib_lpm_tree_unlink(mlxsw_sp, fib_node); in mlxsw_sp_fib_node_fini()
4823 fib_node->fib = NULL; in mlxsw_sp_fib_node_fini()
4824 mlxsw_sp_fib_node_remove(fib, fib_node); in mlxsw_sp_fib_node_fini()
4832 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_fib_node_get() local
4842 fib_node = mlxsw_sp_fib_node_lookup(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
4843 if (fib_node) in mlxsw_sp_fib_node_get()
4844 return fib_node; in mlxsw_sp_fib_node_get()
4846 fib_node = mlxsw_sp_fib_node_create(fib, addr, addr_len, prefix_len); in mlxsw_sp_fib_node_get()
4847 if (!fib_node) { in mlxsw_sp_fib_node_get()
4852 err = mlxsw_sp_fib_node_init(mlxsw_sp, fib_node, fib); in mlxsw_sp_fib_node_get()
4856 return fib_node; in mlxsw_sp_fib_node_get()
4859 mlxsw_sp_fib_node_destroy(fib_node); in mlxsw_sp_fib_node_get()
4866 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_node_put() argument
4868 struct mlxsw_sp_vr *vr = fib_node->fib->vr; in mlxsw_sp_fib_node_put()
4870 if (fib_node->fib_entry) in mlxsw_sp_fib_node_put()
4872 mlxsw_sp_fib_node_fini(mlxsw_sp, fib_node); in mlxsw_sp_fib_node_put()
4873 mlxsw_sp_fib_node_destroy(fib_node); in mlxsw_sp_fib_node_put()
4880 struct mlxsw_sp_fib_node *fib_node = fib_entry->fib_node; in mlxsw_sp_fib_node_entry_link() local
4883 fib_node->fib_entry = fib_entry; in mlxsw_sp_fib_node_entry_link()
4892 fib_node->fib_entry = NULL; in mlxsw_sp_fib_node_entry_link()
4900 struct mlxsw_sp_fib_node *fib_node = fib_entry->fib_node; in mlxsw_sp_fib_node_entry_unlink() local
4903 fib_node->fib_entry = NULL; in mlxsw_sp_fib_node_entry_unlink()
4908 struct mlxsw_sp_fib_node *fib_node = fib4_entry->common.fib_node; in mlxsw_sp_fib4_allow_replace() local
4911 if (!fib_node->fib_entry) in mlxsw_sp_fib4_allow_replace()
4914 fib4_replaced = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_allow_replace()
4929 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_router_fib4_replace() local
4935 fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, fen_info->tb_id, in mlxsw_sp_router_fib4_replace()
4939 if (IS_ERR(fib_node)) { in mlxsw_sp_router_fib4_replace()
4941 return PTR_ERR(fib_node); in mlxsw_sp_router_fib4_replace()
4944 fib4_entry = mlxsw_sp_fib4_entry_create(mlxsw_sp, fib_node, fen_info); in mlxsw_sp_router_fib4_replace()
4953 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib4_replace()
4957 replaced = fib_node->fib_entry; in mlxsw_sp_router_fib4_replace()
4976 fib_node->fib_entry = replaced; in mlxsw_sp_router_fib4_replace()
4979 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib4_replace()
4987 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_router_fib4_del() local
4995 fib_node = fib4_entry->common.fib_node; in mlxsw_sp_router_fib4_del()
4999 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib4_del()
5399 struct mlxsw_sp_fib_node *fib_node, in mlxsw_sp_fib6_entry_create() argument
5430 fib_entry->fib_node = fib_node; in mlxsw_sp_fib6_entry_create()
5462 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_fib6_entry_lookup() local
5472 fib_node = mlxsw_sp_fib_node_lookup(fib, &rt->fib6_dst.addr, in mlxsw_sp_fib6_entry_lookup()
5475 if (!fib_node) in mlxsw_sp_fib6_entry_lookup()
5478 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_entry_lookup()
5491 struct mlxsw_sp_fib_node *fib_node = fib6_entry->common.fib_node; in mlxsw_sp_fib6_allow_replace() local
5495 if (!fib_node->fib_entry) in mlxsw_sp_fib6_allow_replace()
5498 fib6_replaced = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_allow_replace()
5516 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_router_fib6_replace() local
5529 fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, rt->fib6_table->tb6_id, in mlxsw_sp_router_fib6_replace()
5534 if (IS_ERR(fib_node)) in mlxsw_sp_router_fib6_replace()
5535 return PTR_ERR(fib_node); in mlxsw_sp_router_fib6_replace()
5537 fib6_entry = mlxsw_sp_fib6_entry_create(mlxsw_sp, fib_node, rt_arr, in mlxsw_sp_router_fib6_replace()
5546 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib6_replace()
5550 replaced = fib_node->fib_entry; in mlxsw_sp_router_fib6_replace()
5567 fib_node->fib_entry = replaced; in mlxsw_sp_router_fib6_replace()
5570 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib6_replace()
5579 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_router_fib6_append() local
5592 fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, rt->fib6_table->tb6_id, in mlxsw_sp_router_fib6_append()
5597 if (IS_ERR(fib_node)) in mlxsw_sp_router_fib6_append()
5598 return PTR_ERR(fib_node); in mlxsw_sp_router_fib6_append()
5600 if (WARN_ON_ONCE(!fib_node->fib_entry)) { in mlxsw_sp_router_fib6_append()
5601 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib6_append()
5605 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_router_fib6_append()
5615 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib6_append()
5624 struct mlxsw_sp_fib_node *fib_node; in mlxsw_sp_router_fib6_del() local
5651 fib_node = fib6_entry->common.fib_node; in mlxsw_sp_router_fib6_del()
5655 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_router_fib6_del()
5805 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib4_node_flush() argument
5809 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_node_flush()
5811 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, fib_node->fib_entry); in mlxsw_sp_fib4_node_flush()
5813 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_fib4_node_flush()
5817 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib6_node_flush() argument
5821 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_node_flush()
5823 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, fib_node->fib_entry); in mlxsw_sp_fib6_node_flush()
5825 mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); in mlxsw_sp_fib6_node_flush()
5829 struct mlxsw_sp_fib_node *fib_node) in mlxsw_sp_fib_node_flush() argument
5831 switch (fib_node->fib->proto) { in mlxsw_sp_fib_node_flush()
5833 mlxsw_sp_fib4_node_flush(mlxsw_sp, fib_node); in mlxsw_sp_fib_node_flush()
5836 mlxsw_sp_fib6_node_flush(mlxsw_sp, fib_node); in mlxsw_sp_fib_node_flush()
5846 struct mlxsw_sp_fib_node *fib_node, *tmp; in mlxsw_sp_vr_fib_flush() local
5848 list_for_each_entry_safe(fib_node, tmp, &fib->node_list, list) { in mlxsw_sp_vr_fib_flush()
5851 mlxsw_sp_fib_node_flush(mlxsw_sp, fib_node); in mlxsw_sp_vr_fib_flush()