Skip to contentSkip to conversation

net: add a route cache full diagnostic message

PATCH Applied Peter Oskolkov 2 participants 2 messages Jan 16, 2019 – Jan 17, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 net/core/dst.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/core/dst.c +5 -1
index 81ccf20e2826..a263309df115 100644
@@ -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);
maintainer Applied
#1 lore raw

From: Peter Oskolkov <[email protected]>
Date: Wed, 16 Jan 2019 08:50:28 -0800

Quoted 9 lines

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.

Applied.