Lines Matching refs:tp
178 static inline void node_set_parent(struct key_vector *n, struct key_vector *tp) in node_set_parent() argument
181 rcu_assign_pointer(tn_info(n)->parent, tp); in node_set_parent()
442 static inline void put_child_root(struct key_vector *tp, t_key key, in put_child_root() argument
445 if (IS_TRIE(tp)) in put_child_root()
446 rcu_assign_pointer(tp->tnode[0], n); in put_child_root()
448 put_child(tp, get_index(key, tp), n); in put_child_root()
485 struct key_vector *tp = node_parent(oldtnode); in replace() local
489 NODE_INIT_PARENT(tn, tp); in replace()
490 put_child_root(tp, tn->key, tn); in replace()
507 return tp; in replace()
664 struct key_vector *n, *tp; in collapse() local
672 tp = node_parent(oldtnode); in collapse()
673 put_child_root(tp, oldtnode->key, n); in collapse()
674 node_set_parent(n, tp); in collapse()
679 return tp; in collapse()
774 static inline bool should_inflate(struct key_vector *tp, struct key_vector *tn) in should_inflate() argument
780 threshold *= IS_TRIE(tp) ? inflate_threshold_root : inflate_threshold; in should_inflate()
789 static inline bool should_halve(struct key_vector *tp, struct key_vector *tn) in should_halve() argument
795 threshold *= IS_TRIE(tp) ? halve_threshold_root : halve_threshold; in should_halve()
823 struct key_vector *tp = node_parent(tn); in resize() local
824 unsigned long cindex = get_index(tn->key, tp); in resize()
834 BUG_ON(tn != get_child(tp, cindex)); in resize()
839 while (should_inflate(tp, tn) && max_work) { in resize()
840 tp = inflate(t, tn); in resize()
841 if (!tp) { in resize()
849 tn = get_child(tp, cindex); in resize()
853 tp = node_parent(tn); in resize()
857 return tp; in resize()
862 while (should_halve(tp, tn) && max_work) { in resize()
863 tp = halve(t, tn); in resize()
864 if (!tp) { in resize()
872 tn = get_child(tp, cindex); in resize()
880 tp = node_parent(tn); in resize()
884 return tp; in resize()
890 if (slen > tp->slen) in resize()
891 tp->slen = slen; in resize()
894 return tp; in resize()
897 static void leaf_pull_suffix(struct key_vector *tp, struct key_vector *l) in leaf_pull_suffix() argument
899 while ((tp->slen > tp->pos) && (tp->slen > l->slen)) { in leaf_pull_suffix()
900 if (update_suffix(tp) > l->slen) in leaf_pull_suffix()
902 tp = node_parent(tp); in leaf_pull_suffix()
919 struct key_vector **tp, u32 key) in fib_find_node() argument
955 *tp = pn; in fib_find_node()
995 static int fib_insert_node(struct trie *t, struct key_vector *tp, in fib_insert_node() argument
1005 n = get_child(tp, get_index(key, tp)); in fib_insert_node()
1021 NODE_INIT_PARENT(tn, tp); in fib_insert_node()
1025 put_child_root(tp, key, tn); in fib_insert_node()
1029 tp = tn; in fib_insert_node()
1033 NODE_INIT_PARENT(l, tp); in fib_insert_node()
1034 put_child_root(tp, key, l); in fib_insert_node()
1035 trie_rebalance(t, tp); in fib_insert_node()
1044 static int fib_insert_alias(struct trie *t, struct key_vector *tp, in fib_insert_alias() argument
1049 return fib_insert_node(t, tp, new, key); in fib_insert_alias()
1074 leaf_push_suffix(tp, l); in fib_insert_alias()
1085 struct key_vector *l, *tp; in fib_table_insert() local
1110 l = fib_find_node(t, &tp, key); in fib_table_insert()
1238 err = fib_insert_alias(t, tp, l, new_fa, fa, key); in fib_table_insert()
1460 static void fib_remove_alias(struct trie *t, struct key_vector *tp, in fib_remove_alias() argument
1474 put_child_root(tp, l->key, NULL); in fib_remove_alias()
1476 trie_rebalance(t, tp); in fib_remove_alias()
1486 leaf_pull_suffix(tp, l); in fib_remove_alias()
1494 struct key_vector *l, *tp; in fib_table_delete() local
1508 l = fib_find_node(t, &tp, key); in fib_table_delete()
1552 fib_remove_alias(t, tp, l, fa_to_delete); in fib_table_delete()
1681 struct key_vector *l, *tp = ot->kv; in fib_trie_unmerge() local
1696 while ((l = leaf_walk_rcu(&tp, key)) != NULL) { in fib_trie_unmerge()
1943 struct key_vector *l, *tp = t->kv; in fib_table_dump() local
1950 while ((l = leaf_walk_rcu(&tp, key)) != NULL) { in fib_table_dump()
2457 struct key_vector *l, **tp = &iter->tnode; in fib_route_get_idx() local
2472 while ((l = leaf_walk_rcu(tp, key)) != NULL) { in fib_route_get_idx()