[PATCH v3 0/2] Implement Airtime-based Queue Limit (AQL)

2019-10-09 Thread Kan Yan
in a congested environment without negative impact on the throughput. [0] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1703105/7 Kan Yan (2): mac80211: Implement Airtime-based Queue Limit (AQL) ath10k: Enable Airtime-based Queue Limit (AQL) drivers/net

[PATCH v3 1/2] mac80211: Implement Airtime-based Queue Limit (AQL)

2019-10-09 Thread Kan Yan
er to form 1-2 large aggregations to keep hardware fully utilized and keep the rest of frames in mac80211 layer to be controlled by the CoDel algorithm. Signed-off-by: Kan Yan --- include/net/cfg80211.h | 7 include/net/mac80211.h | 43 + net/mac80211/debugfs.c

[PATCH v3 2/2] ath10k: Enable Airtime-based Queue Limit (AQL)

2019-10-09 Thread Kan Yan
Calculate the estimated airtime pending in the txqs and apply AQL to prevent excessive amounts of packets being queued in the firmware queue. Signed-off-by: Kan Yan --- drivers/net/wireless/ath/ath10k/htt_rx.c | 1 + drivers/net/wireless/ath/ath10k/mac.c| 8 +--- drivers/net/wireless

[PATCH v4 0/2] Implement Airtime-based Queue Limit (AQL)

2019-10-10 Thread Kan Yan
in a congested environment without negative impact on the throughput. [0] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1703105/7 Kan Yan (2): mac80211: Implement Airtime-based Queue Limit (AQL) ath10k: Enable Airtime-based Queue Limit (AQL) drivers/net

Re: [PATCH v3 1/2] mac80211: Implement Airtime-based Queue Limit (AQL)

2019-10-10 Thread Kan Yan
> > +/* The per TXQ firmware queue limit in airtime */ > > I was pretty sure I mentioned it *somewhere*, but I think just calling > this "device" or something would be more general. If you don't mind, I > can edit that also (unless you have other reasons to resubmit?) done. I will upload a new ver

[PATCH v4 2/2] ath10k: Enable Airtime-based Queue Limit (AQL)

2019-10-10 Thread Kan Yan
Calculate the estimated airtime pending in the txqs and apply AQL to prevent excessive amounts of packets being queued in the firmware queue. Signed-off-by: Kan Yan --- drivers/net/wireless/ath/ath10k/htt_rx.c | 1 + drivers/net/wireless/ath/ath10k/mac.c| 6 -- drivers/net/wireless

[PATCH v4 1/2] mac80211: Implement Airtime-based Queue Limit (AQL)

2019-10-10 Thread Kan Yan
er to form 1-2 large aggregations to keep hardware fully utilized and keep the rest of frames in mac80211 layer to be controlled by the CoDel algorithm. Signed-off-by: Kan Yan --- include/net/cfg80211.h | 7 include/net/mac80211.h | 47 +++ net/mac80211/debu

Re: [PATCH v4 0/2] Implement Airtime-based Queue Limit (AQL)

2019-10-14 Thread Kan Yan
2:18 AM Kalle Valo wrote: > > Kalle Valo writes: > > > Kan Yan writes: > > > >> This patch series implements Airtime-based Queue Limit (AQL) in the > >> mac80211 and Ath10k driver. It is based on an earlier version from > >> the ChromiumOS tree

Re: [PATCH v2 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-10-16 Thread Kan Yan
Hi Toke, Thanks for getting this done! I will give it a try in the next few days. A few comments: > The estimated airtime for each skb is stored in the tx_info, so we can > subtract the same amount from the running total when the skb is freed or > recycled. Looks like ath10k driver zero out the

Re: [PATCH v2 1/4] mac80211: Rearrange ieee80211_tx_info to make room for tx_time_est

2019-10-17 Thread Kan Yan
The "tx_time_est" field, shared by control and status, is not able to survive until the skb returns to the mac80211 layer in some architectures. The same space is defined as driver_data and some wireless drivers use it for other purposes, as the cb in the sk_buff is free to be used by any layer. I

Re: [Make-wifi-fast] [PATCH v2 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-10-17 Thread Kan Yan
> > > Sebastian Moeller writes: > > > >>> On Oct 17, 2019, at 11:44, Toke Høiland-Jørgensen wrote: > >>> > >>> Kan Yan writes: > >>> > >>>> Hi Toke, > >>>> > >>>> Thanks for getting this

Re: [PATCH v3 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-10-18 Thread Kan Yan
> + if (local->airtime_flags & AIRTIME_USE_AQL) { > + airtime = ieee80211_calc_expected_tx_airtime(hw, vif, > txq->sta, > +skb->len); > + if (airtime) { > + /* We only have 10 bits i

Re: [PATCH v4 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-10-21 Thread Kan Yan
> + if (ieee80211_is_data_qos(hdr->frame_control)) { > + qc = ieee80211_get_qos_ctl(hdr); > + tid = qc[0] & 0xf; > + ac = ieee80211_ac_from_tid(tid); > + } else { > + ac = IEEE80211_A

Re: [PATCH v4 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-10-22 Thread Kan Yan
r(). > Hmm, I guess we could just get the ac using skb_get_queue_mapping(). > I'll send an update with this fixed for you to try :) Thanks for the quick update. It is getting much better, but unfortunately the pending airtime accounting sometimes is still not correct and cause txq s

Re: [PATCH v4 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-10-23 Thread Kan Yan
he 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. On Wed, Oct 23, 2019 at 2:52 AM Toke Høiland-Jørgensen wrote: > > Toke Høiland-Jørg

Re: [PATCH v6 0/4] Add Airtime Queue Limits (AQL) to mac80211

2019-11-06 Thread Kan Yan
rame_id, and use units > of 4us for the value stored in it. > - Move the addition of the Ethernet header size into > ieee80211_calc_expected_tx_airtime() > v2: > - Integrate Kan's approach to airtime throttling. > - Hopefully fix the cb struct alignment on big-endian architectu

Re: [PATCH v6 3/4] mac80211: Implement Airtime-based Queue Limit (AQL)

2019-11-08 Thread Kan Yan
It is most likely just insufficient locking. active_txq_lock is per AC, can't protect local->aql_total_pending_airtime against racing conditions: void ieee80211_sta_update_pending_airtime(...) { spin_lock_bh(&local->active_txq_lock[ac]); ... local->aql_total_pending_airtime

Re: [PATCH v9 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-11-15 Thread Kan Yan
> +static inline u16 > +ieee80211_info_set_tx_time_est(struct ieee80211_tx_info *info, u16 > tx_time_est) > +{ > + /* We only have 10 bits in tx_time_est, so store airtime > +* in increments of 4us and clamp the maximum to 2**12-1 > +*/ > + info->tx_time_est = min_t(u16

Re: [PATCH v9 4/4] mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

2019-11-17 Thread Kan Yan
the limits > are sufficiently conservative that it would not result in any problems :) Sounds good. The current default limits are reasonably conservative and are tunable via debugfs. I will give the v10 version of this patch serial a quick test and hopefully we can wrap it up soon. -Kan On

Re: [PATCH v10 2/4] mac80211: Import airtime calculation code from mt76

2019-11-18 Thread Kan Yan
> + duration = airtime_mcs_groups[group].duration[idx]; > + duration <<= airtime_mcs_groups[group].shift; > + duration *= len; > + duration /= AVG_PKT_SIZE; > + duration /= 1024; > > + duration += 36 + (streams << 2); > + > + return duration; > +} > +EXPORT

Re: [PATCH v9 3/4] mac80211: Implement Airtime-based Queue Limit (AQL)

2019-11-18 Thread Kan Yan
a->airtime[txqi->txq.ac].deficit += > sta->airtime_weight; > + > + if (deficit < 0 || !aql_check) { > list_move_tail(&txqi->schedule_order, >&loca

Re: [PATCH] ath10k: Add wrapper function to ath10k debug

2018-10-15 Thread Kan Yan
> Johannes had an interesting idea to use trace_ath10k_log_dbg_enabled(). > Could you investigate if that would work? That way we might get the > performance improvement even when is enabled CONFIG_ATH10K_TRACING (but > actual trace point is disabled, of course). That's a good idea. This patch was

Re: [PATCH v6 4/4] ath10k: reporting estimated tx airtime for fairness

2019-01-24 Thread Kan Yan
Hi Toke, This patch looks good to me. Great job on getting the airtime fairness scheduling framework done! On Tue, Jan 22, 2019 at 6:21 AM Toke Høiland-Jørgensen wrote: > > From: Kan Yan > > Transmit airtime will be estimated from last tx rate used. > Firmware report tx rat