<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Aha! Turns out I was doing the sta lookup completely wrong in<br>ieee80211_report_used_skb(); so anything frames that were dropped and<br>went through there would not get its airtime subtracted correctly. Will<br>send a v6 with a fix :)</blockquote><div>Awesome, thanks! That looks very promising. The symptom I see with previous patch is the interface's pending airtime count looks fine, but the station's airtime get wrong, either due to airtime is credited to the wrong station or wrong AC.</div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 23, 2019 at 2:52 AM Toke Høiland-Jørgensen <<a href="mailto:toke@redhat.com">toke@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Toke Høiland-Jørgensen <<a href="mailto:toke@redhat.com" target="_blank">toke@redhat.com</a>> writes:<br>
<br>
> Kan Yan <<a href="mailto:kyan@google.com" target="_blank">kyan@google.com</a>> writes:<br>
><br>
>>> >> + if (ieee80211_is_data_qos(hdr->frame_control)) {<br>
>>> >> + qc = ieee80211_get_qos_ctl(hdr);<br>
>>> >> + tid = qc[0] & 0xf;<br>
>>> >> + ac = ieee80211_ac_from_tid(tid);<br>
>>> >> + } else {<br>
>>> >> + ac = IEEE80211_AC_BE;<br>
>>> >> + }<br>
>>> ><br>
>>> > The tid/ac is incorrect either here or in __ieee80211_tx_status() when<br>
>>> > tested with ath10k. The ac is set to AC_BE with test done using BK<br>
>>> > class traffic, hence the pending airtime get updated for the wrong<br>
>>> > txq.<br>
>>><br>
>>> Huh, well that won't do, obviously :)<br>
>>><br>
>>> Any idea why it might be wrong?<br>
>><br>
>> somehow ieee80211_is_data_qos() returns false. Besides, qos_control<br>
>> field doesn't seems to be set in ieee80211_build_hdr().<br>
>><br>
>>> Hmm, I guess we could just get the ac using skb_get_queue_mapping().<br>
>>> I'll send an update with this fixed for you to try :)<br>
>> Thanks for the quick update. It is getting much better, but<br>
>> unfortunately the pending airtime accounting sometimes is still not<br>
>> correct and cause txq stuck occasionally.<br>
><br>
> OK, so that has to mean that there are packets getting dropped somewhere<br>
> without going through ieee80211_report_used_skb(). Assuming you're not<br>
> hitting the underflow warnings, just seeing the counter not get back<br>
> down to zero?<br>
><br>
> Could you see if you can find out if ath10k does that anywhere? I'll go<br>
> hunting in mac80211.<br>
><br>
> Looking for calls to kfree_skb() or kfree_skb_list() should hopefully<br>
> turn up something...<br>
<br>
Aha! Turns out I was doing the sta lookup completely wrong in<br>
ieee80211_report_used_skb(); so anything frames that were dropped and<br>
went through there would not get its airtime subtracted correctly. Will<br>
send a v6 with a fix :)<br>
<br>
-Toke<br>
<br>
</blockquote></div>