• Home
  • Raw
  • Download

Lines Matching refs:fa

76 				   int dst_len, struct fib_alias *fa,  in call_fib_entry_notifier()  argument
83 .fi = fa->fa_info, in call_fib_entry_notifier()
84 .tos = fa->fa_tos, in call_fib_entry_notifier()
85 .type = fa->fa_type, in call_fib_entry_notifier()
86 .tb_id = fa->tb_id, in call_fib_entry_notifier()
93 int dst_len, struct fib_alias *fa, in call_fib_entry_notifiers() argument
100 .fi = fa->fa_info, in call_fib_entry_notifiers()
101 .tos = fa->fa_tos, in call_fib_entry_notifiers()
102 .type = fa->fa_type, in call_fib_entry_notifiers()
103 .tb_id = fa->tb_id, in call_fib_entry_notifiers()
295 struct fib_alias *fa = container_of(head, struct fib_alias, rcu); in __alias_free_mem() local
296 kmem_cache_free(fn_alias_kmem, fa); in __alias_free_mem()
299 static inline void alias_free_mem_rcu(struct fib_alias *fa) in alias_free_mem_rcu() argument
301 call_rcu(&fa->rcu, __alias_free_mem); in alias_free_mem_rcu()
352 static struct key_vector *leaf_new(t_key key, struct fib_alias *fa) in leaf_new() argument
366 l->slen = fa->fa_slen; in leaf_new()
370 hlist_add_head(&fa->fa_list, &l->leaf); in leaf_new()
985 struct fib_alias *fa; in fib_find_alias() local
990 hlist_for_each_entry(fa, fah, fa_list) { in fib_find_alias()
991 if (fa->fa_slen < slen) in fib_find_alias()
993 if (fa->fa_slen != slen) in fib_find_alias()
995 if (fa->tb_id > tb_id) in fib_find_alias()
997 if (fa->tb_id != tb_id) in fib_find_alias()
1000 return fa; in fib_find_alias()
1001 if (fa->fa_tos > tos) in fib_find_alias()
1003 if (fa->fa_info->fib_priority >= prio || fa->fa_tos < tos) in fib_find_alias()
1004 return fa; in fib_find_alias()
1016 struct fib_alias *fa; in fib_find_matching_alias() local
1028 hlist_for_each_entry_rcu(fa, &l->leaf, fa_list) { in fib_find_matching_alias()
1029 if (fa->fa_slen == slen && fa->tb_id == fri->tb_id && in fib_find_matching_alias()
1030 fa->fa_tos == fri->tos && fa->fa_info == fri->fi && in fib_find_matching_alias()
1031 fa->fa_type == fri->type) in fib_find_matching_alias()
1032 return fa; in fib_find_matching_alias()
1156 struct fib_alias *fa, t_key key) in fib_insert_alias() argument
1161 if (fa) { in fib_insert_alias()
1162 hlist_add_before_rcu(&new->fa_list, &fa->fa_list); in fib_insert_alias()
1172 fa = last; in fib_insert_alias()
1175 if (fa) in fib_insert_alias()
1176 hlist_add_behind_rcu(&new->fa_list, &fa->fa_list); in fib_insert_alias()
1214 struct fib_alias *fa, *new_fa; in fib_table_insert() local
1238 fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority, in fib_table_insert()
1250 if (fa && fa->fa_tos == tos && in fib_table_insert()
1251 fa->fa_info->fib_priority == fi->fib_priority) { in fib_table_insert()
1266 fa_first = fa; in fib_table_insert()
1267 hlist_for_each_entry_from(fa, fa_list) { in fib_table_insert()
1268 if ((fa->fa_slen != slen) || in fib_table_insert()
1269 (fa->tb_id != tb->tb_id) || in fib_table_insert()
1270 (fa->fa_tos != tos)) in fib_table_insert()
1272 if (fa->fa_info->fib_priority != fi->fib_priority) in fib_table_insert()
1274 if (fa->fa_type == cfg->fc_type && in fib_table_insert()
1275 fa->fa_info == fi) { in fib_table_insert()
1276 fa_match = fa; in fib_table_insert()
1286 fa = fa_first; in fib_table_insert()
1288 if (fa == fa_match) in fib_table_insert()
1297 fi_drop = fa->fa_info; in fib_table_insert()
1298 new_fa->fa_tos = fa->fa_tos; in fib_table_insert()
1301 state = fa->fa_state; in fib_table_insert()
1303 new_fa->fa_slen = fa->fa_slen; in fib_table_insert()
1310 hlist_replace_rcu(&fa->fa_list, &new_fa->fa_list); in fib_table_insert()
1312 if (fib_find_alias(&l->leaf, fa->fa_slen, 0, 0, in fib_table_insert()
1322 &fa->fa_list); in fib_table_insert()
1330 alias_free_mem_rcu(fa); in fib_table_insert()
1348 fa = fa_first; in fib_table_insert()
1372 err = fib_insert_alias(t, tp, l, new_fa, fa, key); in fib_table_insert()
1450 struct fib_alias *fa; in fib_table_lookup() local
1570 hlist_for_each_entry_rcu(fa, &n->leaf, fa_list) { in fib_table_lookup()
1571 struct fib_info *fi = fa->fa_info; in fib_table_lookup()
1575 if ((BITS_PER_LONG > KEYLENGTH) || (fa->fa_slen < KEYLENGTH)) { in fib_table_lookup()
1576 if (index >= (1ul << fa->fa_slen)) in fib_table_lookup()
1579 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) in fib_table_lookup()
1584 if (fa->fa_info->fib_scope < flp->flowi4_scope) in fib_table_lookup()
1586 fib_alias_accessed(fa); in fib_table_lookup()
1587 err = fib_props[fa->fa_type].error; in fib_table_lookup()
1622 res->prefixlen = KEYLENGTH - fa->fa_slen; in fib_table_lookup()
1625 res->type = fa->fa_type; in fib_table_lookup()
1651 struct fib_alias *fa = hlist_entry(pprev, typeof(*fa), fa_list.next); in fib_remove_alias() local
1673 l->slen = fa->fa_slen; in fib_remove_alias()
1674 node_pull_suffix(tp, fa->fa_slen); in fib_remove_alias()
1712 struct fib_alias *fa, *fa_to_delete; in fib_table_delete() local
1728 fa = fib_find_alias(&l->leaf, slen, tos, 0, tb->tb_id, false); in fib_table_delete()
1729 if (!fa) in fib_table_delete()
1735 hlist_for_each_entry_from(fa, fa_list) { in fib_table_delete()
1736 struct fib_info *fi = fa->fa_info; in fib_table_delete()
1738 if ((fa->fa_slen != slen) || in fib_table_delete()
1739 (fa->tb_id != tb->tb_id) || in fib_table_delete()
1740 (fa->fa_tos != tos)) in fib_table_delete()
1743 if ((!cfg->fc_type || fa->fa_type == cfg->fc_type) && in fib_table_delete()
1745 fa->fa_info->fib_scope == cfg->fc_scope) && in fib_table_delete()
1752 fa_to_delete = fa; in fib_table_delete()
1841 struct fib_alias *fa; in fib_trie_free() local
1878 hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) { in fib_trie_free()
1879 hlist_del_rcu(&fa->fa_list); in fib_trie_free()
1880 alias_free_mem_rcu(fa); in fib_trie_free()
1898 struct fib_alias *fa; in fib_trie_unmerge() local
1914 hlist_for_each_entry(fa, &l->leaf, fa_list) { in fib_trie_unmerge()
1917 if (local_tb->tb_id != fa->tb_id) in fib_trie_unmerge()
1925 memcpy(new_fa, fa, sizeof(*fa)); in fib_trie_unmerge()
1958 struct fib_alias *fa; in fib_table_flush_external() local
1996 hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) { in fib_table_flush_external()
2000 if (tb->tb_id != fa->tb_id) { in fib_table_flush_external()
2001 hlist_del_rcu(&fa->fa_list); in fib_table_flush_external()
2002 alias_free_mem_rcu(fa); in fib_table_flush_external()
2007 slen = fa->fa_slen; in fib_table_flush_external()
2027 struct fib_alias *fa; in fib_table_flush() local
2066 hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) { in fib_table_flush()
2067 struct fib_info *fi = fa->fa_info; in fib_table_flush()
2069 if (!fi || tb->tb_id != fa->tb_id || in fib_table_flush()
2071 !fib_props[fa->fa_type].error)) { in fib_table_flush()
2072 slen = fa->fa_slen; in fib_table_flush()
2079 if (!flush_all && fib_props[fa->fa_type].error) { in fib_table_flush()
2080 slen = fa->fa_slen; in fib_table_flush()
2084 fib_notify_alias_delete(net, n->key, &n->leaf, fa, in fib_table_flush()
2086 hlist_del_rcu(&fa->fa_list); in fib_table_flush()
2087 fib_release_info(fa->fa_info); in fib_table_flush()
2088 alias_free_mem_rcu(fa); in fib_table_flush()
2112 struct fib_alias *fa; in __fib_info_notify_update() local
2141 hlist_for_each_entry(fa, &n->leaf, fa_list) { in __fib_info_notify_update()
2142 struct fib_info *fi = fa->fa_info; in __fib_info_notify_update()
2144 if (!fi || !fi->nh_updated || fa->tb_id != tb->tb_id) in __fib_info_notify_update()
2147 rtmsg_fib(RTM_NEWROUTE, htonl(n->key), fa, in __fib_info_notify_update()
2148 KEYLENGTH - fa->fa_slen, tb->tb_id, in __fib_info_notify_update()
2172 struct fib_alias *fa; in fib_leaf_notify() local
2176 hlist_for_each_entry_rcu(fa, &l->leaf, fa_list) { in fib_leaf_notify()
2177 struct fib_info *fi = fa->fa_info; in fib_leaf_notify()
2185 if (tb->tb_id != fa->tb_id) in fib_leaf_notify()
2188 if (fa->fa_slen == last_slen) in fib_leaf_notify()
2191 last_slen = fa->fa_slen; in fib_leaf_notify()
2193 l->key, KEYLENGTH - fa->fa_slen, in fib_leaf_notify()
2194 fa, extack); in fib_leaf_notify()
2265 struct fib_alias *fa; in fn_trie_dump_leaf() local
2276 hlist_for_each_entry_rcu(fa, &l->leaf, fa_list) { in fn_trie_dump_leaf()
2277 struct fib_info *fi = fa->fa_info; in fn_trie_dump_leaf()
2284 if (tb->tb_id != fa->tb_id) in fn_trie_dump_leaf()
2288 if (filter->rt_type && fa->fa_type != filter->rt_type) in fn_trie_dump_leaf()
2307 fri.dst_len = KEYLENGTH - fa->fa_slen; in fn_trie_dump_leaf()
2308 fri.tos = fa->fa_tos; in fn_trie_dump_leaf()
2309 fri.type = fa->fa_type; in fn_trie_dump_leaf()
2310 fri.offload = READ_ONCE(fa->offload); in fn_trie_dump_leaf()
2311 fri.trap = READ_ONCE(fa->trap); in fn_trie_dump_leaf()
2312 fri.offload_failed = READ_ONCE(fa->offload_failed); in fn_trie_dump_leaf()
2523 struct fib_alias *fa; in trie_collect_stats() local
2530 hlist_for_each_entry_rcu(fa, &n->leaf, fa_list) in trie_collect_stats()
2805 struct fib_alias *fa; in fib_trie_seq_show() local
2810 hlist_for_each_entry_rcu(fa, &n->leaf, fa_list) { in fib_trie_seq_show()
2815 KEYLENGTH - fa->fa_slen, in fib_trie_seq_show()
2817 fa->fa_info->fib_scope), in fib_trie_seq_show()
2819 fa->fa_type)); in fib_trie_seq_show()
2820 if (fa->fa_tos) in fib_trie_seq_show()
2821 seq_printf(seq, " tos=%d", fa->fa_tos); in fib_trie_seq_show()
2960 struct fib_alias *fa; in fib_route_seq_show() local
2973 hlist_for_each_entry_rcu(fa, &l->leaf, fa_list) { in fib_route_seq_show()
2974 struct fib_info *fi = fa->fa_info; in fib_route_seq_show()
2975 __be32 mask = inet_make_mask(KEYLENGTH - fa->fa_slen); in fib_route_seq_show()
2976 unsigned int flags = fib_flag_trans(fa->fa_type, mask, fi); in fib_route_seq_show()
2978 if ((fa->fa_type == RTN_BROADCAST) || in fib_route_seq_show()
2979 (fa->fa_type == RTN_MULTICAST)) in fib_route_seq_show()
2982 if (fa->tb_id != tb->tb_id) in fib_route_seq_show()