Loading include/net/ip_fib.h +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ struct fib_table { struct hlist_node tb_hlist; u32 tb_id; unsigned tb_stamp; int tb_default; int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res); int (*tb_insert)(struct fib_table *, struct fib_config *); int (*tb_delete)(struct fib_table *, struct fib_config *); Loading net/ipv4/fib_hash.c +8 −8 Original line number Diff line number Diff line Loading @@ -272,8 +272,6 @@ fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result return err; } static int fn_hash_last_dflt=-1; static void fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) { Loading Loading @@ -314,9 +312,9 @@ fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib if (next_fi != res->fi) break; } else if (!fib_detect_death(fi, order, &last_resort, &last_idx, fn_hash_last_dflt)) { &last_idx, tb->tb_default)) { fib_result_assign(res, fi); fn_hash_last_dflt = order; tb->tb_default = order; goto out; } fi = next_fi; Loading @@ -325,19 +323,20 @@ fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib } if (order <= 0 || fi == NULL) { fn_hash_last_dflt = -1; tb->tb_default = -1; goto out; } if (!fib_detect_death(fi, order, &last_resort, &last_idx, fn_hash_last_dflt)) { if (!fib_detect_death(fi, order, &last_resort, &last_idx, tb->tb_default)) { fib_result_assign(res, fi); fn_hash_last_dflt = order; tb->tb_default = order; goto out; } if (last_idx >= 0) fib_result_assign(res, last_resort); fn_hash_last_dflt = last_idx; tb->tb_default = last_idx; out: read_unlock(&fib_hash_lock); } Loading Loading @@ -773,6 +772,7 @@ struct fib_table * __init fib_hash_init(u32 id) return NULL; tb->tb_id = id; tb->tb_default = -1; tb->tb_lookup = fn_hash_lookup; tb->tb_insert = fn_hash_insert; tb->tb_delete = fn_hash_delete; Loading net/ipv4/fib_trie.c +9 −9 Original line number Diff line number Diff line Loading @@ -1782,8 +1782,6 @@ static int fn_trie_flush(struct fib_table *tb) return found; } static int trie_last_dflt = -1; static void fn_trie_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) { Loading Loading @@ -1830,28 +1828,29 @@ fn_trie_select_default(struct fib_table *tb, const struct flowi *flp, struct fib if (next_fi != res->fi) break; } else if (!fib_detect_death(fi, order, &last_resort, &last_idx, trie_last_dflt)) { &last_idx, tb->tb_default)) { fib_result_assign(res, fi); trie_last_dflt = order; tb->tb_default = order; goto out; } fi = next_fi; order++; } if (order <= 0 || fi == NULL) { trie_last_dflt = -1; tb->tb_default = -1; goto out; } if (!fib_detect_death(fi, order, &last_resort, &last_idx, trie_last_dflt)) { if (!fib_detect_death(fi, order, &last_resort, &last_idx, tb->tb_default)) { fib_result_assign(res, fi); trie_last_dflt = order; tb->tb_default = order; goto out; } if (last_idx >= 0) fib_result_assign(res, last_resort); trie_last_dflt = last_idx; out:; tb->tb_default = last_idx; out: rcu_read_unlock(); } Loading Loading @@ -1978,6 +1977,7 @@ struct fib_table * __init fib_hash_init(u32 id) return NULL; tb->tb_id = id; tb->tb_default = -1; tb->tb_lookup = fn_trie_lookup; tb->tb_insert = fn_trie_insert; tb->tb_delete = fn_trie_delete; Loading Loading
include/net/ip_fib.h +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ struct fib_table { struct hlist_node tb_hlist; u32 tb_id; unsigned tb_stamp; int tb_default; int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res); int (*tb_insert)(struct fib_table *, struct fib_config *); int (*tb_delete)(struct fib_table *, struct fib_config *); Loading
net/ipv4/fib_hash.c +8 −8 Original line number Diff line number Diff line Loading @@ -272,8 +272,6 @@ fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result return err; } static int fn_hash_last_dflt=-1; static void fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) { Loading Loading @@ -314,9 +312,9 @@ fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib if (next_fi != res->fi) break; } else if (!fib_detect_death(fi, order, &last_resort, &last_idx, fn_hash_last_dflt)) { &last_idx, tb->tb_default)) { fib_result_assign(res, fi); fn_hash_last_dflt = order; tb->tb_default = order; goto out; } fi = next_fi; Loading @@ -325,19 +323,20 @@ fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib } if (order <= 0 || fi == NULL) { fn_hash_last_dflt = -1; tb->tb_default = -1; goto out; } if (!fib_detect_death(fi, order, &last_resort, &last_idx, fn_hash_last_dflt)) { if (!fib_detect_death(fi, order, &last_resort, &last_idx, tb->tb_default)) { fib_result_assign(res, fi); fn_hash_last_dflt = order; tb->tb_default = order; goto out; } if (last_idx >= 0) fib_result_assign(res, last_resort); fn_hash_last_dflt = last_idx; tb->tb_default = last_idx; out: read_unlock(&fib_hash_lock); } Loading Loading @@ -773,6 +772,7 @@ struct fib_table * __init fib_hash_init(u32 id) return NULL; tb->tb_id = id; tb->tb_default = -1; tb->tb_lookup = fn_hash_lookup; tb->tb_insert = fn_hash_insert; tb->tb_delete = fn_hash_delete; Loading
net/ipv4/fib_trie.c +9 −9 Original line number Diff line number Diff line Loading @@ -1782,8 +1782,6 @@ static int fn_trie_flush(struct fib_table *tb) return found; } static int trie_last_dflt = -1; static void fn_trie_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) { Loading Loading @@ -1830,28 +1828,29 @@ fn_trie_select_default(struct fib_table *tb, const struct flowi *flp, struct fib if (next_fi != res->fi) break; } else if (!fib_detect_death(fi, order, &last_resort, &last_idx, trie_last_dflt)) { &last_idx, tb->tb_default)) { fib_result_assign(res, fi); trie_last_dflt = order; tb->tb_default = order; goto out; } fi = next_fi; order++; } if (order <= 0 || fi == NULL) { trie_last_dflt = -1; tb->tb_default = -1; goto out; } if (!fib_detect_death(fi, order, &last_resort, &last_idx, trie_last_dflt)) { if (!fib_detect_death(fi, order, &last_resort, &last_idx, tb->tb_default)) { fib_result_assign(res, fi); trie_last_dflt = order; tb->tb_default = order; goto out; } if (last_idx >= 0) fib_result_assign(res, last_resort); trie_last_dflt = last_idx; out:; tb->tb_default = last_idx; out: rcu_read_unlock(); } Loading Loading @@ -1978,6 +1977,7 @@ struct fib_table * __init fib_hash_init(u32 id) return NULL; tb->tb_id = id; tb->tb_default = -1; tb->tb_lookup = fn_trie_lookup; tb->tb_insert = fn_trie_insert; tb->tb_delete = fn_trie_delete; Loading