[PATCH] net: Ensure tx watchdog failures always print.

Subsystems: networking [general], tc subsystem, the rest

STALE5526d

6 messages, 3 authors, 2011-06-14 · open the first message on its own page

[PATCH] net: Ensure tx watchdog failures always print.

From: <hidden>
Date: 2011-06-14 16:50:21

From: Ben Greear <redacted>

These are too important to not have some log message
generated.  But, keep the logic that only prints
a single stack dump.

Signed-off-by: Ben Greear <redacted>
---
:100644 100644 90939ba... fce5558... M	net/sched/sch_generic.c
 net/sched/sch_generic.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 90939ba..fce5558 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -252,8 +252,20 @@ 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;
+				printk(KERN_INFO "NETDEV WATCHDOG: %s (%s):"
+				       " transmit queue %u timed out,"
+				       " trans_start: %lu, wd-timeout: %i"
+				       " jiffies: %lu tx-queues: %i\n",
+				       dev->name,
+				       netdev_drivername(dev, drivername, 64),
+				       i,
+				       trans_start, dev->watchdog_timeo,
+				       jiffies, dev->num_tx_queues);
+				if (do_once) {
+					do_once = false;
+					WARN_ON(1);
+				}
 				dev->netdev_ops->ndo_tx_timeout(dev);
 			}
 			if (!mod_timer(&dev->watchdog_timer,
-- 
1.7.3.4

Re: [PATCH] net: Ensure tx watchdog failures always print.

From: Eric Dumazet <hidden>
Date: 2011-06-14 17:14:37

Le mardi 14 juin 2011 à 09:50 -0700, greearb@candelatech.com a écrit :
quoted hunk
From: Ben Greear <redacted>

These are too important to not have some log message
generated.  But, keep the logic that only prints
a single stack dump.

Signed-off-by: Ben Greear <redacted>
---
:100644 100644 90939ba... fce5558... M	net/sched/sch_generic.c
 net/sched/sch_generic.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 90939ba..fce5558 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -252,8 +252,20 @@ 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;
+				printk(KERN_INFO "NETDEV WATCHDOG: %s (%s):"
+				       " transmit queue %u timed out,"
+				       " trans_start: %lu, wd-timeout: %i"
+				       " jiffies: %lu tx-queues: %i\n",
+				       dev->name,
+				       netdev_drivername(dev, drivername, 64),
+				       i,
+				       trans_start, dev->watchdog_timeo,
+				       jiffies, dev->num_tx_queues);
+				if (do_once) {
+					do_once = false;
+					WARN_ON(1);
You could use WARN_ON_ONCE(1) here 
+				}
 				dev->netdev_ops->ndo_tx_timeout(dev);
 			}
 			if (!mod_timer(&dev->watchdog_timer,

Re: [PATCH] net: Ensure tx watchdog failures always print.

From: Ben Greear <hidden>
Date: 2011-06-14 17:25:27

On 06/14/2011 10:14 AM, Eric Dumazet wrote:
Le mardi 14 juin 2011 à 09:50 -0700, greearb@candelatech.com a écrit :
quoted
From: Ben Greear<redacted>

These are too important to not have some log message
generated.  But, keep the logic that only prints
a single stack dump.

Signed-off-by: Ben Greear<redacted>
---
:100644 100644 90939ba... fce5558... M	net/sched/sch_generic.c
  net/sched/sch_generic.c |   16 ++++++++++++++--
  1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 90939ba..fce5558 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -252,8 +252,20 @@ 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;
+				printk(KERN_INFO "NETDEV WATCHDOG: %s (%s):"
+				       " transmit queue %u timed out,"
+				       " trans_start: %lu, wd-timeout: %i"
+				       " jiffies: %lu tx-queues: %i\n",
+				       dev->name,
+				       netdev_drivername(dev, drivername, 64),
+				       i,
+				       trans_start, dev->watchdog_timeo,
+				       jiffies, dev->num_tx_queues);
+				if (do_once) {
+					do_once = false;
+					WARN_ON(1);
You could use WARN_ON_ONCE(1) here
Er, right..don't know what I was thinking.

Will re-send.

Thanks,
Ben
quoted
+				}
  				dev->netdev_ops->ndo_tx_timeout(dev);
  			}
  			if (!mod_timer(&dev->watchdog_timer,

-- 
Ben Greear [off-list ref]
Candela Technologies Inc  http://www.candelatech.com

Re: [PATCH] net: Ensure tx watchdog failures always print.

From: David Miller <davem@davemloft.net>
Date: 2011-06-14 17:34:28

From: Ben Greear <redacted>
Date: Tue, 14 Jun 2011 10:25:13 -0700
Will re-send.
Please, don't bother, see my other reply.

Re: [PATCH] net: Ensure tx watchdog failures always print.

From: David Miller <davem@davemloft.net>
Date: 2011-06-14 17:33:32

From: greearb@candelatech.com
Date: Tue, 14 Jun 2011 09:50:13 -0700
From: Ben Greear <redacted>

These are too important to not have some log message
generated.  But, keep the logic that only prints
a single stack dump.

Signed-off-by: Ben Greear <redacted>
We specifically made this print out only once, and yes
all of it.

Because it spams people's logs to the point that the message
is not useful and only scrolls out other more important
messages.

I'm not applying this, sorry.

Re: [PATCH] net: Ensure tx watchdog failures always print.

From: Ben Greear <hidden>
Date: 2011-06-14 17:41:43

On 06/14/2011 10:33 AM, David Miller wrote:
From: greearb@candelatech.com
Date: Tue, 14 Jun 2011 09:50:13 -0700
quoted
From: Ben Greear<redacted>

These are too important to not have some log message
generated.  But, keep the logic that only prints
a single stack dump.

Signed-off-by: Ben Greear<redacted>
We specifically made this print out only once, and yes
all of it.

Because it spams people's logs to the point that the message
is not useful and only scrolls out other more important
messages.

I'm not applying this, sorry.
Is it really legit for a driver to spam this message?  I hit
this due to bugs in my code that sent pkts to the wrong
driver queue, but aside from that, we rarely if ever see
the message print.

Thanks,
Ben


-- 
Ben Greear [off-list ref]
Candela Technologies Inc  http://www.candelatech.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help