]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ipv6: use DST_NOCOUNT in ip6_rt_pcpu_alloc()
authorEric Dumazet <edumazet@google.com>
Fri, 8 May 2020 14:34:14 +0000 (07:34 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 May 2020 05:34:17 +0000 (22:34 -0700)
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: Eric 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: Wei Wang <weiwan@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/route.c

index a9072dba00f4fb0b61bce1fc0f44a3a81ba702fa..4292653af533bb641ae8571fffe45b39327d0380 100644 (file)
@@ -1377,7 +1377,7 @@ static struct rt6_info *ip6_rt_pcpu_alloc(const struct fib6_result *res)
 
        rcu_read_lock();
        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();
        if (!pcpu_rt) {
                fib6_info_release(f6i);