Lines Matching refs:fib4_entry
5935 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_should_offload() local
5937 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_should_offload()
5939 return !fib4_entry->dscp; in mlxsw_sp_fib4_entry_should_offload()
6015 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_hw_flags_set() local
6020 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_set()
6022 fri.fi = fib4_entry->fi; in mlxsw_sp_fib4_entry_hw_flags_set()
6023 fri.tb_id = fib4_entry->tb_id; in mlxsw_sp_fib4_entry_hw_flags_set()
6026 fri.dscp = fib4_entry->dscp; in mlxsw_sp_fib4_entry_hw_flags_set()
6027 fri.type = fib4_entry->type; in mlxsw_sp_fib4_entry_hw_flags_set()
6040 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_hw_flags_clear() local
6043 fib4_entry = container_of(fib_entry, struct mlxsw_sp_fib4_entry, in mlxsw_sp_fib4_entry_hw_flags_clear()
6045 fri.fi = fib4_entry->fi; in mlxsw_sp_fib4_entry_hw_flags_clear()
6046 fri.tb_id = fib4_entry->tb_id; in mlxsw_sp_fib4_entry_hw_flags_clear()
6049 fri.dscp = fib4_entry->dscp; in mlxsw_sp_fib4_entry_hw_flags_clear()
6050 fri.type = fib4_entry->type; in mlxsw_sp_fib4_entry_hw_flags_clear()
6466 struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_entry_type_unset() argument
6468 mlxsw_sp_fib_entry_type_unset(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_type_unset()
6476 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_create() local
6480 fib4_entry = kzalloc(sizeof(*fib4_entry), GFP_KERNEL); in mlxsw_sp_fib4_entry_create()
6481 if (!fib4_entry) in mlxsw_sp_fib4_entry_create()
6483 fib_entry = &fib4_entry->common; in mlxsw_sp_fib4_entry_create()
6498 fib4_entry->fi = fen_info->fi; in mlxsw_sp_fib4_entry_create()
6499 fib_info_hold(fib4_entry->fi); in mlxsw_sp_fib4_entry_create()
6500 fib4_entry->tb_id = fen_info->tb_id; in mlxsw_sp_fib4_entry_create()
6501 fib4_entry->type = fen_info->type; in mlxsw_sp_fib4_entry_create()
6502 fib4_entry->dscp = fen_info->dscp; in mlxsw_sp_fib4_entry_create()
6506 return fib4_entry; in mlxsw_sp_fib4_entry_create()
6511 mlxsw_sp_nexthop4_group_put(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_create()
6513 kfree(fib4_entry); in mlxsw_sp_fib4_entry_create()
6518 struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_entry_destroy() argument
6520 struct mlxsw_sp_fib_node *fib_node = fib4_entry->common.fib_node; in mlxsw_sp_fib4_entry_destroy()
6522 fib_info_put(fib4_entry->fi); in mlxsw_sp_fib4_entry_destroy()
6523 mlxsw_sp_fib4_entry_type_unset(mlxsw_sp, fib4_entry); in mlxsw_sp_fib4_entry_destroy()
6524 mlxsw_sp_nexthop_group_vr_unlink(fib4_entry->common.nh_group, in mlxsw_sp_fib4_entry_destroy()
6526 mlxsw_sp_nexthop4_group_put(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_fib4_entry_destroy()
6527 kfree(fib4_entry); in mlxsw_sp_fib4_entry_destroy()
6534 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_entry_lookup() local
6550 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_entry_lookup()
6552 if (fib4_entry->tb_id == fen_info->tb_id && in mlxsw_sp_fib4_entry_lookup()
6553 fib4_entry->dscp == fen_info->dscp && in mlxsw_sp_fib4_entry_lookup()
6554 fib4_entry->type == fen_info->type && in mlxsw_sp_fib4_entry_lookup()
6555 fib4_entry->fi == fen_info->fi) in mlxsw_sp_fib4_entry_lookup()
6556 return fib4_entry; in mlxsw_sp_fib4_entry_lookup()
6792 static bool mlxsw_sp_fib4_allow_replace(struct mlxsw_sp_fib4_entry *fib4_entry) in mlxsw_sp_fib4_allow_replace() argument
6794 struct mlxsw_sp_fib_node *fib_node = fib4_entry->common.fib_node; in mlxsw_sp_fib4_allow_replace()
6802 if (fib4_entry->tb_id == RT_TABLE_MAIN && in mlxsw_sp_fib4_allow_replace()
6813 struct mlxsw_sp_fib4_entry *fib4_entry, *fib4_replaced; in mlxsw_sp_router_fib4_replace() local
6831 fib4_entry = mlxsw_sp_fib4_entry_create(mlxsw_sp, fib_node, fen_info); in mlxsw_sp_router_fib4_replace()
6832 if (IS_ERR(fib4_entry)) { in mlxsw_sp_router_fib4_replace()
6834 err = PTR_ERR(fib4_entry); in mlxsw_sp_router_fib4_replace()
6838 if (!mlxsw_sp_fib4_allow_replace(fib4_entry)) { in mlxsw_sp_router_fib4_replace()
6839 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_replace()
6845 err = mlxsw_sp_fib_node_entry_link(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_router_fib4_replace()
6864 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_replace()
6873 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_router_fib4_del() local
6876 fib4_entry = mlxsw_sp_fib4_entry_lookup(mlxsw_sp, fen_info); in mlxsw_sp_router_fib4_del()
6877 if (!fib4_entry) in mlxsw_sp_router_fib4_del()
6879 fib_node = fib4_entry->common.fib_node; in mlxsw_sp_router_fib4_del()
6881 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, &fib4_entry->common); in mlxsw_sp_router_fib4_del()
6882 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_router_fib4_del()
7720 struct mlxsw_sp_fib4_entry *fib4_entry; in mlxsw_sp_fib4_node_flush() local
7722 fib4_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib4_node_flush()
7725 mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); in mlxsw_sp_fib4_node_flush()