Lines Matching refs:fib4_entry

4100 	struct mlxsw_sp_fib4_entry *fib4_entry;  in mlxsw_sp_fib4_entry_should_offload()  local
4102 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_should_offload()
4104 return !fib4_entry->tos; in mlxsw_sp_fib4_entry_should_offload()
4162 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_hw_flags_set() local
4167 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_set()
4170 fri.tb_id = fib4_entry->tb_id; in mlxsw_sp_fib4_entry_hw_flags_set()
4173 fri.tos = fib4_entry->tos; in mlxsw_sp_fib4_entry_hw_flags_set()
4174 fri.type = fib4_entry->type; in mlxsw_sp_fib4_entry_hw_flags_set()
4187 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_hw_flags_clear() local
4190 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_clear()
4193 fri.tb_id = fib4_entry->tb_id; in mlxsw_sp_fib4_entry_hw_flags_clear()
4196 fri.tos = fib4_entry->tos; in mlxsw_sp_fib4_entry_hw_flags_clear()
4197 fri.type = fib4_entry->type; in mlxsw_sp_fib4_entry_hw_flags_clear()
4602 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_create() local
4606 fib4_entry = kzalloc(sizeof(*fib4_entry), GFP_KERNEL); in mlxsw_sp_fib4_entry_create()
4607 if (!fib4_entry) in mlxsw_sp_fib4_entry_create()
4609 fib_entry = &fib4_entry->common; in mlxsw_sp_fib4_entry_create()
4619 fib4_entry->prio = fen_info->fi->fib_priority; in mlxsw_sp_fib4_entry_create()
4620 fib4_entry->tb_id = fen_info->tb_id; in mlxsw_sp_fib4_entry_create()
4621 fib4_entry->type = fen_info->type; in mlxsw_sp_fib4_entry_create()
4622 fib4_entry->tos = fen_info->tos; in mlxsw_sp_fib4_entry_create()
4626 return fib4_entry; in mlxsw_sp_fib4_entry_create()
4631 kfree(fib4_entry); in mlxsw_sp_fib4_entry_create()
4636 struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_entry_destroy() argument
4638 mlxsw_sp_nexthop4_group_put(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_destroy()
4639 mlxsw_sp_fib4_entry_type_unset(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_destroy()
4640 kfree(fib4_entry); in mlxsw_sp_fib4_entry_destroy()
4647 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_lookup() local
4663 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_entry_lookup()
4665 if (fib4_entry->tb_id == fen_info->tb_id && in mlxsw_sp_fib4_entry_lookup()
4666 fib4_entry->tos == fen_info->tos && in mlxsw_sp_fib4_entry_lookup()
4667 fib4_entry->type == fen_info->type && in mlxsw_sp_fib4_entry_lookup()
4668 mlxsw_sp_nexthop4_group_fi(fib4_entry->common.nh_group) == in mlxsw_sp_fib4_entry_lookup()
4670 return fib4_entry; in mlxsw_sp_fib4_entry_lookup()
4906 static bool mlxsw_sp_fib4_allow_replace(struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_allow_replace() argument
4908 struct mlxsw_sp_fib_node *fib_node = fib4_entry->common.fib_node; in mlxsw_sp_fib4_allow_replace()
4916 if (fib4_entry->tb_id == RT_TABLE_MAIN && in mlxsw_sp_fib4_allow_replace()
4927 struct mlxsw_sp_fib4_entry *fib4_entry, *fib4_replaced; in mlxsw_sp_router_fib4_replace() local
4944 fib4_entry = mlxsw_sp_fib4_entry_create(mlxsw_sp, fib_node, fen_info); in mlxsw_sp_router_fib4_replace()
4945 if (IS_ERR(fib4_entry)) { in mlxsw_sp_router_fib4_replace()
4947 err = PTR_ERR(fib4_entry); in mlxsw_sp_router_fib4_replace()
4951 if (!mlxsw_sp_fib4_allow_replace(fib4_entry)) { in mlxsw_sp_router_fib4_replace()
4952 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_replace()
4958 err = mlxsw_sp_fib_node_entry_link(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_router_fib4_replace()
4977 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_replace()
4986 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_router_fib4_del() local
4992 fib4_entry = mlxsw_sp_fib4_entry_lookup(mlxsw_sp, fen_info); in mlxsw_sp_router_fib4_del()
4993 if (!fib4_entry) in mlxsw_sp_router_fib4_del()
4995 fib_node = fib4_entry->common.fib_node; in mlxsw_sp_router_fib4_del()
4997 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_router_fib4_del()
4998 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_del()
5807 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_node_flush() local
5809 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_node_flush()
5812 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_fib4_node_flush()