All of lore.kernel.org
 help / color / mirror / Atom feed
* [WT PATCH 1/6] mac80211: Add debugfs file to show station-hash counts.
@ 2013-06-29 22:58 greearb
  2013-06-29 22:58 ` [WT PATCH 2/6] mac80211: Make un-found-rate splat a warn-once greearb
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: greearb @ 2013-06-29 22:58 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Helps debug bad hash spreads, like when you have lots of
station interfaces all connected to the same AP.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/debugfs.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index b0e32d6..2bbe377 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -175,8 +175,44 @@ static ssize_t queues_read(struct file *file, char __user *user_buf,
 	return simple_read_from_buffer(user_buf, count, ppos, buf, res);
 }
 
+static ssize_t sta_hash_read(struct file *file, char __user *user_buf,
+			     size_t count, loff_t *ppos)
+{
+	struct ieee80211_local *local = file->private_data;
+	int mxln = STA_HASH_SIZE * 10;
+	char *buf = kzalloc(mxln, GFP_KERNEL);
+	int q, res = 0;
+	struct sta_info *sta;
+
+	if (!buf)
+		return 0;
+
+	mutex_lock(&local->sta_mtx);
+	for (q = 0; q < STA_HASH_SIZE; q++) {
+		int cnt = 0;
+		sta = local->sta_hash[q];
+		while (sta) {
+			cnt++;
+			sta = sta->hnext;
+		}
+		if (cnt) {
+			res += sprintf(buf + res, "%i: %i\n", q, cnt);
+			if (res >= (STA_HASH_SIZE * 10)) {
+				res = STA_HASH_SIZE * 10;
+				break;
+			}
+		}
+	}
+	mutex_unlock(&local->sta_mtx);
+
+	q = simple_read_from_buffer(user_buf, count, ppos, buf, res);
+	kfree(buf);
+	return q;
+}
+
 DEBUGFS_READONLY_FILE_OPS(hwflags);
 DEBUGFS_READONLY_FILE_OPS(queues);
+DEBUGFS_READONLY_FILE_OPS(sta_hash);
 
 /* statistics stuff */
 
@@ -245,6 +281,7 @@ void debugfs_hw_add(struct ieee80211_local *local)
 	DEBUGFS_ADD(total_ps_buffered);
 	DEBUGFS_ADD(wep_iv);
 	DEBUGFS_ADD(queues);
+	DEBUGFS_ADD(sta_hash);
 #ifdef CONFIG_PM
 	DEBUGFS_ADD_MODE(reset, 0200);
 #endif
-- 
1.7.3.4


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

end of thread, other threads:[~2013-07-26 17:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-29 22:58 [WT PATCH 1/6] mac80211: Add debugfs file to show station-hash counts greearb
2013-06-29 22:58 ` [WT PATCH 2/6] mac80211: Make un-found-rate splat a warn-once greearb
2013-07-11  8:52   ` Johannes Berg
2013-06-29 22:58 ` [WT PATCH 3/6] wireless: Add memory usage debugging greearb
2013-07-11  8:53   ` Johannes Berg
2013-06-29 22:58 ` [WT PATCH 4/6] mac80211: Add per-sdata station hash, and sdata hash greearb
2013-07-11  8:55   ` Johannes Berg
2013-07-11 15:29     ` Ben Greear
2013-07-26  8:53       ` Johannes Berg
2013-07-26  9:56         ` Felix Fietkau
2013-07-26 15:22           ` Ben Greear
2013-07-26 15:38             ` Felix Fietkau
2013-07-26 16:09               ` Ben Greear
2013-07-26 17:59                 ` Felix Fietkau
2013-07-26 15:27         ` Ben Greear
2013-06-29 22:58 ` [WT PATCH 5/6] mac80211: Add debugfs for sdata and sdata->sta_vhash greearb
2013-06-29 22:58 ` [WT PATCH 6/6] mac80211: Tell user why beacons fail to parse greearb
2013-07-11  8:59   ` Johannes Berg
2013-07-11 15:10     ` Ben Greear
2013-07-11 15:17       ` Johannes Berg
2013-07-11  8:51 ` [WT PATCH 1/6] mac80211: Add debugfs file to show station-hash counts Johannes Berg

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.