Lines Matching refs:fib6_entry

3358 		struct mlxsw_sp_fib6_entry *fib6_entry;  member
3384 const struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_nexthop6_group_cmp() argument
3388 if (nh_grp->nhgi->count != fib6_entry->nrt6) in mlxsw_sp_nexthop6_group_cmp()
3391 list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) { in mlxsw_sp_nexthop6_group_cmp()
3421 cmp_arg->fib6_entry); in mlxsw_sp_nexthop_group_cmp()
3459 mlxsw_sp_nexthop6_group_hash(struct mlxsw_sp_fib6_entry *fib6_entry, u32 seed) in mlxsw_sp_nexthop6_group_hash() argument
3461 unsigned int val = fib6_entry->nrt6; in mlxsw_sp_nexthop6_group_hash()
3464 list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) { in mlxsw_sp_nexthop6_group_hash()
3485 return mlxsw_sp_nexthop6_group_hash(cmp_arg->fib6_entry, seed); in mlxsw_sp_nexthop_group_hash()
3540 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_nexthop6_group_lookup() argument
3545 cmp_arg.fib6_entry = fib6_entry; in mlxsw_sp_nexthop6_group_lookup()
3941 struct mlxsw_sp_fib6_entry *fib6_entry) in __mlxsw_sp_nexthop6_group_offload_refresh() argument
3945 list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) { in __mlxsw_sp_nexthop6_group_offload_refresh()
3961 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_nexthop6_group_offload_refresh() local
3967 list_for_each_entry(fib6_entry, &nh_grp->fib_list, in mlxsw_sp_nexthop6_group_offload_refresh()
3969 __mlxsw_sp_nexthop6_group_offload_refresh(nh_grp, fib6_entry); in mlxsw_sp_nexthop6_group_offload_refresh()
5840 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_fib6_entry_hw_flags_set() local
5849 fib6_entry = container_of(fib_entry, struct mlxsw_sp_fib6_entry, in mlxsw_sp_fib6_entry_hw_flags_set()
5851 list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) in mlxsw_sp_fib6_entry_hw_flags_set()
5868 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_fib6_entry_hw_flags_clear() local
5871 fib6_entry = container_of(fib_entry, struct mlxsw_sp_fib6_entry, in mlxsw_sp_fib6_entry_hw_flags_clear()
5873 list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) in mlxsw_sp_fib6_entry_hw_flags_clear()
6695 mlxsw_sp_fib6_entry_rt(const struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_fib6_entry_rt() argument
6697 return list_first_entry(&fib6_entry->rt6_list, struct mlxsw_sp_rt6, in mlxsw_sp_fib6_entry_rt()
6702 mlxsw_sp_fib6_entry_rt_find(const struct mlxsw_sp_fib6_entry *fib6_entry, in mlxsw_sp_fib6_entry_rt_find() argument
6707 list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) { in mlxsw_sp_fib6_entry_rt_find()
6775 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_nexthop6_group_info_init() argument
6782 nhgi = kzalloc(struct_size(nhgi, nexthops, fib6_entry->nrt6), in mlxsw_sp_nexthop6_group_info_init()
6788 mlxsw_sp_rt6 = list_first_entry(&fib6_entry->rt6_list, in mlxsw_sp_nexthop6_group_info_init()
6791 nhgi->count = fib6_entry->nrt6; in mlxsw_sp_nexthop6_group_info_init()
6844 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_nexthop6_group_create() argument
6860 err = mlxsw_sp_nexthop6_group_info_init(mlxsw_sp, nh_grp, fib6_entry); in mlxsw_sp_nexthop6_group_create()
6895 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_nexthop6_group_get() argument
6897 struct fib6_info *rt = mlxsw_sp_fib6_entry_rt(fib6_entry); in mlxsw_sp_nexthop6_group_get()
6908 nh_grp = mlxsw_sp_nexthop6_group_lookup(mlxsw_sp, fib6_entry); in mlxsw_sp_nexthop6_group_get()
6910 nh_grp = mlxsw_sp_nexthop6_group_create(mlxsw_sp, fib6_entry); in mlxsw_sp_nexthop6_group_get()
6918 __mlxsw_sp_nexthop6_group_offload_refresh(nh_grp, fib6_entry); in mlxsw_sp_nexthop6_group_get()
6921 list_add_tail(&fib6_entry->common.nexthop_group_node, in mlxsw_sp_nexthop6_group_get()
6923 fib6_entry->common.nh_group = nh_grp; in mlxsw_sp_nexthop6_group_get()
6947 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_nexthop6_group_update() argument
6949 struct mlxsw_sp_nexthop_group *old_nh_grp = fib6_entry->common.nh_group; in mlxsw_sp_nexthop6_group_update()
6950 struct mlxsw_sp_fib_node *fib_node = fib6_entry->common.fib_node; in mlxsw_sp_nexthop6_group_update()
6954 fib6_entry->common.nh_group = NULL; in mlxsw_sp_nexthop6_group_update()
6955 list_del(&fib6_entry->common.nexthop_group_node); in mlxsw_sp_nexthop6_group_update()
6957 err = mlxsw_sp_nexthop6_group_get(mlxsw_sp, fib6_entry); in mlxsw_sp_nexthop6_group_update()
6961 err = mlxsw_sp_nexthop_group_vr_link(fib6_entry->common.nh_group, in mlxsw_sp_nexthop6_group_update()
6970 err = mlxsw_sp_fib_entry_update(mlxsw_sp, &fib6_entry->common); in mlxsw_sp_nexthop6_group_update()
6980 mlxsw_sp_nexthop_group_vr_unlink(fib6_entry->common.nh_group, in mlxsw_sp_nexthop6_group_update()
6983 mlxsw_sp_nexthop6_group_put(mlxsw_sp, &fib6_entry->common); in mlxsw_sp_nexthop6_group_update()
6985 list_add_tail(&fib6_entry->common.nexthop_group_node, in mlxsw_sp_nexthop6_group_update()
6987 fib6_entry->common.nh_group = old_nh_grp; in mlxsw_sp_nexthop6_group_update()
6994 struct mlxsw_sp_fib6_entry *fib6_entry, in mlxsw_sp_fib6_entry_nexthop_add() argument
7007 list_add_tail(&mlxsw_sp_rt6->list, &fib6_entry->rt6_list); in mlxsw_sp_fib6_entry_nexthop_add()
7008 fib6_entry->nrt6++; in mlxsw_sp_fib6_entry_nexthop_add()
7011 err = mlxsw_sp_nexthop6_group_update(mlxsw_sp, fib6_entry); in mlxsw_sp_fib6_entry_nexthop_add()
7019 fib6_entry->nrt6--; in mlxsw_sp_fib6_entry_nexthop_add()
7020 mlxsw_sp_rt6 = list_last_entry(&fib6_entry->rt6_list, in mlxsw_sp_fib6_entry_nexthop_add()
7030 struct mlxsw_sp_fib6_entry *fib6_entry, in mlxsw_sp_fib6_entry_nexthop_del() argument
7037 mlxsw_sp_rt6 = mlxsw_sp_fib6_entry_rt_find(fib6_entry, in mlxsw_sp_fib6_entry_nexthop_del()
7042 fib6_entry->nrt6--; in mlxsw_sp_fib6_entry_nexthop_del()
7047 mlxsw_sp_nexthop6_group_update(mlxsw_sp, fib6_entry); in mlxsw_sp_fib6_entry_nexthop_del()
7106 mlxsw_sp_fib6_entry_rt_destroy_all(struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_fib6_entry_rt_destroy_all() argument
7110 list_for_each_entry_safe(mlxsw_sp_rt6, tmp, &fib6_entry->rt6_list, in mlxsw_sp_fib6_entry_rt_destroy_all()
7112 fib6_entry->nrt6--; in mlxsw_sp_fib6_entry_rt_destroy_all()
7123 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_fib6_entry_create() local
7128 fib6_entry = kzalloc(sizeof(*fib6_entry), GFP_KERNEL); in mlxsw_sp_fib6_entry_create()
7129 if (!fib6_entry) in mlxsw_sp_fib6_entry_create()
7131 fib_entry = &fib6_entry->common; in mlxsw_sp_fib6_entry_create()
7133 INIT_LIST_HEAD(&fib6_entry->rt6_list); in mlxsw_sp_fib6_entry_create()
7141 list_add_tail(&mlxsw_sp_rt6->list, &fib6_entry->rt6_list); in mlxsw_sp_fib6_entry_create()
7142 fib6_entry->nrt6++; in mlxsw_sp_fib6_entry_create()
7145 err = mlxsw_sp_nexthop6_group_get(mlxsw_sp, fib6_entry); in mlxsw_sp_fib6_entry_create()
7160 return fib6_entry; in mlxsw_sp_fib6_entry_create()
7168 fib6_entry->nrt6--; in mlxsw_sp_fib6_entry_create()
7169 mlxsw_sp_rt6 = list_last_entry(&fib6_entry->rt6_list, in mlxsw_sp_fib6_entry_create()
7174 kfree(fib6_entry); in mlxsw_sp_fib6_entry_create()
7180 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_fib6_entry_type_unset() argument
7182 mlxsw_sp_fib_entry_type_unset(mlxsw_sp, &fib6_entry->common); in mlxsw_sp_fib6_entry_type_unset()
7186 struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_fib6_entry_destroy() argument
7188 struct mlxsw_sp_fib_node *fib_node = fib6_entry->common.fib_node; in mlxsw_sp_fib6_entry_destroy()
7190 mlxsw_sp_fib6_entry_type_unset(mlxsw_sp, fib6_entry); in mlxsw_sp_fib6_entry_destroy()
7191 mlxsw_sp_nexthop_group_vr_unlink(fib6_entry->common.nh_group, in mlxsw_sp_fib6_entry_destroy()
7193 mlxsw_sp_nexthop6_group_put(mlxsw_sp, &fib6_entry->common); in mlxsw_sp_fib6_entry_destroy()
7194 mlxsw_sp_fib6_entry_rt_destroy_all(fib6_entry); in mlxsw_sp_fib6_entry_destroy()
7195 WARN_ON(fib6_entry->nrt6); in mlxsw_sp_fib6_entry_destroy()
7196 kfree(fib6_entry); in mlxsw_sp_fib6_entry_destroy()
7203 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_fib6_entry_lookup() local
7220 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_entry_lookup()
7222 cmp_rt = mlxsw_sp_fib6_entry_rt(fib6_entry); in mlxsw_sp_fib6_entry_lookup()
7225 mlxsw_sp_fib6_entry_rt_find(fib6_entry, rt)) in mlxsw_sp_fib6_entry_lookup()
7226 return fib6_entry; in mlxsw_sp_fib6_entry_lookup()
7231 static bool mlxsw_sp_fib6_allow_replace(struct mlxsw_sp_fib6_entry *fib6_entry) in mlxsw_sp_fib6_allow_replace() argument
7233 struct mlxsw_sp_fib_node *fib_node = fib6_entry->common.fib_node; in mlxsw_sp_fib6_allow_replace()
7243 rt = mlxsw_sp_fib6_entry_rt(fib6_entry); in mlxsw_sp_fib6_allow_replace()
7256 struct mlxsw_sp_fib6_entry *fib6_entry, *fib6_replaced; in mlxsw_sp_router_fib6_replace() local
7279 fib6_entry = mlxsw_sp_fib6_entry_create(mlxsw_sp, fib_node, rt_arr, in mlxsw_sp_router_fib6_replace()
7281 if (IS_ERR(fib6_entry)) { in mlxsw_sp_router_fib6_replace()
7282 err = PTR_ERR(fib6_entry); in mlxsw_sp_router_fib6_replace()
7286 if (!mlxsw_sp_fib6_allow_replace(fib6_entry)) { in mlxsw_sp_router_fib6_replace()
7287 mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); in mlxsw_sp_router_fib6_replace()
7293 err = mlxsw_sp_fib_node_entry_link(mlxsw_sp, &fib6_entry->common); in mlxsw_sp_router_fib6_replace()
7310 mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); in mlxsw_sp_router_fib6_replace()
7320 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_router_fib6_append() local
7344 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_router_fib6_append()
7346 err = mlxsw_sp_fib6_entry_nexthop_add(mlxsw_sp, fib6_entry, rt_arr, in mlxsw_sp_router_fib6_append()
7362 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_router_fib6_del() local
7374 fib6_entry = mlxsw_sp_fib6_entry_lookup(mlxsw_sp, rt); in mlxsw_sp_router_fib6_del()
7375 if (!fib6_entry) in mlxsw_sp_router_fib6_del()
7381 if (nrt6 != fib6_entry->nrt6) { in mlxsw_sp_router_fib6_del()
7382 mlxsw_sp_fib6_entry_nexthop_del(mlxsw_sp, fib6_entry, rt_arr, in mlxsw_sp_router_fib6_del()
7387 fib_node = fib6_entry->common.fib_node; in mlxsw_sp_router_fib6_del()
7389 mlxsw_sp_fib_node_entry_unlink(mlxsw_sp, &fib6_entry->common); in mlxsw_sp_router_fib6_del()
7390 mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); in mlxsw_sp_router_fib6_del()
7483 struct mlxsw_sp_fib6_entry *fib6_entry; in mlxsw_sp_fib6_node_flush() local
7485 fib6_entry = container_of(fib_node->fib_entry, in mlxsw_sp_fib6_node_flush()
7488 mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); in mlxsw_sp_fib6_node_flush()