Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14956643 authored by Li RongQing's avatar Li RongQing Committed by David S. Miller
Browse files

ipv6: slight optimization in ip6_dst_gc



entries is always greater than rt_max_size here, since if entries is less
than rt_max_size, the fib6_run_gc function will be skipped

Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9e641bdc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1455,7 +1455,7 @@ static int ip6_dst_gc(struct dst_ops *ops)
		goto out;
		goto out;


	net->ipv6.ip6_rt_gc_expire++;
	net->ipv6.ip6_rt_gc_expire++;
	fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net, entries > rt_max_size);
	fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net, true);
	entries = dst_entries_get_slow(ops);
	entries = dst_entries_get_slow(ops);
	if (entries < ops->gc_thresh)
	if (entries < ops->gc_thresh)
		net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1;
		net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1;