Lines Matching refs:tb

1021 	struct fib_table *tb;
1025 tb = fib_get_table(net, fri->tb_id);
1026 if (!tb)
1029 t = (struct trie *)tb->tb_data;
1216 int fib_table_insert(struct net *net, struct fib_table *tb,
1219 struct trie *t = (struct trie *)tb->tb_data;
1235 pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen);
1246 tb->tb_id, false) : NULL;
1276 (fa->tb_id != tb->tb_id) ||
1311 new_fa->tb_id = tb->tb_id;
1320 tb->tb_id, true) == new_fa) {
1335 tb->tb_id, &cfg->fc_nlinfo, nlflags);
1372 new_fa->tb_id = tb->tb_id;
1390 if (fib_find_alias(&l->leaf, new_fa->fa_slen, 0, 0, tb->tb_id, true) ==
1402 tb->tb_num_default++;
1445 int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
1448 struct trie *t = (struct trie *) tb->tb_data;
1463 trace_fib_table_lookup(tb->tb_id, flp, NULL, -EAGAIN);
1549 trace_fib_table_lookup(tb->tb_id, flp,
1598 trace_fib_table_lookup(tb->tb_id, flp, NULL, err);
1633 res->table = tb;
1638 trace_fib_table_lookup(tb->tb_id, flp, nhc, err);
1713 int fib_table_delete(struct net *net, struct fib_table *tb,
1716 struct trie *t = (struct trie *) tb->tb_data;
1734 fa = fib_find_alias(&l->leaf, slen, dscp, 0, tb->tb_id, false);
1746 (fa->tb_id != tb->tb_id) ||
1768 rtmsg_fib(RTM_DELROUTE, htonl(key), fa_to_delete, plen, tb->tb_id,
1772 tb->tb_num_default--;
1842 static void fib_trie_free(struct fib_table *tb)
1844 struct trie *t = (struct trie *)tb->tb_data;
1897 kfree(tb);
1959 void fib_table_flush_external(struct fib_table *tb)
1961 struct trie *t = (struct trie *)tb->tb_data;
2007 if (tb->tb_id != fa->tb_id) {
2028 int fib_table_flush(struct net *net, struct fib_table *tb, bool flush_all)
2030 struct trie *t = (struct trie *)tb->tb_data;
2077 if (!fi || tb->tb_id != fa->tb_id ||
2096 KEYLENGTH - fa->fa_slen, tb->tb_id, &info, 0);
2117 static void __fib_info_notify_update(struct net *net, struct fib_table *tb,
2120 struct trie *t = (struct trie *)tb->tb_data;
2155 if (!fi || !fi->nh_updated || fa->tb_id != tb->tb_id)
2159 KEYLENGTH - fa->fa_slen, tb->tb_id,
2171 struct fib_table *tb;
2173 hlist_for_each_entry_rcu(tb, head, tb_hlist,
2175 __fib_info_notify_update(net, tb, info);
2179 static int fib_leaf_notify(struct key_vector *l, struct fib_table *tb,
2196 if (tb->tb_id != fa->tb_id)
2212 static int fib_table_notify(struct fib_table *tb, struct notifier_block *nb,
2215 struct trie *t = (struct trie *)tb->tb_data;
2221 err = fib_leaf_notify(l, tb, nb, extack);
2241 struct fib_table *tb;
2243 hlist_for_each_entry_rcu(tb, head, tb_hlist) {
2244 err = fib_table_notify(tb, nb, extack);
2254 struct fib_table *tb = container_of(head, struct fib_table, rcu);
2256 struct trie *t = (struct trie *)tb->tb_data;
2258 if (tb->tb_data == tb->__data)
2261 kfree(tb);
2264 void fib_free_table(struct fib_table *tb)
2266 call_rcu(&tb->rcu, __trie_free_rcu);
2269 static int fn_trie_dump_leaf(struct key_vector *l, struct fib_table *tb,
2295 if (tb->tb_id != fa->tb_id)
2316 fri.tb_id = tb->tb_id;
2336 err = fib_dump_info_fnhe(skb, cb, tb->tb_id, fi,
2356 int fib_table_dump(struct fib_table *tb, struct sk_buff *skb,
2359 struct trie *t = (struct trie *)tb->tb_data;
2376 err = fn_trie_dump_leaf(l, tb, skb, cb, filter);
2413 struct fib_table *tb;
2415 size_t sz = sizeof(*tb);
2420 tb = kzalloc(sz, GFP_KERNEL);
2421 if (!tb)
2424 tb->tb_id = id;
2425 tb->tb_num_default = 0;
2426 tb->tb_data = (alias ? alias->__data : tb->__data);
2429 return tb;
2431 t = (struct trie *) tb->tb_data;
2437 kfree(tb);
2438 tb = NULL;
2442 return tb;
2449 struct fib_table *tb;
2626 static void fib_table_print(struct seq_file *seq, struct fib_table *tb)
2628 if (tb->tb_id == RT_TABLE_LOCAL)
2630 else if (tb->tb_id == RT_TABLE_MAIN)
2633 seq_printf(seq, "Id %d:\n", tb->tb_id);
2650 struct fib_table *tb;
2652 hlist_for_each_entry_rcu(tb, head, tb_hlist) {
2653 struct trie *t = (struct trie *) tb->tb_data;
2659 fib_table_print(seq, tb);
2683 struct fib_table *tb;
2685 hlist_for_each_entry_rcu(tb, head, tb_hlist) {
2689 (struct trie *) tb->tb_data);
2692 iter->tb = tb;
2712 struct fib_table *tb = iter->tb;
2724 h = tb->tb_id & (FIB_TABLE_HASHSZ - 1);
2725 while ((tb_node = rcu_dereference(hlist_next_rcu(&tb->tb_hlist)))) {
2726 tb = hlist_entry(tb_node, struct fib_table, tb_hlist);
2727 n = fib_trie_get_first(iter, (struct trie *) tb->tb_data);
2735 hlist_for_each_entry_rcu(tb, head, tb_hlist) {
2736 n = fib_trie_get_first(iter, (struct trie *) tb->tb_data);
2744 iter->tb = tb;
2804 fib_table_print(seq, iter->tb);
2894 struct fib_table *tb;
2899 tb = fib_get_table(seq_file_net(seq), RT_TABLE_MAIN);
2900 if (!tb)
2903 iter->main_tb = tb;
2904 t = (struct trie *)tb->tb_data;
2971 struct fib_table *tb = iter->main_tb;
2994 if (fa->tb_id != tb->tb_id)