Lines Matching refs:tb

1081 int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)  in fib_table_insert()  argument
1083 struct trie *t = (struct trie *)tb->tb_data; in fib_table_insert()
1099 pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen); in fib_table_insert()
1112 tb->tb_id) : NULL; in fib_table_insert()
1140 (fa->tb_id != tb->tb_id) || in fib_table_insert()
1174 new_fa->tb_id = tb->tb_id; in fib_table_insert()
1181 tb->tb_id); in fib_table_insert()
1196 tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE); in fib_table_insert()
1226 new_fa->tb_id = tb->tb_id; in fib_table_insert()
1231 cfg->fc_nlflags, tb->tb_id); in fib_table_insert()
1243 tb->tb_num_default++; in fib_table_insert()
1252 switchdev_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type, tb->tb_id); in fib_table_insert()
1269 int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, in fib_table_lookup() argument
1272 struct trie *t = (struct trie *) tb->tb_data; in fib_table_lookup()
1282 trace_fib_table_lookup(tb->tb_id, flp); in fib_table_lookup()
1443 res->table = tb; in fib_table_lookup()
1490 int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) in fib_table_delete() argument
1492 struct trie *t = (struct trie *) tb->tb_data; in fib_table_delete()
1512 fa = fib_find_alias(&l->leaf, slen, tos, 0, tb->tb_id); in fib_table_delete()
1523 (fa->tb_id != tb->tb_id) || in fib_table_delete()
1544 cfg->fc_type, tb->tb_id); in fib_table_delete()
1546 rtmsg_fib(RTM_DELROUTE, htonl(key), fa_to_delete, plen, tb->tb_id, in fib_table_delete()
1550 tb->tb_num_default--; in fib_table_delete()
1620 static void fib_trie_free(struct fib_table *tb) in fib_trie_free() argument
1622 struct trie *t = (struct trie *)tb->tb_data; in fib_trie_free()
1675 kfree(tb); in fib_trie_free()
1735 void fib_table_flush_external(struct fib_table *tb) in fib_table_flush_external() argument
1737 struct trie *t = (struct trie *)tb->tb_data; in fib_table_flush_external()
1781 if (tb->tb_id != fa->tb_id) { in fib_table_flush_external()
1795 tb->tb_id); in fib_table_flush_external()
1809 int fib_table_flush(struct fib_table *tb) in fib_table_flush() argument
1811 struct trie *t = (struct trie *)tb->tb_data; in fib_table_flush()
1860 tb->tb_id); in fib_table_flush()
1882 struct fib_table *tb = container_of(head, struct fib_table, rcu); in __trie_free_rcu() local
1884 struct trie *t = (struct trie *)tb->tb_data; in __trie_free_rcu()
1886 if (tb->tb_data == tb->__data) in __trie_free_rcu()
1889 kfree(tb); in __trie_free_rcu()
1892 void fib_free_table(struct fib_table *tb) in fib_free_table() argument
1894 call_rcu(&tb->rcu, __trie_free_rcu); in fib_free_table()
1897 static int fn_trie_dump_leaf(struct key_vector *l, struct fib_table *tb, in fn_trie_dump_leaf() argument
1914 if (tb->tb_id != fa->tb_id) { in fn_trie_dump_leaf()
1922 tb->tb_id, in fn_trie_dump_leaf()
1939 int fib_table_dump(struct fib_table *tb, struct sk_buff *skb, in fib_table_dump() argument
1942 struct trie *t = (struct trie *)tb->tb_data; in fib_table_dump()
1951 if (fn_trie_dump_leaf(l, tb, skb, cb) < 0) { in fib_table_dump()
1987 struct fib_table *tb; in fib_trie_table() local
1989 size_t sz = sizeof(*tb); in fib_trie_table()
1994 tb = kzalloc(sz, GFP_KERNEL); in fib_trie_table()
1995 if (!tb) in fib_trie_table()
1998 tb->tb_id = id; in fib_trie_table()
1999 tb->tb_num_default = 0; in fib_trie_table()
2000 tb->tb_data = (alias ? alias->__data : tb->__data); in fib_trie_table()
2003 return tb; in fib_trie_table()
2005 t = (struct trie *) tb->tb_data; in fib_trie_table()
2011 kfree(tb); in fib_trie_table()
2012 tb = NULL; in fib_trie_table()
2016 return tb; in fib_trie_table()
2023 struct fib_table *tb; member
2200 static void fib_table_print(struct seq_file *seq, struct fib_table *tb) in fib_table_print() argument
2202 if (tb->tb_id == RT_TABLE_LOCAL) in fib_table_print()
2204 else if (tb->tb_id == RT_TABLE_MAIN) in fib_table_print()
2207 seq_printf(seq, "Id %d:\n", tb->tb_id); in fib_table_print()
2223 struct fib_table *tb; in fib_triestat_seq_show() local
2225 hlist_for_each_entry_rcu(tb, head, tb_hlist) { in fib_triestat_seq_show()
2226 struct trie *t = (struct trie *) tb->tb_data; in fib_triestat_seq_show()
2232 fib_table_print(seq, tb); in fib_triestat_seq_show()
2267 struct fib_table *tb; in fib_trie_get_idx() local
2269 hlist_for_each_entry_rcu(tb, head, tb_hlist) { in fib_trie_get_idx()
2273 (struct trie *) tb->tb_data); in fib_trie_get_idx()
2276 iter->tb = tb; in fib_trie_get_idx()
2296 struct fib_table *tb = iter->tb; in fib_trie_seq_next() local
2308 h = tb->tb_id & (FIB_TABLE_HASHSZ - 1); in fib_trie_seq_next()
2309 while ((tb_node = rcu_dereference(hlist_next_rcu(&tb->tb_hlist)))) { in fib_trie_seq_next()
2310 tb = hlist_entry(tb_node, struct fib_table, tb_hlist); in fib_trie_seq_next()
2311 n = fib_trie_get_first(iter, (struct trie *) tb->tb_data); in fib_trie_seq_next()
2319 hlist_for_each_entry_rcu(tb, head, tb_hlist) { in fib_trie_seq_next()
2320 n = fib_trie_get_first(iter, (struct trie *) tb->tb_data); in fib_trie_seq_next()
2328 iter->tb = tb; in fib_trie_seq_next()
2388 fib_table_print(seq, iter->tb); in fib_trie_seq_show()
2456 struct fib_table *tb = iter->main_tb; in fib_route_get_idx() local
2466 t = (struct trie *)tb->tb_data; in fib_route_get_idx()
2498 struct fib_table *tb; in fib_route_seq_start() local
2503 tb = fib_get_table(seq_file_net(seq), RT_TABLE_MAIN); in fib_route_seq_start()
2504 if (!tb) in fib_route_seq_start()
2507 iter->main_tb = tb; in fib_route_seq_start()
2512 t = (struct trie *)tb->tb_data; in fib_route_seq_start()
2571 struct fib_table *tb = iter->main_tb; in fib_route_seq_show() local
2594 if (fa->tb_id != tb->tb_id) in fib_route_seq_show()