Lines Matching refs:tp
176 static inline void node_set_parent(struct key_vector *n, struct key_vector *tp) in node_set_parent() argument
179 rcu_assign_pointer(tn_info(n)->parent, tp); in node_set_parent()
436 static inline void put_child_root(struct key_vector *tp, t_key key, in put_child_root() argument
439 if (IS_TRIE(tp)) in put_child_root()
440 rcu_assign_pointer(tp->tnode[0], n); in put_child_root()
442 put_child(tp, get_index(key, tp), n); in put_child_root()
479 struct key_vector *tp = node_parent(oldtnode); in replace() local
483 NODE_INIT_PARENT(tn, tp); in replace()
484 put_child_root(tp, tn->key, tn); in replace()
501 return tp; in replace()
658 struct key_vector *n, *tp; in collapse() local
666 tp = node_parent(oldtnode); in collapse()
667 put_child_root(tp, oldtnode->key, n); in collapse()
668 node_set_parent(n, tp); in collapse()
673 return tp; in collapse()
768 static inline bool should_inflate(struct key_vector *tp, struct key_vector *tn) in should_inflate() argument
774 threshold *= IS_TRIE(tp) ? inflate_threshold_root : inflate_threshold; in should_inflate()
783 static inline bool should_halve(struct key_vector *tp, struct key_vector *tn) in should_halve() argument
789 threshold *= IS_TRIE(tp) ? halve_threshold_root : halve_threshold; in should_halve()
817 struct key_vector *tp = node_parent(tn); in resize() local
818 unsigned long cindex = get_index(tn->key, tp); in resize()
828 BUG_ON(tn != get_child(tp, cindex)); in resize()
833 while (should_inflate(tp, tn) && max_work) { in resize()
834 tp = inflate(t, tn); in resize()
835 if (!tp) { in resize()
843 tn = get_child(tp, cindex); in resize()
847 tp = node_parent(tn); in resize()
851 return tp; in resize()
856 while (should_halve(tp, tn) && max_work) { in resize()
857 tp = halve(t, tn); in resize()
858 if (!tp) { in resize()
866 tn = get_child(tp, cindex); in resize()
874 tp = node_parent(tn); in resize()
878 return tp; in resize()
884 if (slen > tp->slen) in resize()
885 tp->slen = slen; in resize()
888 return tp; in resize()
891 static void leaf_pull_suffix(struct key_vector *tp, struct key_vector *l) in leaf_pull_suffix() argument
893 while ((tp->slen > tp->pos) && (tp->slen > l->slen)) { in leaf_pull_suffix()
894 if (update_suffix(tp) > l->slen) in leaf_pull_suffix()
896 tp = node_parent(tp); in leaf_pull_suffix()
913 struct key_vector **tp, u32 key) in fib_find_node() argument
949 *tp = pn; in fib_find_node()
989 static int fib_insert_node(struct trie *t, struct key_vector *tp, in fib_insert_node() argument
999 n = get_child(tp, get_index(key, tp)); in fib_insert_node()
1015 NODE_INIT_PARENT(tn, tp); in fib_insert_node()
1019 put_child_root(tp, key, tn); in fib_insert_node()
1023 tp = tn; in fib_insert_node()
1027 NODE_INIT_PARENT(l, tp); in fib_insert_node()
1028 put_child_root(tp, key, l); in fib_insert_node()
1029 trie_rebalance(t, tp); in fib_insert_node()
1038 static int fib_insert_alias(struct trie *t, struct key_vector *tp, in fib_insert_alias() argument
1043 return fib_insert_node(t, tp, new, key); in fib_insert_alias()
1068 leaf_push_suffix(tp, l); in fib_insert_alias()
1079 struct key_vector *l, *tp; in fib_table_insert() local
1103 l = fib_find_node(t, &tp, key); in fib_table_insert()
1229 err = fib_insert_alias(t, tp, l, new_fa, fa, key); in fib_table_insert()
1438 static void fib_remove_alias(struct trie *t, struct key_vector *tp, in fib_remove_alias() argument
1452 put_child_root(tp, l->key, NULL); in fib_remove_alias()
1454 trie_rebalance(t, tp); in fib_remove_alias()
1464 leaf_pull_suffix(tp, l); in fib_remove_alias()
1472 struct key_vector *l, *tp; in fib_table_delete() local
1486 l = fib_find_node(t, &tp, key); in fib_table_delete()
1530 fib_remove_alias(t, tp, l, fa_to_delete); in fib_table_delete()
1659 struct key_vector *l, *tp = ot->kv; in fib_trie_unmerge() local
1674 while ((l = leaf_walk_rcu(&tp, key)) != NULL) { in fib_trie_unmerge()
1923 struct key_vector *l, *tp = t->kv; in fib_table_dump() local
1930 while ((l = leaf_walk_rcu(&tp, key)) != NULL) { in fib_table_dump()
2437 struct key_vector *l, **tp = &iter->tnode; in fib_route_get_idx() local
2452 while ((l = leaf_walk_rcu(tp, key)) != NULL) { in fib_route_get_idx()