* [PATCH net-next v2] net: Add net_cookie to Dead loop messages
@ 2026-04-08 19:10 Chris J Arges
0 siblings, 0 replies; only message in thread
From: Chris J Arges @ 2026-04-08 19:10 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, David Ahern
Cc: kernel-team, Chris J Arges, netdev, linux-kernel
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>
---
v2: rebased on net-next
---
net/core/dev.c | 5 +++--
net/ipv4/ip_tunnel_core.c | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 5a31f9d2128c..3c752ba3aa29 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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;
}
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index f430d6f0463e..2667f53482bd 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -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);
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-08 19:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 19:10 [PATCH net-next v2] net: Add net_cookie to Dead loop messages Chris J Arges
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox