Lines Matching refs:bits
123 unsigned char bits; /* 2log(KEYLENGTH) bits needed */ member
219 BUG_ON(i >= 1U << tn->bits); in tnode_get_child()
229 BUG_ON(i >= 1U << tn->bits); in tnode_get_child_rcu()
236 return 1 << tn->bits; in tnode_child_length()
244 static inline t_key tkey_extract_bits(t_key a, unsigned int offset, unsigned int bits) in tkey_extract_bits() argument
247 return ((t_key)(a << offset)) >> (KEYLENGTH - bits); in tkey_extract_bits()
257 static inline int tkey_sub_equals(t_key a, int offset, int bits, t_key b) in tkey_sub_equals() argument
259 if (bits == 0 || offset >= KEYLENGTH) in tkey_sub_equals()
261 bits = bits > KEYLENGTH ? KEYLENGTH : bits; in tkey_sub_equals()
262 return ((a ^ b) << offset) >> (KEYLENGTH - bits) == 0; in tkey_sub_equals()
342 WARN_ON(tn && tn->pos+tn->bits > 32); in check_tnode()
389 (sizeof(struct rt_trie_node *) << tn->bits); in __tnode_free_rcu()
411 (sizeof(struct rt_trie_node *) << tn->bits); in tnode_free_safe()
451 static struct tnode *tnode_new(t_key key, int pos, int bits) in tnode_new() argument
453 size_t sz = sizeof(struct tnode) + (sizeof(struct rt_trie_node *) << bits); in tnode_new()
459 tn->bits = bits; in tnode_new()
462 tn->empty_children = 1<<bits; in tnode_new()
466 sizeof(struct rt_trie_node *) << bits); in tnode_new()
480 return ((struct tnode *) n)->pos == tn->pos + tn->bits; in tnode_full()
500 BUG_ON(i >= 1<<tn->bits); in tnode_put_child_reorg()
653 while (tn->bits > 1 && max_work-- && in resize()
711 tn = tnode_new(oldtnode->key, oldtnode->pos, oldtnode->bits + 1); in inflate()
729 inode->pos == oldtnode->pos + oldtnode->bits && in inflate()
730 inode->bits > 1) { in inflate()
735 inode->bits - 1); in inflate()
740 inode->bits - 1); in inflate()
765 tn->pos + tn->bits - 1) { in inflate()
767 oldtnode->pos + oldtnode->bits, in inflate()
778 if (inode->bits == 1) { in inflate()
845 tn = tnode_new(oldtnode->key, oldtnode->pos, oldtnode->bits - 1); in halve()
865 newn = tnode_new(left->key, tn->pos + tn->bits, 1); in halve()
971 pos = tn->pos + tn->bits; in fib_find_node()
975 tn->bits)); in fib_find_node()
996 cindex = tkey_extract_bits(key, tp->pos, tp->bits); in trie_rebalance()
1062 pos = tn->pos + tn->bits; in fib_insert_node()
1066 tn->bits)); in fib_insert_node()
1115 cindex = tkey_extract_bits(key, tp->pos, tp->bits); in fib_insert_node()
1125 pos = tp->pos+tp->bits; in fib_insert_node()
1150 cindex = tkey_extract_bits(key, tp->pos, tp->bits); in fib_insert_node()
1158 if (tp && tp->pos + tp->bits > 32) in fib_insert_node()
1160 tp, tp->pos, tp->bits, key, plen); in fib_insert_node()
1412 unsigned int pos, bits; in fib_table_lookup() local
1441 bits = pn->bits; in fib_table_lookup()
1445 pos, bits); in fib_table_lookup()
1494 if (current_prefix_length < pos+bits) { in fib_table_lookup()
1559 while ((chopped_off <= pn->bits) in fib_table_lookup()
1564 if (current_prefix_length > pn->pos + pn->bits - chopped_off) in fib_table_lookup()
1565 current_prefix_length = pn->pos + pn->bits in fib_table_lookup()
1573 if (chopped_off <= pn->bits) { in fib_table_lookup()
1581 cindex = tkey_extract_bits(pn->key, parent->pos, parent->bits); in fib_table_lookup()
1609 t_key cindex = tkey_extract_bits(l->key, tp->pos, tp->bits); in trie_leaf_remove()
1755 idx = tkey_extract_bits(c->key, p->pos, p->bits) + 1; in leaf_walk_rcu()
1759 while (idx < 1u << p->bits) { in leaf_walk_rcu()
2013 while (cindex < (1<<tn->bits)) { in fib_trie_get_next()
2035 cindex = tkey_extract_bits(tn->key, p->pos, p->bits)+1; in fib_trie_get_next()
2095 if (tn->bits < MAX_STAT_DEPTH) in trie_collect_stats()
2096 s->nodesizes[tn->bits]++; in trie_collect_stats()
2098 for (i = 0; i < (1<<tn->bits); i++) in trie_collect_stats()
2362 &prf, tn->pos, tn->bits, tn->full_children, in fib_trie_seq_show()