diff options
author | david decotigny <david.decotigny@google.com> | 2011-11-16 07:15:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-16 23:14:02 -0500 |
commit | ccf5ff69fbbd8d877377f5786369cf5aa78a15fc (patch) | |
tree | 2c9a7ca29d9b3052fb952ac52445cfb05742a32c /include/linux/netdevice.h | |
parent | 19b05f811341aaef3e5e22d2832aa2d8e0bad5ab (diff) |
net: new counter for tx_timeout errors in sysfs
This adds the /sys/class/net/DEV/queues/Q/tx_timeout attribute
containing the total number of timeout events on the given queue. It
is always available with CONFIG_SYSFS, independently of
CONFIG_RPS/XPS.
Credits to Stephen Hemminger for a preliminary version of this patch.
Tested:
without CONFIG_SYSFS (compilation only)
with sysfs and without CONFIG_RPS & CONFIG_XPS
with sysfs and without CONFIG_RPS
with sysfs and without CONFIG_XPS
with defaults
Signed-off-by: David Decotigny <david.decotigny@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 31da3bbe7b1b..4d5698aa828b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -532,7 +532,7 @@ struct netdev_queue { | |||
532 | struct Qdisc *qdisc; | 532 | struct Qdisc *qdisc; |
533 | unsigned long state; | 533 | unsigned long state; |
534 | struct Qdisc *qdisc_sleeping; | 534 | struct Qdisc *qdisc_sleeping; |
535 | #if defined(CONFIG_RPS) || defined(CONFIG_XPS) | 535 | #ifdef CONFIG_SYSFS |
536 | struct kobject kobj; | 536 | struct kobject kobj; |
537 | #endif | 537 | #endif |
538 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | 538 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) |
@@ -547,6 +547,12 @@ struct netdev_queue { | |||
547 | * please use this field instead of dev->trans_start | 547 | * please use this field instead of dev->trans_start |
548 | */ | 548 | */ |
549 | unsigned long trans_start; | 549 | unsigned long trans_start; |
550 | |||
551 | /* | ||
552 | * Number of TX timeouts for this queue | ||
553 | * (/sys/class/net/DEV/Q/trans_timeout) | ||
554 | */ | ||
555 | unsigned long trans_timeout; | ||
550 | } ____cacheline_aligned_in_smp; | 556 | } ____cacheline_aligned_in_smp; |
551 | 557 | ||
552 | static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) | 558 | static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) |
@@ -1109,9 +1115,11 @@ struct net_device { | |||
1109 | 1115 | ||
1110 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 1116 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
1111 | 1117 | ||
1112 | #if defined(CONFIG_RPS) || defined(CONFIG_XPS) | 1118 | #ifdef CONFIG_SYSFS |
1113 | struct kset *queues_kset; | 1119 | struct kset *queues_kset; |
1120 | #endif | ||
1114 | 1121 | ||
1122 | #ifdef CONFIG_RPS | ||
1115 | struct netdev_rx_queue *_rx; | 1123 | struct netdev_rx_queue *_rx; |
1116 | 1124 | ||
1117 | /* Number of RX queues allocated at register_netdev() time */ | 1125 | /* Number of RX queues allocated at register_netdev() time */ |