net: Provide details on watchdog timeout.
Subsystems (3)
This keeps the WARN_ON but will also log normal kernel messages after the WARN_ON logic has happened once.
---
:100644 100644 2aeb3a4... 66e6154... M net/sched/sch_generic.c
net/sched/sch_generic.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-)
net/sched/sch_generic.c +20 -3
@@ -253,9 +253,26 @@ static void dev_watchdog(unsigned long arg) }if (some_queue_timedout) { -char drivername[64 ]; -WARN_ONCE (1 ,KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n" , - dev->name,netdev_drivername (dev, drivername,64 ), i); +static bool do_once = true; +if (do_once ||net_ratelimit ()) { +char drivername[64 ]; +if (unlikely (do_once)) { +WARN (1 ,KERN_INFO "NETDEV WATCHDOG: %s (%s): " +"transmit queue %u timed out" +" trans-start: %lu jiffies: %lu\n" , + dev->name, +netdev_drivername (dev, drivername,64 ), + i, trans_start, jiffies); + do_once = false; + } +else +printk (KERN_INFO "NETDEV WATCHDOG: %s (%s): " +"transmit queue %u timed out" +" trans-start: %lu jiffies: %lu\n" , + dev->name, +netdev_drivername (dev, drivername,64 ), + i, trans_start, jiffies); + } dev->netdev_ops->ndo_tx_timeout (dev); } if (!mod_timer(&dev->watchdog_timer,
Signature · 1 line
1.6.2.5
Quoted 2 lines · Ben Greear
This keeps the
WARN_ONbut will also log normal kernel messages after theWARN_ONlogic has happened once.
This is compile-tested only, by the way.
Thanks,
Ben
Quoted 41 lines
Signed-off-by Ben Greear<[email protected]>---
:100644 100644 2aeb3a4... 66e6154... Mnet/sched/sch_generic.cnet/sched/sch_generic.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-)net/sched/sch_generic.c +20
-3@@ -253,9 +253,26 @@ static void dev_watchdog(unsigned long arg) }if (some_queue_timedout) { -char drivername[64 ]; -WARN_ONCE (1 ,KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n" , - dev->name,netdev_drivername (dev, drivername,64 ), i); +static bool do_once = true; +if (do_once ||net_ratelimit ()) { +char drivername[64 ]; +if (unlikely (do_once)) { +WARN (1 ,KERN_INFO "NETDEV WATCHDOG: %s (%s): " +"transmit queue %u timed out" +" trans-start: %lu jiffies: %lu\n" , + dev->name, +netdev_drivername (dev, drivername,64 ), + i, trans_start, jiffies); + do_once = false; + } +else +printk (KERN_INFO "NETDEV WATCHDOG: %s (%s): " +"transmit queue %u timed out" +" trans-start: %lu jiffies: %lu\n" , + dev->name, +netdev_drivername (dev, drivername,64 ), + i, trans_start, jiffies); + } dev->netdev_ops->ndo_tx_timeout (dev); } if (!mod_timer(&dev->watchdog_timer,
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
David Miller
maintainerFrom: Ben Greear <[email protected]>
Date: Mon, 9 Aug 2010 12:59:14 -0700
Quoted 4 lines
This keeps the
WARN_ONbut will also log normal kernel messages after theWARN_ONlogic has happened once.Signed-off-by Ben Greear <[email protected]>
I think this warning is fine as-is.
Quoted 9 lines · David Miller
From: Ben Greear<[email protected]>
Date: Mon, 9 Aug 2010 12:59:14 -0700Quoted 4 lines
This keeps the
WARN_ONbut will also log normal kernel messages after theWARN_ONlogic has happened once.Signed-off-by Ben Greear<[email protected]>I think this warning is fine as-is.
Ok, thanks for looking.
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com