Commit d8882935 authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski

ipv6: use DST_NOCOUNT in ip6_rt_pcpu_alloc()

We currently have to adjust ipv6 route gc_thresh/max_size depending
on number of cpus on a server, this makes very little sense.

If the kernels sets /proc/sys/net/ipv6/route/gc_thresh to 1024
and /proc/sys/net/ipv6/route/max_size to 4096, then we better
not track the percpu dst that our implementation uses.

Only routes not added (directly or indirectly) by the admin
should be tracked and limited.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: David Ahern <dsahern@kernel.org>
Cc: Maciej Żenczykowski <maze@google.com>
Acked-by: default avatarWei Wang <weiwan@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b41d272e
...@@ -1377,7 +1377,7 @@ static struct rt6_info *ip6_rt_pcpu_alloc(const struct fib6_result *res) ...@@ -1377,7 +1377,7 @@ static struct rt6_info *ip6_rt_pcpu_alloc(const struct fib6_result *res)
rcu_read_lock(); rcu_read_lock();
dev = ip6_rt_get_dev_rcu(res); dev = ip6_rt_get_dev_rcu(res);
pcpu_rt = ip6_dst_alloc(dev_net(dev), dev, flags); pcpu_rt = ip6_dst_alloc(dev_net(dev), dev, flags | DST_NOCOUNT);
rcu_read_unlock(); rcu_read_unlock();
if (!pcpu_rt) { if (!pcpu_rt) {
fib6_info_release(f6i); fib6_info_release(f6i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment