summaryrefslogtreecommitdiffstats
path: root/net/core/dst.c
diff options
context:
space:
mode:
authorPeter Oskolkov <posk@google.com>2019-01-16 08:50:28 -0800
committerDavid S. Miller <davem@davemloft.net>2019-01-17 15:37:25 -0800
commit22c2ad616b74f3de2256b242572ab449d031d941 (patch)
tree2f524ff4a9b64a392a83a13014ea0143351b3478 /net/core/dst.c
parent68d7431553a0cd05bce98d1c1d3fc56b3a1807c0 (diff)
downloadlinux-22c2ad616b74f3de2256b242572ab449d031d941.tar.gz
linux-22c2ad616b74f3de2256b242572ab449d031d941.tar.bz2
linux-22c2ad616b74f3de2256b242572ab449d031d941.zip
net: add a route cache full diagnostic message
In some testing scenarios, dst/route cache can fill up so quickly that even an explicit GC call occasionally fails to clean it up. This leads to sporadically failing calls to dst_alloc and "network unreachable" errors to the user, which is confusing. This patch adds a diagnostic message to make the cause of the failure easier to determine. Signed-off-by: Peter Oskolkov <posk@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dst.c')
-rw-r--r--net/core/dst.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c
index 81ccf20e2826..a263309df115 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -98,8 +98,12 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
struct dst_entry *dst;
if (ops->gc && dst_entries_get_fast(ops) > ops->gc_thresh) {
- if (ops->gc(ops))
+ if (ops->gc(ops)) {
+ printk_ratelimited(KERN_NOTICE "Route cache is full: "
+ "consider increasing sysctl "
+ "net.ipv[4|6].route.max_size.\n");
return NULL;
+ }
}
dst = kmem_cache_alloc(ops->kmem_cachep, GFP_ATOMIC);