net: ipv4: fib_trie: Don't unnecessarily search for already found fib leaf
We've already found leaf, don't search for it again. Same is for fib leaf info. Signed-off-by: Igor Maravic <igorm@etf.rs> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
418a99ac6a
commit
ad5b310228
@@ -1656,7 +1656,12 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
|
|||||||
if (!l)
|
if (!l)
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
|
|
||||||
fa_head = get_fa_head(l, plen);
|
li = find_leaf_info(l, plen);
|
||||||
|
|
||||||
|
if (!li)
|
||||||
|
return -ESRCH;
|
||||||
|
|
||||||
|
fa_head = &li->falh;
|
||||||
fa = fib_find_alias(fa_head, tos, 0);
|
fa = fib_find_alias(fa_head, tos, 0);
|
||||||
|
|
||||||
if (!fa)
|
if (!fa)
|
||||||
@@ -1692,9 +1697,6 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
|
|||||||
rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
|
rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
|
||||||
&cfg->fc_nlinfo, 0);
|
&cfg->fc_nlinfo, 0);
|
||||||
|
|
||||||
l = fib_find_node(t, key);
|
|
||||||
li = find_leaf_info(l, plen);
|
|
||||||
|
|
||||||
list_del_rcu(&fa->fa_list);
|
list_del_rcu(&fa->fa_list);
|
||||||
|
|
||||||
if (!plen)
|
if (!plen)
|
||||||
|
Reference in New Issue
Block a user