Jon Maxwell
0f22c8a6ef
ipv6: remove max_size check inline with ipv4
...
commit af6d10345ca76670c1b7c37799f0d5576ccef277 upstream.
In ip6_dst_gc() replace:
if (entries > gc_thresh)
With:
if (entries > ops->gc_thresh)
Sending Ipv6 packets in a loop via a raw socket triggers an issue where a
route is cloned by ip6_rt_cache_alloc() for each packet sent. This quickly
consumes the Ipv6 max_size threshold which defaults to 4096 resulting in
these warnings:
[1] 99.187805] dst_alloc: 7728 callbacks suppressed
[2] Route cache is full: consider increasing sysctl net.ipv6.route.max_size.
.
.
[300] Route cache is full: consider increasing sysctl net.ipv6.route.max_size.
When this happens the packet is dropped and sendto() gets a network is
unreachable error:
remaining pkt 200557 errno 101
remaining pkt 196462 errno 101
.
.
remaining pkt 126821 errno 101
Implement David Aherns suggestion to remove max_size check seeing that Ipv6
has a GC to manage memory usage. Ipv4 already does not check max_size.
Here are some memory comparisons for Ipv4 vs Ipv6 with the patch:
Test by running 5 instances of a program that sends UDP packets to a raw
socket 5000000 times. Compare Ipv4 and Ipv6 performance with a similar
program.
Ipv4:
Before test:
MemFree: 29427108 kB
Slab: 237612 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0
xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0
ip_dst_cache 2881 3990 192 42 2 : tunables 0 0 0
During test:
MemFree: 29417608 kB
Slab: 247712 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0
xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0
ip_dst_cache 44394 44394 192 42 2 : tunables 0 0 0
After test:
MemFree: 29422308 kB
Slab: 238104 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0
xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0
ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
Ipv6 with patch:
Errno 101 errors are not observed anymore with the patch.
Before test:
MemFree: 29422308 kB
Slab: 238104 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0
xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0
ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
During Test:
MemFree: 29431516 kB
Slab: 240940 kB
ip6_dst_cache 11980 12064 256 32 2 : tunables 0 0 0
xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0
ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
After Test:
MemFree: 29441816 kB
Slab: 238132 kB
ip6_dst_cache 1902 2432 256 32 2 : tunables 0 0 0
xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0
ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
Tested-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20230112012532.311021-1-jmaxwell37@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Cc: "Jitindar Singh, Suraj" <surajjs@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-15 18:54:51 +01:00
..
2022-10-05 07:05:41 +09:00
2024-01-01 12:39:03 +00:00
2021-07-01 13:19:48 -07:00
2021-11-19 11:52:25 +00:00
2024-01-10 17:10:36 +01:00
2023-10-25 12:03:06 +02:00
2021-11-17 20:17:05 -08:00
2022-07-22 12:53:22 +01:00
2023-03-11 13:55:26 +01:00
2023-03-11 13:55:28 +01:00
2022-09-09 08:24:41 +01:00
2023-12-20 17:00:15 +01:00
2022-09-01 11:44:13 +01:00
2024-01-10 17:10:32 +01:00
2022-08-23 10:43:11 +02:00
2022-07-22 12:53:22 +01:00
2023-10-10 22:00:42 +02:00
2022-07-28 22:06:15 -07:00
2022-08-09 22:14:02 -07:00
2021-12-13 12:34:09 +00:00
2022-09-16 14:34:01 +01:00
2023-05-11 23:03:41 +09:00
2022-07-22 12:53:22 +01:00
2023-08-30 16:11:04 +02:00
2021-03-26 17:43:55 +01:00
2022-08-24 13:46:58 +01:00
2023-11-20 11:52:18 +01:00
2022-05-22 21:51:54 +01:00
2022-03-11 10:57:22 +00:00
2021-12-22 15:03:47 -08:00
2022-07-22 12:53:22 +01:00
2021-12-22 15:03:51 -08:00
2022-07-24 18:39:17 -06:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2022-09-30 18:17:16 -07:00
2022-09-07 15:28:08 +01:00
2022-09-30 18:17:17 -07:00
2021-11-29 19:50:45 -08:00
2022-10-03 07:52:13 +01:00
2024-01-15 18:54:51 +01:00
2022-12-31 13:33:02 +01:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2021-12-06 16:06:02 -08:00
2021-12-16 07:18:35 -08:00
2022-07-28 22:21:54 -07:00
2022-09-20 09:13:38 +02:00
2022-09-20 09:13:38 +02:00
2023-11-20 11:52:15 +01:00
2022-07-11 19:49:38 -07:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2021-10-18 12:54:41 +01:00
2023-12-13 18:39:12 +01:00
2021-01-29 20:39:14 -08:00
2022-08-25 16:07:42 -07:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2021-06-28 14:29:45 -07:00
2022-02-04 16:25:21 +01:00
2022-10-07 08:42:00 +01:00
2023-12-20 17:00:15 +01:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2022-07-29 11:58:54 +01:00
2024-01-10 17:10:27 +01:00
2022-08-24 19:30:07 -07:00
2022-02-07 20:12:45 -08:00
2021-10-15 11:33:08 +01:00
2022-07-22 12:53:22 +01:00
2023-01-12 12:02:15 +01:00
2023-08-30 16:11:02 +02:00
2023-01-12 12:02:15 +01:00
2022-02-17 07:00:39 -06:00
2021-11-16 13:16:54 +00:00
2023-09-19 12:28:10 +02:00
2022-07-22 12:53:22 +01:00
2022-04-25 11:40:45 +01:00
2023-10-25 12:03:11 +02:00
2023-09-19 12:28:03 +02:00
2023-05-24 17:32:39 +01:00
2024-01-10 17:10:23 +01:00
2022-09-29 07:18:00 +02:00
2022-07-22 12:53:22 +01:00
2022-02-04 14:15:11 -08:00
2022-09-02 20:34:32 -07:00
2023-09-19 12:28:10 +02:00
2021-03-23 14:14:50 -07:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2021-12-07 20:44:59 -08:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2022-07-28 11:29:36 +02:00
2021-11-07 19:25:29 +00:00
2023-09-13 09:42:33 +02:00
2023-09-13 09:42:34 +02:00
2022-04-25 20:51:12 +02:00
2023-10-19 23:08:53 +02:00
2022-04-01 12:04:15 +01:00
2021-10-29 13:23:51 +01:00
2021-03-26 15:14:56 -07:00
2022-07-22 12:53:22 +01:00
2023-01-07 11:11:44 +01:00
2022-12-31 13:33:02 +01:00
2022-07-22 12:53:22 +01:00
2023-10-10 22:00:42 +02:00
2023-10-10 22:00:42 +02:00
2022-05-11 12:43:10 +01:00
2022-07-11 16:25:14 +02:00
2021-12-10 06:38:26 -08:00
2022-07-22 12:53:22 +01:00
2023-10-10 22:00:44 +02:00
2022-07-22 12:53:22 +01:00
2023-10-10 22:00:46 +02:00
2022-09-02 19:59:08 -07:00
2022-07-22 12:53:22 +01:00
2023-06-05 09:26:20 +02:00
2023-06-14 11:15:16 +02:00
2022-10-02 16:07:17 +01:00
2023-07-23 13:49:27 +02:00
2022-07-22 12:53:22 +01:00
2022-07-15 18:50:35 -07:00
2021-08-09 15:34:21 -07:00
2022-07-22 12:53:22 +01:00
2023-04-13 16:55:23 +02:00
2022-06-19 10:00:02 +01:00
2022-10-11 17:42:58 -06:00
2023-07-19 16:21:10 +02:00
2022-02-02 14:45:18 +00:00
2022-08-01 11:59:23 -07:00
2023-08-11 12:08:14 +02:00
2023-06-14 11:15:20 +02:00
2023-08-30 16:11:02 +02:00
2023-06-21 16:01:01 +02:00
2023-05-11 23:03:18 +09:00
2022-07-22 12:53:22 +01:00
2022-01-04 12:17:35 +00:00
2021-04-28 14:06:45 -07:00
2022-07-27 13:24:42 +01:00
2022-12-31 13:32:04 +01:00
2024-01-10 17:10:36 +01:00
2021-08-03 13:05:26 +01:00
2022-07-22 12:53:22 +01:00
2022-07-18 11:24:10 +01:00
2022-06-29 20:37:36 -07:00
2024-01-10 17:10:27 +01:00
2023-06-05 09:26:18 +02:00
2022-07-22 12:53:22 +01:00
2022-07-22 12:53:22 +01:00
2024-01-10 17:10:28 +01:00
2024-01-10 17:10:27 +01:00
2022-10-12 17:50:37 -07:00
2023-08-11 12:08:17 +02:00
2022-07-22 12:53:22 +01:00
2022-09-30 07:55:46 -07:00
2021-12-29 08:48:14 -08:00
2022-09-26 13:28:19 -07:00
2023-06-28 11:12:28 +02:00
2023-05-11 23:03:21 +09:00