]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: Add net_cookie to Dead loop messages
authorChris J Arges <carges@cloudflare.com>
Wed, 8 Apr 2026 19:10:47 +0000 (14:10 -0500)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Apr 2026 16:05:02 +0000 (09:05 -0700)
Network devices can have the same name within different network namespaces.
To help distinguish these devices, add the net_cookie value which can be
used to identify the netns.

Signed-off-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20260408191056.1036330-1-carges@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c
net/ipv4/ip_tunnel_core.c

index e7bc95cbd1faa7f25009d51945ed4405d52fffad..ccc4418b31631e94df72a307a8e7a33c8b1d8a3d 100644 (file)
@@ -4894,8 +4894,9 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
        } else {
                /* Recursion is detected! It is possible unfortunately. */
 recursion_alert:
-               net_crit_ratelimited("Dead loop on virtual device %s, fix it urgently!\n",
-                                    dev->name);
+               net_crit_ratelimited("Dead loop on virtual device %s (net %llu), fix it urgently!\n",
+                                    dev->name, dev_net(dev)->net_cookie);
+
                rc = -ENETDOWN;
        }
 
index f430d6f0463e7ab5761e98047a866d304a49abb2..2667f53482bdaf1e693907fc527063d0ddd45580 100644 (file)
@@ -60,8 +60,8 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
 
        if (unlikely(dev_recursion_level() > IP_TUNNEL_RECURSION_LIMIT)) {
                if (dev) {
-                       net_crit_ratelimited("Dead loop on virtual device %s, fix it urgently!\n",
-                                            dev->name);
+                       net_crit_ratelimited("Dead loop on virtual device %s (net %llu), fix it urgently!\n",
+                                            dev->name, dev_net(dev)->net_cookie);
                        DEV_STATS_INC(dev, tx_errors);
                }
                ip_rt_put(rt);