Lines Matching refs:fib6_rt
482 nsim_fib6_rt_nh_find(const struct nsim_fib6_rt *fib6_rt, in nsim_fib6_rt_nh_find() argument
487 list_for_each_entry(fib6_rt_nh, &fib6_rt->nh_list, list) { in nsim_fib6_rt_nh_find()
495 static int nsim_fib6_rt_nh_add(struct nsim_fib6_rt *fib6_rt, in nsim_fib6_rt_nh_add() argument
506 list_add_tail(&fib6_rt_nh->list, &fib6_rt->nh_list); in nsim_fib6_rt_nh_add()
507 fib6_rt->nhs++; in nsim_fib6_rt_nh_add()
523 static void nsim_fib6_rt_nh_del(struct nsim_fib6_rt *fib6_rt, in nsim_fib6_rt_nh_del() argument
528 fib6_rt_nh = nsim_fib6_rt_nh_find(fib6_rt, rt); in nsim_fib6_rt_nh_del()
532 fib6_rt->nhs--; in nsim_fib6_rt_nh_del()
543 struct nsim_fib6_rt *fib6_rt; in nsim_fib6_rt_create() local
547 fib6_rt = kzalloc(sizeof(*fib6_rt), GFP_KERNEL); in nsim_fib6_rt_create()
548 if (!fib6_rt) in nsim_fib6_rt_create()
551 nsim_fib_rt_init(data, &fib6_rt->common, &rt->fib6_dst.addr, in nsim_fib6_rt_create()
559 INIT_LIST_HEAD(&fib6_rt->nh_list); in nsim_fib6_rt_create()
562 err = nsim_fib6_rt_nh_add(fib6_rt, rt_arr[i]); in nsim_fib6_rt_create()
567 return fib6_rt; in nsim_fib6_rt_create()
571 nsim_fib6_rt_nh_del(fib6_rt, rt_arr[i]); in nsim_fib6_rt_create()
573 nsim_fib_rt_fini(&fib6_rt->common); in nsim_fib6_rt_create()
574 kfree(fib6_rt); in nsim_fib6_rt_create()
578 static void nsim_fib6_rt_destroy(struct nsim_fib6_rt *fib6_rt) in nsim_fib6_rt_destroy() argument
582 list_for_each_entry_safe(iter, tmp, &fib6_rt->nh_list, list) in nsim_fib6_rt_destroy()
583 nsim_fib6_rt_nh_del(fib6_rt, iter->rt); in nsim_fib6_rt_destroy()
584 WARN_ON_ONCE(!list_empty(&fib6_rt->nh_list)); in nsim_fib6_rt_destroy()
585 nsim_fib_rt_fini(&fib6_rt->common); in nsim_fib6_rt_destroy()
586 kfree(fib6_rt); in nsim_fib6_rt_destroy()
608 struct nsim_fib6_rt *fib6_rt; in nsim_fib6_rt_append() local
620 fib6_rt = nsim_fib6_rt_lookup(&data->fib_rt_ht, rt); in nsim_fib6_rt_append()
621 if (!fib6_rt) in nsim_fib6_rt_append()
625 err = nsim_fib6_rt_nh_add(fib6_rt, fib6_event->rt_arr[i]); in nsim_fib6_rt_append()
637 nsim_fib6_rt_nh_del(fib6_rt, fib6_event->rt_arr[i]); in nsim_fib6_rt_append()
664 const struct nsim_fib6_rt *fib6_rt, in nsim_fib6_rt_hw_flags_set() argument
670 list_for_each_entry(fib6_rt_nh, &fib6_rt->nh_list, list) in nsim_fib6_rt_hw_flags_set()
675 const struct nsim_fib6_rt *fib6_rt, in nsim_fib6_rt_hw_flags_set() argument
682 struct nsim_fib6_rt *fib6_rt) in nsim_fib6_rt_add() argument
687 &fib6_rt->common.ht_node, in nsim_fib6_rt_add()
694 nsim_fib6_rt_hw_flags_set(data, fib6_rt, true); in nsim_fib6_rt_add()
707 struct nsim_fib6_rt *fib6_rt, in nsim_fib6_rt_replace() argument
721 &fib6_rt->common.ht_node, in nsim_fib6_rt_replace()
728 nsim_fib6_rt_hw_flags_set(data, fib6_rt, true); in nsim_fib6_rt_replace()
740 struct nsim_fib6_rt *fib6_rt, *fib6_rt_old; in nsim_fib6_rt_insert() local
752 fib6_rt = nsim_fib6_rt_create(data, fib6_event->rt_arr, in nsim_fib6_rt_insert()
754 if (IS_ERR(fib6_rt)) in nsim_fib6_rt_insert()
755 return PTR_ERR(fib6_rt); in nsim_fib6_rt_insert()
759 err = nsim_fib6_rt_add(data, fib6_rt); in nsim_fib6_rt_insert()
761 err = nsim_fib6_rt_replace(data, fib6_rt, fib6_rt_old); in nsim_fib6_rt_insert()
764 nsim_fib6_rt_destroy(fib6_rt); in nsim_fib6_rt_insert()
773 struct nsim_fib6_rt *fib6_rt; in nsim_fib6_rt_remove() local
781 fib6_rt = nsim_fib6_rt_lookup(&data->fib_rt_ht, rt); in nsim_fib6_rt_remove()
782 if (!fib6_rt) in nsim_fib6_rt_remove()
788 if (fib6_event->nrt6 != fib6_rt->nhs) { in nsim_fib6_rt_remove()
790 nsim_fib6_rt_nh_del(fib6_rt, fib6_event->rt_arr[i]); in nsim_fib6_rt_remove()
794 rhashtable_remove_fast(&data->fib_rt_ht, &fib6_rt->common.ht_node, in nsim_fib6_rt_remove()
796 nsim_fib6_rt_destroy(fib6_rt); in nsim_fib6_rt_remove()
1064 struct nsim_fib6_rt *fib6_rt; in nsim_fib6_rt_free() local
1066 fib6_rt = container_of(fib_rt, struct nsim_fib6_rt, common); in nsim_fib6_rt_free()
1067 nsim_fib6_rt_hw_flags_set(data, fib6_rt, false); in nsim_fib6_rt_free()
1069 nsim_fib6_rt_destroy(fib6_rt); in nsim_fib6_rt_free()