Skip to contentSkip to conversation

net: add a generic tracepoint for TX queue timeout

PATCH Applied Cong Wang 4 participants 4 messages May 2, 2019 – May 4, 2019

Subsystems (4)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH v2 1/1 net: add a generic tracepoint for TX queue timeout

Although devlink health report does a nice job on reporting TX timeout and other NIC errors, unfortunately it requires drivers to support it but currently only mlx5 has implemented it. Before other drivers could catch up, it is useful to have a generic tracepoint to monitor this kind of TX timeout. We have been suffering TX timeout with different drivers, we plan to start to monitor it with rasdaemon which just needs a new tracepoint.

Sample output:

ksoftirqd/1-16 [001] ..s2 144.043173: net_dev_xmit_timeout: dev=ens3 driver=e1000 queue=0

Cc Eran Ben Elisha <[email protected]>
Cc Jiri Pirko <[email protected]>
---
 include/trace/events/net.h | 23 +++++++++++++++++++++++
 net/sched/sch_generic.c    |  2 ++
 2 files changed, 25 insertions(+)
include/trace/events/net.h +23 -0
index 1efd7d9b25fe..2399073c3afc 100644
@@ -95,6 +95,29 @@ TRACE_EVENT(net_dev_xmit,
 		__get_str(name), __entry->skbaddr, __entry->len, __entry->rc)
 );
 
+TRACE_EVENT(net_dev_xmit_timeout,
+
+	TP_PROTO(struct net_device *dev,
+		 int queue_index),
+
+	TP_ARGS(dev, queue_index),
+
+	TP_STRUCT__entry(
+		__string(	name,		dev->name	)
+		__string(	driver,		netdev_drivername(dev))
+		__field(	int,		queue_index	)
+	),
+
+	TP_fast_assign(
+		__assign_str(name, dev->name);
+		__assign_str(driver, netdev_drivername(dev));
+		__entry->queue_index = queue_index;
+	),
+
+	TP_printk("dev=%s driver=%s queue=%d",
+		__get_str(name), __get_str(driver), __entry->queue_index)
+);
+
 DECLARE_EVENT_CLASS(net_dev_template,
 
 	TP_PROTO(struct sk_buff *skb),
net/sched/sch_generic.c +2 -0
index 848aab3693bd..cce1e9ee85af 100644
@@ -32,6 +32,7 @@
 #include <net/pkt_sched.h>
 #include <net/dst.h>
 #include <trace/events/qdisc.h>
+#include <trace/events/net.h>
 #include <net/xfrm.h>
 
 /* Qdisc to use by default */
@@ -441,6 +442,7 @@ static void dev_watchdog(struct timer_list *t)
 			}
 
 			if (some_queue_timedout) {
+				trace_net_dev_xmit_timeout(dev, i);
 				WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n",
 				       dev->name, netdev_drivername(dev), i);
 				dev->netdev_ops->ndo_tx_timeout(dev);
Signature · 1 line
2.20.1
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 8 lines · Thu, May 02, 2019 at 04:56:59AM CEST, [email protected] wrote:

Although devlink health report does a nice job on reporting TX timeout and other NIC errors, unfortunately it requires drivers to support it but currently only mlx5 has implemented it. Before other drivers could catch up, it is useful to have a generic tracepoint to monitor this kind of TX timeout. We have been suffering TX timeout with different drivers, we plan to start to monitor it with rasdaemon which just needs a new tracepoint.

Quoted 7 lines

Sample output:

ksoftirqd/1-16 [001] ..s2 144.043173: net_dev_xmit_timeout: dev=ens3 driver=e1000 queue=0

Cc Eran Ben Elisha <[email protected]>
Cc Jiri Pirko <[email protected]>

Useful. Thanks!

Reviewed-by on v2 1/1
#2 lore raw
In reply to Cong Wang
Quoted 8 lines · Cong Wang

Although devlink health report does a nice job on reporting TX timeout and other NIC errors, unfortunately it requires drivers to support it but currently only mlx5 has implemented it. Before other drivers could catch up, it is useful to have a generic tracepoint to monitor this kind of TX timeout. We have been suffering TX timeout with different drivers, we plan to start to monitor it with rasdaemon which just needs a new tracepoint.

Quoted 7 lines

Sample output:

   ksoftirqd/1-16    [001] ..s2   144.043173: net_dev_xmit_timeout: dev=ens3 driver=e1000 queue=0
Cc Eran Ben Elisha <[email protected]>
Cc Jiri Pirko <[email protected]>
maintainer Applied
#3 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Wed, 1 May 2019 19:56:59 -0700

Quoted 8 lines

Although devlink health report does a nice job on reporting TX timeout and other NIC errors, unfortunately it requires drivers to support it but currently only mlx5 has implemented it. Before other drivers could catch up, it is useful to have a generic tracepoint to monitor this kind of TX timeout. We have been suffering TX timeout with different drivers, we plan to start to monitor it with rasdaemon which just needs a new tracepoint.

Quoted 7 lines

Sample output:

ksoftirqd/1-16 [001] ..s2 144.043173: net_dev_xmit_timeout: dev=ens3 driver=e1000 queue=0

Cc Eran Ben Elisha <[email protected]>
Cc Jiri Pirko <[email protected]>

Applied, thanks Cong.