Lines Matching refs:tb
1075 int fib_table_insert(struct fib_table *tb, struct fib_config *cfg) in fib_table_insert() argument
1077 struct trie *t = (struct trie *)tb->tb_data; in fib_table_insert()
1092 pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen); in fib_table_insert()
1105 tb->tb_id) : NULL; in fib_table_insert()
1133 (fa->tb_id != tb->tb_id) || in fib_table_insert()
1167 new_fa->tb_id = tb->tb_id; in fib_table_insert()
1173 tb->tb_id); in fib_table_insert()
1188 tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE); in fib_table_insert()
1216 new_fa->tb_id = tb->tb_id; in fib_table_insert()
1222 tb->tb_id); in fib_table_insert()
1234 tb->tb_num_default++; in fib_table_insert()
1243 netdev_switch_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type, tb->tb_id); in fib_table_insert()
1260 int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, in fib_table_lookup() argument
1263 struct trie *t = (struct trie *) tb->tb_data; in fib_table_lookup()
1423 res->table = tb; in fib_table_lookup()
1468 int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) in fib_table_delete() argument
1470 struct trie *t = (struct trie *) tb->tb_data; in fib_table_delete()
1490 fa = fib_find_alias(&l->leaf, slen, tos, 0, tb->tb_id); in fib_table_delete()
1501 (fa->tb_id != tb->tb_id) || in fib_table_delete()
1522 cfg->fc_type, tb->tb_id); in fib_table_delete()
1524 rtmsg_fib(RTM_DELROUTE, htonl(key), fa_to_delete, plen, tb->tb_id, in fib_table_delete()
1528 tb->tb_num_default--; in fib_table_delete()
1598 static void fib_trie_free(struct fib_table *tb) in fib_trie_free() argument
1600 struct trie *t = (struct trie *)tb->tb_data; in fib_trie_free()
1653 kfree(tb); in fib_trie_free()
1713 void fib_table_flush_external(struct fib_table *tb) in fib_table_flush_external() argument
1715 struct trie *t = (struct trie *)tb->tb_data; in fib_table_flush_external()
1759 if (tb->tb_id != fa->tb_id) { in fib_table_flush_external()
1774 fa->fa_type, tb->tb_id); in fib_table_flush_external()
1788 int fib_table_flush(struct fib_table *tb) in fib_table_flush() argument
1790 struct trie *t = (struct trie *)tb->tb_data; in fib_table_flush()
1840 fa->fa_type, tb->tb_id); in fib_table_flush()
1862 struct fib_table *tb = container_of(head, struct fib_table, rcu); in __trie_free_rcu() local
1864 struct trie *t = (struct trie *)tb->tb_data; in __trie_free_rcu()
1866 if (tb->tb_data == tb->__data) in __trie_free_rcu()
1869 kfree(tb); in __trie_free_rcu()
1872 void fib_free_table(struct fib_table *tb) in fib_free_table() argument
1874 call_rcu(&tb->rcu, __trie_free_rcu); in fib_free_table()
1877 static int fn_trie_dump_leaf(struct key_vector *l, struct fib_table *tb, in fn_trie_dump_leaf() argument
1894 if (tb->tb_id != fa->tb_id) { in fn_trie_dump_leaf()
1902 tb->tb_id, in fn_trie_dump_leaf()
1919 int fib_table_dump(struct fib_table *tb, struct sk_buff *skb, in fib_table_dump() argument
1922 struct trie *t = (struct trie *)tb->tb_data; in fib_table_dump()
1931 if (fn_trie_dump_leaf(l, tb, skb, cb) < 0) { in fib_table_dump()
1967 struct fib_table *tb; in fib_trie_table() local
1969 size_t sz = sizeof(*tb); in fib_trie_table()
1974 tb = kzalloc(sz, GFP_KERNEL); in fib_trie_table()
1975 if (!tb) in fib_trie_table()
1978 tb->tb_id = id; in fib_trie_table()
1979 tb->tb_default = -1; in fib_trie_table()
1980 tb->tb_num_default = 0; in fib_trie_table()
1981 tb->tb_data = (alias ? alias->__data : tb->__data); in fib_trie_table()
1984 return tb; in fib_trie_table()
1986 t = (struct trie *) tb->tb_data; in fib_trie_table()
1992 kfree(tb); in fib_trie_table()
1993 tb = NULL; in fib_trie_table()
1997 return tb; in fib_trie_table()
2004 struct fib_table *tb; member
2180 static void fib_table_print(struct seq_file *seq, struct fib_table *tb) in fib_table_print() argument
2182 if (tb->tb_id == RT_TABLE_LOCAL) in fib_table_print()
2184 else if (tb->tb_id == RT_TABLE_MAIN) in fib_table_print()
2187 seq_printf(seq, "Id %d:\n", tb->tb_id); in fib_table_print()
2203 struct fib_table *tb; in fib_triestat_seq_show() local
2205 hlist_for_each_entry_rcu(tb, head, tb_hlist) { in fib_triestat_seq_show()
2206 struct trie *t = (struct trie *) tb->tb_data; in fib_triestat_seq_show()
2212 fib_table_print(seq, tb); in fib_triestat_seq_show()
2247 struct fib_table *tb; in fib_trie_get_idx() local
2249 hlist_for_each_entry_rcu(tb, head, tb_hlist) { in fib_trie_get_idx()
2253 (struct trie *) tb->tb_data); in fib_trie_get_idx()
2256 iter->tb = tb; in fib_trie_get_idx()
2276 struct fib_table *tb = iter->tb; in fib_trie_seq_next() local
2288 h = tb->tb_id & (FIB_TABLE_HASHSZ - 1); in fib_trie_seq_next()
2289 while ((tb_node = rcu_dereference(hlist_next_rcu(&tb->tb_hlist)))) { in fib_trie_seq_next()
2290 tb = hlist_entry(tb_node, struct fib_table, tb_hlist); in fib_trie_seq_next()
2291 n = fib_trie_get_first(iter, (struct trie *) tb->tb_data); in fib_trie_seq_next()
2299 hlist_for_each_entry_rcu(tb, head, tb_hlist) { in fib_trie_seq_next()
2300 n = fib_trie_get_first(iter, (struct trie *) tb->tb_data); in fib_trie_seq_next()
2308 iter->tb = tb; in fib_trie_seq_next()
2368 fib_table_print(seq, iter->tb); in fib_trie_seq_show()
2436 struct fib_table *tb = iter->main_tb; in fib_route_get_idx() local
2446 t = (struct trie *)tb->tb_data; in fib_route_get_idx()
2478 struct fib_table *tb; in fib_route_seq_start() local
2483 tb = fib_get_table(seq_file_net(seq), RT_TABLE_MAIN); in fib_route_seq_start()
2484 if (!tb) in fib_route_seq_start()
2487 iter->main_tb = tb; in fib_route_seq_start()
2492 t = (struct trie *)tb->tb_data; in fib_route_seq_start()
2551 struct fib_table *tb = iter->main_tb; in fib_route_seq_show() local
2574 if (fa->tb_id != tb->tb_id) in fib_route_seq_show()