diff mbox series

ath9k: add reset for airtime station debugfs

Message ID 20180906035323.GA11337@nems_nctu_lu (mailing list archive)
State Accepted
Commit 3fa8d2186550e5c8ad209087dc856a5f35fd4d26
Delegated to: Kalle Valo
Headers show
Series ath9k: add reset for airtime station debugfs | expand

Commit Message

Louie Lu Sept. 6, 2018, 3:53 a.m. UTC
Let user can reset station airtime status by debugfs, it will
reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
airtime accumulate to 0.

Signed-off-by: Louie Lu <git@louie.lu>
---
 drivers/net/wireless/ath/ath9k/debug_sta.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Toke Høiland-Jørgensen Sept. 6, 2018, 9:27 a.m. UTC | #1
Louie Lu <git@louie.lu> writes:

> Let user can reset station airtime status by debugfs, it will
> reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
> airtime accumulate to 0.

No objections to the patch, but I'm curious which issues you were
debugging that led you to needing it? :)

-Toke
Toke Høiland-Jørgensen Sept. 6, 2018, 10:40 a.m. UTC | #2
Louie Lu <git@louie.lu> writes:

> Toke Høiland-Jørgensen <toke@toke.dk> 於 2018年9月6日 週四 下午5:27寫道:
>
>> Louie Lu <git@louie.lu> writes:
>>
>> > Let user can reset station airtime status by debugfs, it will
>> > reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
>> > airtime accumulate to 0.
>>
>> No objections to the patch, but I'm curious which issues you were
>> debugging that led you to needing it? :)
>>
> I'm testing to get the packet queue time + airtime in
> ath_tx_process_buffer,

Right; I've been thinking that it would be useful to make the CoDel
enqueue time available to drivers. And minstrel, for that matter
(lowering the number of retries for packets that has queued for a long
time, for instance). Good to hear that others are looking into something
similar :)

> it would be useful if I can reset the station airtime accumulated
> value, so I can observe in each test round (e.g. 5 ping) airtime
> accumulated
>
> Also to reset the deficit to make sure it run like fresh one.

Yup, makes sense.

-Toke
Louie Lu Sept. 6, 2018, 10:41 a.m. UTC | #3
Previous mail rejects by mailing list, re-send again...


Toke Høiland-Jørgensen <toke@toke.dk> 於 2018年9月6日 週四 下午5:27寫道:
>
> Louie Lu <git@louie.lu> writes:
>
> > Let user can reset station airtime status by debugfs, it will
> > reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
> > airtime accumulate to 0.
>
> No objections to the patch, but I'm curious which issues you were
> debugging that led you to needing it? :)
>
I'm testing to get the packet queue time + airtime in ath_tx_process_buffer,
it would be useful if I can reset the station airtime accumulated
value, so I can observe in each test round (e.g. 5 ping) airtime
accumulated

Also to reset the deficit to make sure it runs like fresh one.

Louie.

>
> -Toke
Dave Taht Sept. 9, 2018, 11:44 p.m. UTC | #4
On Thu, Sep 6, 2018 at 4:13 AM Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>
> Louie Lu <git@louie.lu> writes:
>
> > Toke Høiland-Jørgensen <toke@toke.dk> 於 2018年9月6日 週四 下午5:27寫道:
> >
> >> Louie Lu <git@louie.lu> writes:
> >>
> >> > Let user can reset station airtime status by debugfs, it will
> >> > reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
> >> > airtime accumulate to 0.
> >>
> >> No objections to the patch, but I'm curious which issues you were
> >> debugging that led you to needing it? :)
> >>
> > I'm testing to get the packet queue time + airtime in
> > ath_tx_process_buffer,
>
> Right; I've been thinking that it would be useful to make the CoDel
> enqueue time available to drivers. And minstrel, for that matter
> (lowering the number of retries for packets that has queued for a long
> time, for instance). Good to hear that others are looking into something
> similar :)

Yea! Seeing retransmits scale down would be a goodness. Last I looked
ath9k was at, like 10?, when it should be, like, 2, at mcs0 and 10 at
mcs15.

I can't seem to publish a link to this directly, but it's open access
if you search via https://scholar.google.com/:

"Resolving Bufferbloat in TCP Communication over IEEE 802.11 n WLAN by
Reducing MAC Retransmission Limit at Low Data Rate"

even their simple bifurcated model worked well.




>
> > it would be useful if I can reset the station airtime accumulated
> > value, so I can observe in each test round (e.g. 5 ping) airtime
> > accumulated
> >
> > Also to reset the deficit to make sure it run like fresh one.
>
> Yup, makes sense.
>
> -Toke
Kalle Valo Oct. 1, 2018, 2:06 p.m. UTC | #5
Louie Lu <git@louie.lu> wrote:

> Let user can reset station airtime status by debugfs, it will
> reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
> airtime accumulate to 0.
> 
> Signed-off-by: Louie Lu <git@louie.lu>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

3fa8d2186550 ath9k: add reset for airtime station debugfs
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath9k/debug_sta.c b/drivers/net/wireless/ath/ath9k/debug_sta.c
index ed8b77a74630..e8fcd3e1c470 100644
--- a/drivers/net/wireless/ath/ath9k/debug_sta.c
+++ b/drivers/net/wireless/ath/ath9k/debug_sta.c
@@ -286,9 +286,25 @@  static ssize_t read_airtime(struct file *file, char __user *user_buf,
 	return retval;
 }
 
+static ssize_t
+write_airtime_reset_stub(struct file *file, const char __user *ubuf,
+		   size_t count, loff_t *ppos)
+{
+	struct ath_node *an = file->private_data;
+	struct ath_airtime_stats *astats;
+	int i;
+
+	astats = &an->airtime_stats;
+	astats->rx_airtime = 0;
+	astats->tx_airtime = 0;
+	for (i = 0; i < 4; i++)
+		an->airtime_deficit[i] = ATH_AIRTIME_QUANTUM;
+	return count;
+}
 
 static const struct file_operations fops_airtime = {
 	.read = read_airtime,
+	.write = write_airtime_reset_stub,
 	.open = simple_open,
 	.owner = THIS_MODULE,
 	.llseek = default_llseek,
@@ -304,5 +320,5 @@  void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
 
 	debugfs_create_file("node_aggr", 0444, dir, an, &fops_node_aggr);
 	debugfs_create_file("node_recv", 0444, dir, an, &fops_node_recv);
-	debugfs_create_file("airtime", 0444, dir, an, &fops_airtime);
+	debugfs_create_file("airtime", 0644, dir, an, &fops_airtime);
 }