All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: add queue debugfs file
@ 2009-06-14 15:37 Johannes Berg
  2009-06-14 17:50 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-06-14 15:37 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

I suspect that some driver bugs can cause queues to be
stopped while they shouldn't be, but it's hard to find
out whether that is the case or not without having any
visible information about the queues. This adds a file
to debugfs that allows us to see the queues' statuses.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/debugfs.c     |   25 +++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h |    1 +
 2 files changed, 26 insertions(+)

--- wireless-testing.orig/net/mac80211/debugfs.c	2009-06-14 17:18:26.000000000 +0200
+++ wireless-testing/net/mac80211/debugfs.c	2009-06-14 17:28:07.000000000 +0200
@@ -163,6 +163,29 @@ static const struct file_operations noac
 	.open = mac80211_open_file_generic
 };
 
+static ssize_t queues_read(struct file *file, char __user *user_buf,
+			   size_t count, loff_t *ppos)
+{
+	struct ieee80211_local *local = file->private_data;
+	unsigned long flags;
+	char buf[IEEE80211_MAX_QUEUES * 20];
+	int q, res = 0;
+
+	spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
+	for (q = 0; q < local->hw.queues; q++)
+		res += sprintf(buf + res, "%02d: %#.8lx/%d\n", q,
+				local->queue_stop_reasons[q],
+				__netif_subqueue_stopped(local->mdev, q));
+	spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
+
+	return simple_read_from_buffer(user_buf, count, ppos, buf, res);
+}
+
+static const struct file_operations queues_ops = {
+	.read = queues_read,
+	.open = mac80211_open_file_generic
+};
+
 /* statistics stuff */
 
 #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...)			\
@@ -298,6 +321,7 @@ void debugfs_hw_add(struct ieee80211_loc
 	DEBUGFS_ADD(total_ps_buffered);
 	DEBUGFS_ADD(wep_iv);
 	DEBUGFS_ADD(tsf);
+	DEBUGFS_ADD(queues);
 	DEBUGFS_ADD_MODE(reset, 0200);
 	DEBUGFS_ADD(noack);
 
@@ -350,6 +374,7 @@ void debugfs_hw_del(struct ieee80211_loc
 	DEBUGFS_DEL(total_ps_buffered);
 	DEBUGFS_DEL(wep_iv);
 	DEBUGFS_DEL(tsf);
+	DEBUGFS_DEL(queues);
 	DEBUGFS_DEL(reset);
 	DEBUGFS_DEL(noack);
 
--- wireless-testing.orig/net/mac80211/ieee80211_i.h	2009-06-14 17:27:19.000000000 +0200
+++ wireless-testing/net/mac80211/ieee80211_i.h	2009-06-14 17:27:25.000000000 +0200
@@ -783,6 +783,7 @@ struct ieee80211_local {
 		struct dentry *total_ps_buffered;
 		struct dentry *wep_iv;
 		struct dentry *tsf;
+		struct dentry *queues;
 		struct dentry *reset;
 		struct dentry *noack;
 		struct dentry *statistics;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: add queue debugfs file
  2009-06-14 15:37 [PATCH] mac80211: add queue debugfs file Johannes Berg
@ 2009-06-14 17:50 ` Kalle Valo
  2009-06-14 18:03   ` Guy, Wey-Yi W
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2009-06-14 17:50 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless

Johannes Berg <johannes@sipsolutions.net> writes:

> I suspect that some driver bugs can cause queues to be
> stopped while they shouldn't be, but it's hard to find
> out whether that is the case or not without having any
> visible information about the queues. This adds a file
> to debugfs that allows us to see the queues' statuses.

I have to admit that I have managed to do that sometimes with wl12xx, so
this is a welcomed debugging aid :)

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] mac80211: add queue debugfs file
  2009-06-14 17:50 ` Kalle Valo
@ 2009-06-14 18:03   ` Guy, Wey-Yi W
  0 siblings, 0 replies; 3+ messages in thread
From: Guy, Wey-Yi W @ 2009-06-14 18:03 UTC (permalink / raw)
  To: Kalle Valo, Johannes Berg; +Cc: John Linville, linux-wireless

Same for iwlwifi, it is a very helpful debugging aid.

Wey-Yi Guy
Intel Corporation
2111 N.E. 25th Avenue  M/S JF3-308                 
Hillsboro OR 97124-5961
USA
Work Phone: 503-264-6023 (OR)
Cell Phone: 503-329-8410
Email: wey-yi.w.guy@intel.com
 

-----Original Message-----
From: linux-wireless-owner@vger.kernel.org [mailto:linux-wireless-owner@vger.kernel.org] On Behalf Of Kalle Valo
Sent: Sunday, June 14, 2009 10:51 AM
To: Johannes Berg
Cc: John Linville; linux-wireless
Subject: Re: [PATCH] mac80211: add queue debugfs file

Johannes Berg <johannes@sipsolutions.net> writes:

> I suspect that some driver bugs can cause queues to be
> stopped while they shouldn't be, but it's hard to find
> out whether that is the case or not without having any
> visible information about the queues. This adds a file
> to debugfs that allows us to see the queues' statuses.

I have to admit that I have managed to do that sometimes with wl12xx, so
this is a welcomed debugging aid :)

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-14 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-14 15:37 [PATCH] mac80211: add queue debugfs file Johannes Berg
2009-06-14 17:50 ` Kalle Valo
2009-06-14 18:03   ` Guy, Wey-Yi W

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.