Lines Matching refs:fib_entry
359 struct mlxsw_sp_fib_entry *fib_entry; member
1082 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_decap_init() argument
1093 ipip_entry->decap_fib_entry = fib_entry; in mlxsw_sp_fib_entry_decap_init()
1094 fib_entry->decap.ipip_entry = ipip_entry; in mlxsw_sp_fib_entry_decap_init()
1095 fib_entry->decap.tunnel_index = tunnel_index; in mlxsw_sp_fib_entry_decap_init()
1100 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_entry_decap_fini() argument
1103 fib_entry->decap.ipip_entry->decap_fib_entry = NULL; in mlxsw_sp_fib_entry_decap_fini()
1104 fib_entry->decap.ipip_entry = NULL; in mlxsw_sp_fib_entry_decap_fini()
1106 1, fib_entry->decap.tunnel_index); in mlxsw_sp_fib_entry_decap_fini()
1113 struct mlxsw_sp_fib_entry *fib_entry);
1119 struct mlxsw_sp_fib_entry *fib_entry = ipip_entry->decap_fib_entry; in mlxsw_sp_ipip_entry_demote_decap() local
1121 mlxsw_sp_fib_entry_decap_fini(mlxsw_sp, fib_entry); in mlxsw_sp_ipip_entry_demote_decap()
1122 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_TRAP; in mlxsw_sp_ipip_entry_demote_decap()
1124 mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); in mlxsw_sp_ipip_entry_demote_decap()
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()
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()
1861 struct mlxsw_sp_fib_entry *fib_entry; in mlxsw_sp_router_nve_promote_decap() local
1880 fib_entry = mlxsw_sp_router_ip2me_fib_entry_find(mlxsw_sp, ul_tb_id, in mlxsw_sp_router_nve_promote_decap()
1883 if (!fib_entry) in mlxsw_sp_router_nve_promote_decap()
1886 fib_entry->decap.tunnel_index = tunnel_index; in mlxsw_sp_router_nve_promote_decap()
1887 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_NVE_DECAP; in mlxsw_sp_router_nve_promote_decap()
1889 err = mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); in mlxsw_sp_router_nve_promote_decap()
1896 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_TRAP; in mlxsw_sp_router_nve_promote_decap()
1897 mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); in mlxsw_sp_router_nve_promote_decap()
1909 struct mlxsw_sp_fib_entry *fib_entry; in mlxsw_sp_router_nve_demote_decap() local
1918 fib_entry = mlxsw_sp_router_ip2me_fib_entry_find(mlxsw_sp, ul_tb_id, in mlxsw_sp_router_nve_demote_decap()
1921 if (!fib_entry) in mlxsw_sp_router_nve_demote_decap()
1924 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_TRAP; in mlxsw_sp_router_nve_demote_decap()
1925 mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); in mlxsw_sp_router_nve_demote_decap()
3152 struct mlxsw_sp_fib_entry *fib_entry; in mlxsw_sp_adj_index_mass_update() local
3156 list_for_each_entry(fib_entry, &nh_grp->fib_list, nexthop_group_node) { in mlxsw_sp_adj_index_mass_update()
3157 if (fib == fib_entry->fib_node->fib) in mlxsw_sp_adj_index_mass_update()
3159 fib = fib_entry->fib_node->fib; in mlxsw_sp_adj_index_mass_update()
3277 struct mlxsw_sp_fib_entry *fib_entry; in mlxsw_sp_nexthop_fib_entries_update() local
3280 list_for_each_entry(fib_entry, &nh_grp->fib_list, nexthop_group_node) { in mlxsw_sp_nexthop_fib_entries_update()
3281 err = mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); in mlxsw_sp_nexthop_fib_entries_update()
4073 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_nexthop4_group_get() argument
4084 list_add_tail(&fib_entry->nexthop_group_node, &nh_grp->fib_list); in mlxsw_sp_nexthop4_group_get()
4085 fib_entry->nh_group = nh_grp; in mlxsw_sp_nexthop4_group_get()
4090 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_nexthop4_group_put() argument
4092 struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group; in mlxsw_sp_nexthop4_group_put()
4094 list_del(&fib_entry->nexthop_group_node); in mlxsw_sp_nexthop4_group_put()
4101 mlxsw_sp_fib4_entry_should_offload(const struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib4_entry_should_offload() argument
4105 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_should_offload()
4111 mlxsw_sp_fib_entry_should_offload(const struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_entry_should_offload() argument
4113 struct mlxsw_sp_nexthop_group *nh_group = fib_entry->nh_group; in mlxsw_sp_fib_entry_should_offload()
4115 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_should_offload()
4117 if (!mlxsw_sp_fib4_entry_should_offload(fib_entry)) in mlxsw_sp_fib_entry_should_offload()
4124 switch (fib_entry->type) { in mlxsw_sp_fib_entry_should_offload()
4160 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib4_entry_hw_flags_set() argument
4162 struct fib_info *fi = mlxsw_sp_nexthop4_group_fi(fib_entry->nh_group); in mlxsw_sp_fib4_entry_hw_flags_set()
4163 u32 *p_dst = (u32 *) fib_entry->fib_node->key.addr; in mlxsw_sp_fib4_entry_hw_flags_set()
4164 int dst_len = fib_entry->fib_node->key.prefix_len; in mlxsw_sp_fib4_entry_hw_flags_set()
4169 should_offload = mlxsw_sp_fib_entry_should_offload(fib_entry); in mlxsw_sp_fib4_entry_hw_flags_set()
4170 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_set()
4185 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib4_entry_hw_flags_clear() argument
4187 struct fib_info *fi = mlxsw_sp_nexthop4_group_fi(fib_entry->nh_group); in mlxsw_sp_fib4_entry_hw_flags_clear()
4188 u32 *p_dst = (u32 *) fib_entry->fib_node->key.addr; in mlxsw_sp_fib4_entry_hw_flags_clear()
4189 int dst_len = fib_entry->fib_node->key.prefix_len; in mlxsw_sp_fib4_entry_hw_flags_clear()
4193 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_clear()
4208 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib6_entry_hw_flags_set() argument
4214 should_offload = mlxsw_sp_fib_entry_should_offload(fib_entry); in mlxsw_sp_fib6_entry_hw_flags_set()
4219 fib6_entry = container_of(fib_entry, struct mlxsw_sp_fib6_entry, in mlxsw_sp_fib6_entry_hw_flags_set()
4228 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib6_entry_hw_flags_clear() argument
4233 fib6_entry = container_of(fib_entry, struct mlxsw_sp_fib6_entry, in mlxsw_sp_fib6_entry_hw_flags_clear()
4241 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_entry_hw_flags_set() argument
4243 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_set()
4245 mlxsw_sp_fib4_entry_hw_flags_set(mlxsw_sp, fib_entry); in mlxsw_sp_fib_entry_hw_flags_set()
4248 mlxsw_sp_fib6_entry_hw_flags_set(mlxsw_sp, fib_entry); in mlxsw_sp_fib_entry_hw_flags_set()
4255 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_entry_hw_flags_clear() argument
4257 switch (fib_entry->fib_node->fib->proto) { in mlxsw_sp_fib_entry_hw_flags_clear()
4259 mlxsw_sp_fib4_entry_hw_flags_clear(mlxsw_sp, fib_entry); in mlxsw_sp_fib_entry_hw_flags_clear()
4262 mlxsw_sp_fib6_entry_hw_flags_clear(mlxsw_sp, fib_entry); in mlxsw_sp_fib_entry_hw_flags_clear()
4269 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_hw_flags_refresh() argument
4274 mlxsw_sp_fib_entry_hw_flags_set(mlxsw_sp, fib_entry); in mlxsw_sp_fib_entry_hw_flags_refresh()
4277 mlxsw_sp_fib_entry_hw_flags_clear(mlxsw_sp, fib_entry); in mlxsw_sp_fib_entry_hw_flags_refresh()
4286 const struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_ralue_pack() argument
4289 struct mlxsw_sp_fib *fib = fib_entry->fib_node->fib; in mlxsw_sp_fib_entry_ralue_pack()
4297 p_dip = (u32 *) fib_entry->fib_node->key.addr; in mlxsw_sp_fib_entry_ralue_pack()
4299 fib_entry->fib_node->key.prefix_len, in mlxsw_sp_fib_entry_ralue_pack()
4304 fib_entry->fib_node->key.prefix_len, in mlxsw_sp_fib_entry_ralue_pack()
4305 fib_entry->fib_node->key.addr); in mlxsw_sp_fib_entry_ralue_pack()
4344 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_remote() argument
4347 struct mlxsw_sp_nexthop_group *nh_group = fib_entry->nh_group; in mlxsw_sp_fib_entry_op_remote()
4359 if (mlxsw_sp_fib_entry_should_offload(fib_entry)) { in mlxsw_sp_fib_entry_op_remote()
4361 adjacency_index = fib_entry->nh_group->adj_index; in mlxsw_sp_fib_entry_op_remote()
4362 ecmp_size = fib_entry->nh_group->ecmp_size; in mlxsw_sp_fib_entry_op_remote()
4377 mlxsw_sp_fib_entry_ralue_pack(ralue_pl, fib_entry, op); in mlxsw_sp_fib_entry_op_remote()
4384 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_local() argument
4387 struct mlxsw_sp_rif *rif = fib_entry->nh_group->nh_rif; in mlxsw_sp_fib_entry_op_local()
4393 if (mlxsw_sp_fib_entry_should_offload(fib_entry)) { in mlxsw_sp_fib_entry_op_local()
4401 mlxsw_sp_fib_entry_ralue_pack(ralue_pl, fib_entry, op); in mlxsw_sp_fib_entry_op_local()
4408 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_trap() argument
4413 mlxsw_sp_fib_entry_ralue_pack(ralue_pl, fib_entry, op); in mlxsw_sp_fib_entry_op_trap()
4419 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_blackhole() argument
4426 mlxsw_sp_fib_entry_ralue_pack(ralue_pl, fib_entry, op); in mlxsw_sp_fib_entry_op_blackhole()
4433 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_unreachable() argument
4443 mlxsw_sp_fib_entry_ralue_pack(ralue_pl, fib_entry, op); in mlxsw_sp_fib_entry_op_unreachable()
4450 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_ipip_decap() argument
4453 struct mlxsw_sp_ipip_entry *ipip_entry = fib_entry->decap.ipip_entry; in mlxsw_sp_fib_entry_op_ipip_decap()
4461 fib_entry->decap.tunnel_index); in mlxsw_sp_fib_entry_op_ipip_decap()
4465 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op_nve_decap() argument
4470 mlxsw_sp_fib_entry_ralue_pack(ralue_pl, fib_entry, op); in mlxsw_sp_fib_entry_op_nve_decap()
4472 fib_entry->decap.tunnel_index); in mlxsw_sp_fib_entry_op_nve_decap()
4477 struct mlxsw_sp_fib_entry *fib_entry, in __mlxsw_sp_fib_entry_op() argument
4480 switch (fib_entry->type) { in __mlxsw_sp_fib_entry_op()
4482 return mlxsw_sp_fib_entry_op_remote(mlxsw_sp, fib_entry, op); in __mlxsw_sp_fib_entry_op()
4484 return mlxsw_sp_fib_entry_op_local(mlxsw_sp, fib_entry, op); in __mlxsw_sp_fib_entry_op()
4486 return mlxsw_sp_fib_entry_op_trap(mlxsw_sp, fib_entry, op); in __mlxsw_sp_fib_entry_op()
4488 return mlxsw_sp_fib_entry_op_blackhole(mlxsw_sp, fib_entry, op); in __mlxsw_sp_fib_entry_op()
4490 return mlxsw_sp_fib_entry_op_unreachable(mlxsw_sp, fib_entry, in __mlxsw_sp_fib_entry_op()
4494 fib_entry, op); in __mlxsw_sp_fib_entry_op()
4496 return mlxsw_sp_fib_entry_op_nve_decap(mlxsw_sp, fib_entry, op); in __mlxsw_sp_fib_entry_op()
4502 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib_entry_op() argument
4505 int err = __mlxsw_sp_fib_entry_op(mlxsw_sp, fib_entry, op); in mlxsw_sp_fib_entry_op()
4510 mlxsw_sp_fib_entry_hw_flags_refresh(mlxsw_sp, fib_entry, op); in mlxsw_sp_fib_entry_op()
4516 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_entry_update() argument
4518 return mlxsw_sp_fib_entry_op(mlxsw_sp, fib_entry, in mlxsw_sp_fib_entry_update()
4523 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_entry_del() argument
4525 return mlxsw_sp_fib_entry_op(mlxsw_sp, fib_entry, in mlxsw_sp_fib_entry_del()
4532 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib4_entry_type_set() argument
4546 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_IPIP_DECAP; in mlxsw_sp_fib4_entry_type_set()
4548 fib_entry, in mlxsw_sp_fib4_entry_type_set()
4557 fib_entry->decap.tunnel_index = tunnel_index; in mlxsw_sp_fib4_entry_type_set()
4558 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_NVE_DECAP; in mlxsw_sp_fib4_entry_type_set()
4563 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_TRAP; in mlxsw_sp_fib4_entry_type_set()
4566 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_BLACKHOLE; in mlxsw_sp_fib4_entry_type_set()
4574 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_UNREACHABLE; in mlxsw_sp_fib4_entry_type_set()
4578 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_REMOTE; in mlxsw_sp_fib4_entry_type_set()
4580 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_LOCAL; in mlxsw_sp_fib4_entry_type_set()
4589 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib4_entry_type_unset() argument
4591 switch (fib_entry->type) { in mlxsw_sp_fib4_entry_type_unset()
4593 mlxsw_sp_fib_entry_decap_fini(mlxsw_sp, fib_entry); in mlxsw_sp_fib4_entry_type_unset()
4606 struct mlxsw_sp_fib_entry *fib_entry; in mlxsw_sp_fib4_entry_create() local
4612 fib_entry = &fib4_entry->common; in mlxsw_sp_fib4_entry_create()
4614 err = mlxsw_sp_fib4_entry_type_set(mlxsw_sp, fen_info, fib_entry); in mlxsw_sp_fib4_entry_create()
4618 err = mlxsw_sp_nexthop4_group_get(mlxsw_sp, fib_entry, fen_info->fi); in mlxsw_sp_fib4_entry_create()
4627 fib_entry->fib_node = fib_node; in mlxsw_sp_fib4_entry_create()
4632 mlxsw_sp_fib4_entry_type_unset(mlxsw_sp, fib_entry); in mlxsw_sp_fib4_entry_create()
4666 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_entry_lookup()
4873 if (fib_node->fib_entry) in mlxsw_sp_fib_node_put()
4881 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_node_entry_link() argument
4883 struct mlxsw_sp_fib_node *fib_node = fib_entry->fib_node; in mlxsw_sp_fib_node_entry_link()
4886 fib_node->fib_entry = fib_entry; in mlxsw_sp_fib_node_entry_link()
4888 err = mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); in mlxsw_sp_fib_node_entry_link()
4895 fib_node->fib_entry = NULL; in mlxsw_sp_fib_node_entry_link()
4901 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_fib_node_entry_unlink() argument
4903 struct mlxsw_sp_fib_node *fib_node = fib_entry->fib_node; in mlxsw_sp_fib_node_entry_unlink()
4905 mlxsw_sp_fib_entry_del(mlxsw_sp, fib_entry); in mlxsw_sp_fib_node_entry_unlink()
4906 fib_node->fib_entry = NULL; in mlxsw_sp_fib_node_entry_unlink()
4914 if (!fib_node->fib_entry) in mlxsw_sp_fib4_allow_replace()
4917 fib4_replaced = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_allow_replace()
4960 replaced = fib_node->fib_entry; in mlxsw_sp_router_fib4_replace()
4979 fib_node->fib_entry = replaced; in mlxsw_sp_router_fib4_replace()
5259 struct mlxsw_sp_fib_entry *fib_entry) in mlxsw_sp_nexthop6_group_put() argument
5261 struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group; in mlxsw_sp_nexthop6_group_put()
5263 list_del(&fib_entry->nexthop_group_node); in mlxsw_sp_nexthop6_group_put()
5366 struct mlxsw_sp_fib_entry *fib_entry, in mlxsw_sp_fib6_entry_type_set() argument
5376 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_TRAP; in mlxsw_sp_fib6_entry_type_set()
5378 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_BLACKHOLE; in mlxsw_sp_fib6_entry_type_set()
5380 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_UNREACHABLE; in mlxsw_sp_fib6_entry_type_set()
5382 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_REMOTE; in mlxsw_sp_fib6_entry_type_set()
5384 fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_LOCAL; in mlxsw_sp_fib6_entry_type_set()
5406 struct mlxsw_sp_fib_entry *fib_entry; in mlxsw_sp_fib6_entry_create() local
5413 fib_entry = &fib6_entry->common; in mlxsw_sp_fib6_entry_create()
5427 mlxsw_sp_fib6_entry_type_set(mlxsw_sp, fib_entry, rt_arr[0]); in mlxsw_sp_fib6_entry_create()
5433 fib_entry->fib_node = fib_node; in mlxsw_sp_fib6_entry_create()
5481 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_entry_lookup()
5498 if (!fib_node->fib_entry) in mlxsw_sp_fib6_allow_replace()
5501 fib6_replaced = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_allow_replace()
5553 replaced = fib_node->fib_entry; in mlxsw_sp_router_fib6_replace()
5570 fib_node->fib_entry = replaced; in mlxsw_sp_router_fib6_replace()
5603 if (WARN_ON_ONCE(!fib_node->fib_entry)) { in mlxsw_sp_router_fib6_append()
5608 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_router_fib6_append()
5812 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_node_flush()
5814 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, fib_node->fib_entry); in mlxsw_sp_fib4_node_flush()
5824 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_node_flush()
5826 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, fib_node->fib_entry); in mlxsw_sp_fib6_node_flush()