Lines Matching refs:fib4_entry
5465 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_should_offload() local
5467 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_should_offload()
5469 return !fib4_entry->dscp; in mlxsw_sp_fib4_entry_should_offload()
5544 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_hw_flags_set() local
5549 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_set()
5551 fri.fi = fib4_entry->fi; in mlxsw_sp_fib4_entry_hw_flags_set()
5552 fri.tb_id = fib4_entry->tb_id; in mlxsw_sp_fib4_entry_hw_flags_set()
5555 fri.dscp = fib4_entry->dscp; in mlxsw_sp_fib4_entry_hw_flags_set()
5556 fri.type = fib4_entry->type; in mlxsw_sp_fib4_entry_hw_flags_set()
5569 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_hw_flags_clear() local
5572 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_clear()
5574 fri.fi = fib4_entry->fi; in mlxsw_sp_fib4_entry_hw_flags_clear()
5575 fri.tb_id = fib4_entry->tb_id; in mlxsw_sp_fib4_entry_hw_flags_clear()
5578 fri.dscp = fib4_entry->dscp; in mlxsw_sp_fib4_entry_hw_flags_clear()
5579 fri.type = fib4_entry->type; in mlxsw_sp_fib4_entry_hw_flags_clear()
5994 struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_entry_type_unset() argument
5996 mlxsw_sp_fib_entry_type_unset(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_type_unset()
6004 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_create() local
6008 fib4_entry = kzalloc(sizeof(*fib4_entry), GFP_KERNEL); in mlxsw_sp_fib4_entry_create()
6009 if (!fib4_entry) in mlxsw_sp_fib4_entry_create()
6011 fib_entry = &fib4_entry->common; in mlxsw_sp_fib4_entry_create()
6026 fib4_entry->fi = fen_info->fi; in mlxsw_sp_fib4_entry_create()
6027 fib_info_hold(fib4_entry->fi); in mlxsw_sp_fib4_entry_create()
6028 fib4_entry->tb_id = fen_info->tb_id; in mlxsw_sp_fib4_entry_create()
6029 fib4_entry->type = fen_info->type; in mlxsw_sp_fib4_entry_create()
6030 fib4_entry->dscp = fen_info->dscp; in mlxsw_sp_fib4_entry_create()
6034 return fib4_entry; in mlxsw_sp_fib4_entry_create()
6039 mlxsw_sp_nexthop4_group_put(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_create()
6041 kfree(fib4_entry); in mlxsw_sp_fib4_entry_create()
6046 struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_entry_destroy() argument
6048 struct mlxsw_sp_fib_node *fib_node = fib4_entry->common.fib_node; in mlxsw_sp_fib4_entry_destroy()
6050 fib_info_put(fib4_entry->fi); in mlxsw_sp_fib4_entry_destroy()
6051 mlxsw_sp_fib4_entry_type_unset(mlxsw_sp, fib4_entry); in mlxsw_sp_fib4_entry_destroy()
6052 mlxsw_sp_nexthop_group_vr_unlink(fib4_entry->common.nh_group, in mlxsw_sp_fib4_entry_destroy()
6054 mlxsw_sp_nexthop4_group_put(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_destroy()
6055 kfree(fib4_entry); in mlxsw_sp_fib4_entry_destroy()
6062 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_lookup() local
6078 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_entry_lookup()
6080 if (fib4_entry->tb_id == fen_info->tb_id && in mlxsw_sp_fib4_entry_lookup()
6081 fib4_entry->dscp == fen_info->dscp && in mlxsw_sp_fib4_entry_lookup()
6082 fib4_entry->type == fen_info->type && in mlxsw_sp_fib4_entry_lookup()
6083 fib4_entry->fi == fen_info->fi) in mlxsw_sp_fib4_entry_lookup()
6084 return fib4_entry; in mlxsw_sp_fib4_entry_lookup()
6320 static bool mlxsw_sp_fib4_allow_replace(struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_allow_replace() argument
6322 struct mlxsw_sp_fib_node *fib_node = fib4_entry->common.fib_node; in mlxsw_sp_fib4_allow_replace()
6330 if (fib4_entry->tb_id == RT_TABLE_MAIN && in mlxsw_sp_fib4_allow_replace()
6341 struct mlxsw_sp_fib4_entry *fib4_entry, *fib4_replaced; in mlxsw_sp_router_fib4_replace() local
6359 fib4_entry = mlxsw_sp_fib4_entry_create(mlxsw_sp, fib_node, fen_info); in mlxsw_sp_router_fib4_replace()
6360 if (IS_ERR(fib4_entry)) { in mlxsw_sp_router_fib4_replace()
6362 err = PTR_ERR(fib4_entry); in mlxsw_sp_router_fib4_replace()
6366 if (!mlxsw_sp_fib4_allow_replace(fib4_entry)) { in mlxsw_sp_router_fib4_replace()
6367 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_replace()
6373 err = mlxsw_sp_fib_node_entry_link(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_router_fib4_replace()
6392 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_replace()
6401 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_router_fib4_del() local
6404 fib4_entry = mlxsw_sp_fib4_entry_lookup(mlxsw_sp, fen_info); in mlxsw_sp_router_fib4_del()
6405 if (!fib4_entry) in mlxsw_sp_router_fib4_del()
6407 fib_node = fib4_entry->common.fib_node; in mlxsw_sp_router_fib4_del()
6409 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_router_fib4_del()
6410 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_del()
7245 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_node_flush() local
7247 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_node_flush()
7250 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_fib4_node_flush()