1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 25 Jun 2022 21:25:40 +0200
3 Subject: [PATCH] mac80211: add debugfs file to display per-phy AQL pending
6 Now that the global pending airtime is more relevant for airtime fairness,
7 it makes sense to make it accessible via debugfs for debugging
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 --- a/net/mac80211/debugfs.c
13 +++ b/net/mac80211/debugfs.c
14 @@ -201,6 +201,36 @@ static const struct file_operations airt
15 .llseek = default_llseek,
18 +static ssize_t aql_pending_read(struct file *file,
19 + char __user *user_buf,
20 + size_t count, loff_t *ppos)
22 + struct ieee80211_local *local = file->private_data;
26 + len = scnprintf(buf, sizeof(buf),
33 + atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_VO]),
34 + atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_VI]),
35 + atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_BE]),
36 + atomic_read(&local->aql_ac_pending_airtime[IEEE80211_AC_BK]),
37 + atomic_read(&local->aql_total_pending_airtime));
38 + return simple_read_from_buffer(user_buf, count, ppos,
42 +static const struct file_operations aql_pending_ops = {
43 + .read = aql_pending_read,
44 + .open = simple_open,
45 + .llseek = default_llseek,
48 static ssize_t aql_txq_limit_read(struct file *file,
49 char __user *user_buf,
51 @@ -628,6 +658,7 @@ void debugfs_hw_add(struct ieee80211_loc
53 DEBUGFS_ADD_MODE(force_tx_status, 0600);
54 DEBUGFS_ADD_MODE(aql_enable, 0600);
55 + DEBUGFS_ADD(aql_pending);
57 if (local->ops->wake_tx_queue)
58 DEBUGFS_ADD_MODE(aqm, 0600);