Skip to contentSkip to conversation

net: Add net_cookie to Dead loop messages

PATCH Applied Chris J Arges 2 participants 2 messages Apr 8 – Apr 12

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

PATCH v2 1/1 net: Add net_cookie to Dead loop messages

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.

---
v2: rebased on net-next

---
 net/core/dev.c            | 5 +++--
 net/ipv4/ip_tunnel_core.c | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
net/core/dev.c +3 -2
index 5a31f9d2128c..3c752ba3aa29 100644
@@ -4886,8 +4886,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;
 	}
 
net/ipv4/ip_tunnel_core.c +2 -2
index f430d6f0463e..2667f53482bd 100644
@@ -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);
Signature · 1 line
2.43.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 8 Apr 2026 14:10:47 -0500 you wrote:

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.

---
v2: rebased on net-next

[...]

Here is the summary with links:
- [net-next,v2] net: Add net_cookie to Dead loop messages

    https://git.kernel.org/netdev/net-next/c/b258cba1e05d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html