[Make-wifi-fast] [PATCHv5 5/5] mac80211: add debug knobs for codel

Michal Kazior michal.kazior at tieto.com
Thu May 19 04:37:52 EDT 2016


This adds a few debugfs entries to make it easier
to test, debug and experiment.

Signed-off-by: Michal Kazior <michal.kazior at tieto.com>
---

Notes:
    v5:
     * use the single "aqm" debugfs knob [Dave]
    
    v4:
     * stats adjustments (in-kernel codel has more of them)

 net/mac80211/debugfs.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 2906c1004e1a..53a315401a4b 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -126,13 +126,31 @@ static int aqm_open(struct inode *inode, struct file *file)
 			 "R fq_overlimit %u\n"
 			 "R fq_collisions %u\n"
 			 "RW fq_limit %u\n"
-			 "RW fq_quantum %u\n",
+			 "RW fq_quantum %u\n"
+			 "R codel_maxpacket %u\n"
+			 "R codel_drop_count %u\n"
+			 "R codel_drop_len %u\n"
+			 "R codel_ecn_mark %u\n"
+			 "R codel_ce_mark %u\n"
+			 "RW codel_interval %u\n"
+			 "RW codel_target %u\n"
+			 "RW codel_mtu %u\n"
+			 "RW codel_ecn %u\n",
 			 fq->flows_cnt,
 			 fq->backlog,
 			 fq->overlimit,
 			 fq->collisions,
 			 fq->limit,
-			 fq->quantum);
+			 fq->quantum,
+			 local->cstats.maxpacket,
+			 local->cstats.drop_count,
+			 local->cstats.drop_len,
+			 local->cstats.ecn_mark,
+			 local->cstats.ce_mark,
+			 local->cparams.interval,
+			 local->cparams.target,
+			 local->cparams.mtu,
+			 local->cparams.ecn ? 1U : 0U);
 
 	len += scnprintf(info->buf + len,
 			 info->size - len,
@@ -214,6 +232,7 @@ static ssize_t aqm_write(struct file *file,
 	struct ieee80211_local *local = info->local;
 	char buf[100];
 	size_t len;
+	unsigned int ecn;
 
 	if (count > sizeof(buf))
 		return -EINVAL;
@@ -230,6 +249,16 @@ static ssize_t aqm_write(struct file *file,
 		return count;
 	else if (sscanf(buf, "fq_quantum %u", &local->fq.quantum) == 1)
 		return count;
+	else if (sscanf(buf, "codel_interval %u", &local->cparams.interval) == 1)
+		return count;
+	else if (sscanf(buf, "codel_target %u", &local->cparams.target) == 1)
+		return count;
+	else if (sscanf(buf, "codel_mtu %u", &local->cparams.mtu) == 1)
+		return count;
+	else if (sscanf(buf, "codel_ecn %u", &ecn) == 1) {
+		local->cparams.ecn = !!ecn;
+		return count;
+	}
 
 	return -EINVAL;
 }
-- 
2.1.4



More information about the Make-wifi-fast mailing list