1 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
2 Date: Mon, 5 Dec 2016 13:27:37 +0200
3 Subject: [PATCH] ath9k: Introduce airtime fairness scheduling between stations
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
8 This reworks the ath9k driver to schedule transmissions to connected
9 stations in a way that enforces airtime fairness between them. It
10 accomplishes this by measuring the time spent transmitting to or
11 receiving from a station at TX and RX completion, and accounting this to
12 a per-station, per-QoS level airtime deficit. Then, an FQ-CoDel based
13 deficit scheduler is employed at packet dequeue time, to control which
14 station gets the next transmission opportunity.
16 Airtime fairness can significantly improve the efficiency of the network
17 when station rates vary. The following throughput values are from a
18 simple three-station test scenario, where two stations operate at the
19 highest HT20 rate, and one station at the lowest, and the scheduler is
20 employed at the access point:
23 Fast station 1: 19.17 / 25.09 Mbps
24 Fast station 2: 19.83 / 25.21 Mbps
25 Slow station: 2.58 / 1.77 Mbps
26 Total: 41.58 / 52.07 Mbps
28 The benefit of airtime fairness goes up the more stations are present.
29 In a 30-station test with one station artificially limited to 1 Mbps,
30 we have seen aggregate throughput go from 2.14 to 17.76 Mbps.
32 Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
33 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
36 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
37 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
38 @@ -112,6 +112,8 @@ int ath_descdma_setup(struct ath_softc *
39 #define ATH_TXFIFO_DEPTH 8
40 #define ATH_TX_ERROR 0x01
42 +#define ATH_AIRTIME_QUANTUM 300 /* usec */
44 /* Stop tx traffic 1ms before the GO goes away */
45 #define ATH_P2P_PS_STOP_TIME 1000
47 @@ -247,6 +249,9 @@ struct ath_atx_tid {
51 +void __ath_tx_queue_tid(struct ath_softc *sc, struct ath_atx_tid *tid);
52 +void ath_tx_queue_tid(struct ath_softc *sc, struct ath_atx_tid *tid);
56 struct ieee80211_sta *sta; /* station struct we're part of */
57 @@ -258,9 +263,12 @@ struct ath_node {
61 + s64 airtime_deficit[IEEE80211_NUM_ACS];
62 + u32 airtime_rx_start;
64 #ifdef CPTCFG_ATH9K_STATION_STATISTICS
65 struct ath_rx_rate_stats rx_rate_stats;
66 + struct ath_airtime_stats airtime_stats;
70 @@ -317,10 +325,16 @@ struct ath_rx {
75 + struct list_head acq_new;
76 + struct list_head acq_old;
81 struct cfg80211_chan_def chandef;
82 struct list_head vifs;
83 - struct list_head acq[IEEE80211_NUM_ACS];
84 + struct ath_acq acq[IEEE80211_NUM_ACS];
87 /* do not dereference, use for comparison only */
88 @@ -575,6 +589,8 @@ void ath_txq_schedule_all(struct ath_sof
89 int ath_tx_init(struct ath_softc *sc, int nbufs);
90 int ath_txq_update(struct ath_softc *sc, int qnum,
91 struct ath9k_tx_queue_info *q);
92 +u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen,
93 + int width, int half_gi, bool shortPreamble);
94 void ath_update_max_aggr_framelen(struct ath_softc *sc, int queue, int txop);
95 void ath_assign_seq(struct ath_common *common, struct sk_buff *skb);
96 int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
97 @@ -963,6 +979,11 @@ void ath_ant_comb_scan(struct ath_softc
99 #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */
101 +#define AIRTIME_USE_TX BIT(0)
102 +#define AIRTIME_USE_RX BIT(1)
103 +#define AIRTIME_USE_NEW_QUEUES BIT(2)
104 +#define AIRTIME_ACTIVE(flags) (!!(flags & (AIRTIME_USE_TX|AIRTIME_USE_RX)))
107 struct ieee80211_hw *hw;
109 @@ -1005,6 +1026,8 @@ struct ath_softc {
111 unsigned long ps_usecount;
113 + u16 airtime_flags; /* AIRTIME_* */
117 struct ath_beacon beacon;
118 --- a/drivers/net/wireless/ath/ath9k/channel.c
119 +++ b/drivers/net/wireless/ath/ath9k/channel.c
120 @@ -118,8 +118,11 @@ void ath_chanctx_init(struct ath_softc *
121 INIT_LIST_HEAD(&ctx->vifs);
122 ctx->txpower = ATH_TXPOWER_MAX;
123 ctx->flush_timeout = HZ / 5; /* 200ms */
124 - for (j = 0; j < ARRAY_SIZE(ctx->acq); j++)
125 - INIT_LIST_HEAD(&ctx->acq[j]);
126 + for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) {
127 + INIT_LIST_HEAD(&ctx->acq[j].acq_new);
128 + INIT_LIST_HEAD(&ctx->acq[j].acq_old);
129 + spin_lock_init(&ctx->acq[j].lock);
134 @@ -1345,8 +1348,11 @@ void ath9k_offchannel_init(struct ath_so
135 ctx->txpower = ATH_TXPOWER_MAX;
136 cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20);
138 - for (i = 0; i < ARRAY_SIZE(ctx->acq); i++)
139 - INIT_LIST_HEAD(&ctx->acq[i]);
140 + for (i = 0; i < ARRAY_SIZE(ctx->acq); i++) {
141 + INIT_LIST_HEAD(&ctx->acq[i].acq_new);
142 + INIT_LIST_HEAD(&ctx->acq[i].acq_old);
143 + spin_lock_init(&ctx->acq[i].lock);
146 sc->offchannel.chan.offchannel = true;
148 --- a/drivers/net/wireless/ath/ath9k/debug.c
149 +++ b/drivers/net/wireless/ath/ath9k/debug.c
150 @@ -1399,5 +1399,8 @@ int ath9k_init_debug(struct ath_hw *ah)
151 debugfs_create_file("tpc", S_IRUSR | S_IWUSR,
152 sc->debug.debugfs_phy, sc, &fops_tpc);
154 + debugfs_create_u16("airtime_flags", S_IRUSR | S_IWUSR,
155 + sc->debug.debugfs_phy, &sc->airtime_flags);
159 --- a/drivers/net/wireless/ath/ath9k/debug.h
160 +++ b/drivers/net/wireless/ath/ath9k/debug.h
161 @@ -221,6 +221,11 @@ struct ath_rx_rate_stats {
165 +struct ath_airtime_stats {
173 @@ -314,12 +319,20 @@ ath9k_debug_sync_cause(struct ath_softc
174 void ath_debug_rate_stats(struct ath_softc *sc,
175 struct ath_rx_status *rs,
176 struct sk_buff *skb);
177 +void ath_debug_airtime(struct ath_softc *sc,
178 + struct ath_node *an,
181 static inline void ath_debug_rate_stats(struct ath_softc *sc,
182 struct ath_rx_status *rs,
186 +static inline void ath_debug_airtime(struct ath_softc *sc,
187 + struct ath_node *an,
191 #endif /* CPTCFG_ATH9K_STATION_STATISTICS */
194 --- a/drivers/net/wireless/ath/ath9k/debug_sta.c
195 +++ b/drivers/net/wireless/ath/ath9k/debug_sta.c
196 @@ -242,6 +242,59 @@ static const struct file_operations fops
197 .llseek = default_llseek,
200 +void ath_debug_airtime(struct ath_softc *sc,
201 + struct ath_node *an,
205 + struct ath_airtime_stats *astats = &an->airtime_stats;
207 + astats->rx_airtime += rx;
208 + astats->tx_airtime += tx;
211 +static ssize_t read_airtime(struct file *file, char __user *user_buf,
212 + size_t count, loff_t *ppos)
214 + struct ath_node *an = file->private_data;
215 + struct ath_airtime_stats *astats;
216 + static const char *qname[4] = {
217 + "VO", "VI", "BE", "BK"
219 + u32 len = 0, size = 256;
224 + buf = kzalloc(size, GFP_KERNEL);
228 + astats = &an->airtime_stats;
230 + len += scnprintf(buf + len, size - len, "RX: %u us\n", astats->rx_airtime);
231 + len += scnprintf(buf + len, size - len, "TX: %u us\n", astats->tx_airtime);
232 + len += scnprintf(buf + len, size - len, "Deficit: ");
233 + for (i = 0; i < 4; i++)
234 + len += scnprintf(buf+len, size - len, "%s: %lld us ", qname[i], an->airtime_deficit[i]);
238 + retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
245 +static const struct file_operations fops_airtime = {
246 + .read = read_airtime,
247 + .open = simple_open,
248 + .owner = THIS_MODULE,
249 + .llseek = default_llseek,
253 void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
254 struct ieee80211_vif *vif,
255 struct ieee80211_sta *sta,
256 @@ -251,4 +304,5 @@ void ath9k_sta_add_debugfs(struct ieee80
258 debugfs_create_file("node_aggr", S_IRUGO, dir, an, &fops_node_aggr);
259 debugfs_create_file("node_recv", S_IRUGO, dir, an, &fops_node_recv);
260 + debugfs_create_file("airtime", S_IRUGO, dir, an, &fops_airtime);
262 --- a/drivers/net/wireless/ath/ath9k/init.c
263 +++ b/drivers/net/wireless/ath/ath9k/init.c
264 @@ -620,6 +620,8 @@ static int ath9k_init_softc(u16 devid, s
266 /* Will be cleared in ath9k_start() */
267 set_bit(ATH_OP_INVALID, &common->op_flags);
268 + sc->airtime_flags = (AIRTIME_USE_TX | AIRTIME_USE_RX |
269 + AIRTIME_USE_NEW_QUEUES);
272 sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
273 --- a/drivers/net/wireless/ath/ath9k/main.c
274 +++ b/drivers/net/wireless/ath/ath9k/main.c
275 @@ -70,10 +70,10 @@ static bool ath9k_has_pending_frames(str
278 if (txq->mac80211_qnum >= 0) {
279 - struct list_head *list;
280 + struct ath_acq *acq;
282 - list = &sc->cur_chan->acq[txq->mac80211_qnum];
283 - if (!list_empty(list))
284 + acq = &sc->cur_chan->acq[txq->mac80211_qnum];
285 + if (!list_empty(&acq->acq_new) || !list_empty(&acq->acq_old))
289 --- a/drivers/net/wireless/ath/ath9k/recv.c
290 +++ b/drivers/net/wireless/ath/ath9k/recv.c
291 @@ -991,6 +991,70 @@ static void ath9k_apply_ampdu_details(st
295 +static void ath_rx_count_airtime(struct ath_softc *sc,
296 + struct ath_rx_status *rs,
297 + struct sk_buff *skb)
299 + struct ath_node *an;
300 + struct ath_acq *acq;
301 + struct ath_vif *avp;
302 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
303 + struct ath_hw *ah = sc->sc_ah;
304 + struct ath_common *common = ath9k_hw_common(ah);
305 + struct ieee80211_sta *sta;
306 + struct ieee80211_rx_status *rxs;
307 + const struct ieee80211_rate *rate;
308 + bool is_sgi, is_40, is_sp;
310 + u16 len = rs->rs_datalen;
314 + if (!ieee80211_is_data(hdr->frame_control))
319 + sta = ieee80211_find_sta_by_ifaddr(sc->hw, hdr->addr2, NULL);
322 + an = (struct ath_node *) sta->drv_priv;
323 + avp = (struct ath_vif *) an->vif->drv_priv;
324 + tidno = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
325 + acno = TID_TO_WME_AC(tidno);
326 + acq = &avp->chanctx->acq[acno];
328 + rxs = IEEE80211_SKB_RXCB(skb);
330 + is_sgi = !!(rxs->flag & RX_FLAG_SHORT_GI);
331 + is_40 = !!(rxs->flag & RX_FLAG_40MHZ);
332 + is_sp = !!(rxs->flag & RX_FLAG_SHORTPRE);
334 + if (!!(rxs->flag & RX_FLAG_HT)) {
337 + airtime += ath_pkt_duration(sc, rxs->rate_idx, len,
338 + is_40, is_sgi, is_sp);
341 + phy = IS_CCK_RATE(rs->rs_rate) ? WLAN_RC_PHY_CCK : WLAN_RC_PHY_OFDM;
342 + rate = &common->sbands[rxs->band].bitrates[rxs->rate_idx];
343 + airtime += ath9k_hw_computetxtime(ah, phy, rate->bitrate * 100,
344 + len, rxs->rate_idx, is_sp);
347 + if (!!(sc->airtime_flags & AIRTIME_USE_RX)) {
348 + spin_lock_bh(&acq->lock);
349 + an->airtime_deficit[acno] -= airtime;
350 + if (an->airtime_deficit[acno] <= 0)
351 + __ath_tx_queue_tid(sc, ATH_AN_2_TID(an, tidno));
352 + spin_unlock_bh(&acq->lock);
354 + ath_debug_airtime(sc, an, airtime, 0);
359 int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
361 struct ath_rxbuf *bf;
362 @@ -1137,6 +1201,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
363 ath9k_antenna_check(sc, &rs);
364 ath9k_apply_ampdu_details(sc, &rs, rxs);
365 ath_debug_rate_stats(sc, &rs, skb);
366 + ath_rx_count_airtime(sc, &rs, skb);
368 hdr = (struct ieee80211_hdr *)skb->data;
369 if (ieee80211_is_ack(hdr->frame_control))
370 --- a/drivers/net/wireless/ath/ath9k/xmit.c
371 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
372 @@ -125,21 +125,44 @@ void ath_txq_unlock_complete(struct ath_
373 ath_tx_status(hw, skb);
376 -static void ath_tx_queue_tid(struct ath_softc *sc, struct ath_txq *txq,
377 - struct ath_atx_tid *tid)
378 +void __ath_tx_queue_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
380 - struct list_head *list;
381 struct ath_vif *avp = (struct ath_vif *) tid->an->vif->drv_priv;
382 struct ath_chanctx *ctx = avp->chanctx;
383 + struct ath_acq *acq;
384 + struct list_head *tid_list;
385 + u8 acno = TID_TO_WME_AC(tid->tidno);
388 + if (!ctx || !list_empty(&tid->list))
391 - list = &ctx->acq[TID_TO_WME_AC(tid->tidno)];
392 - if (list_empty(&tid->list))
393 - list_add_tail(&tid->list, list);
395 + acq = &ctx->acq[acno];
396 + if ((sc->airtime_flags & AIRTIME_USE_NEW_QUEUES) &&
397 + tid->an->airtime_deficit[acno] > 0)
398 + tid_list = &acq->acq_new;
400 + tid_list = &acq->acq_old;
402 + list_add_tail(&tid->list, tid_list);
405 +void ath_tx_queue_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
407 + struct ath_vif *avp = (struct ath_vif *) tid->an->vif->drv_priv;
408 + struct ath_chanctx *ctx = avp->chanctx;
409 + struct ath_acq *acq;
411 + if (!ctx || !list_empty(&tid->list))
414 + acq = &ctx->acq[TID_TO_WME_AC(tid->tidno)];
415 + spin_lock_bh(&acq->lock);
416 + __ath_tx_queue_tid(sc, tid);
417 + spin_unlock_bh(&acq->lock);
421 void ath9k_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *queue)
423 struct ath_softc *sc = hw->priv;
424 @@ -154,7 +177,7 @@ void ath9k_wake_tx_queue(struct ieee8021
425 ath_txq_lock(sc, txq);
427 tid->has_queued = true;
428 - ath_tx_queue_tid(sc, txq, tid);
429 + ath_tx_queue_tid(sc, tid);
430 ath_txq_schedule(sc, txq);
432 ath_txq_unlock(sc, txq);
433 @@ -684,7 +707,7 @@ static void ath_tx_complete_aggr(struct
435 skb_queue_splice_tail(&bf_pending, &tid->retry_q);
437 - ath_tx_queue_tid(sc, txq, tid);
438 + ath_tx_queue_tid(sc, tid);
440 if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY))
441 tid->clear_ps_filter = true;
442 @@ -712,6 +735,53 @@ static bool bf_is_ampdu_not_probing(stru
443 return bf_isampdu(bf) && !(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE);
446 +static void ath_tx_count_airtime(struct ath_softc *sc, struct ath_txq *txq,
447 + struct ath_buf *bf, struct ath_tx_status *ts)
449 + struct ath_node *an;
450 + struct ath_acq *acq = &sc->cur_chan->acq[txq->mac80211_qnum];
451 + struct sk_buff *skb;
452 + struct ieee80211_hdr *hdr;
453 + struct ieee80211_hw *hw = sc->hw;
454 + struct ieee80211_tx_rate rates[4];
455 + struct ieee80211_sta *sta;
463 + hdr = (struct ieee80211_hdr *)skb->data;
464 + memcpy(rates, bf->rates, sizeof(rates));
468 + sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
473 + an = (struct ath_node *) sta->drv_priv;
475 + airtime += ts->duration * (ts->ts_longretry + 1);
477 + for(i=0; i < ts->ts_rateindex; i++)
478 + airtime += ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, i) * rates[i].count;
480 + if (!!(sc->airtime_flags & AIRTIME_USE_TX)) {
481 + spin_lock_bh(&acq->lock);
482 + an->airtime_deficit[txq->mac80211_qnum] -= airtime;
483 + if (an->airtime_deficit[txq->mac80211_qnum] <= 0)
484 + __ath_tx_queue_tid(sc, ath_get_skb_tid(sc, an, skb));
485 + spin_unlock_bh(&acq->lock);
487 + ath_debug_airtime(sc, an, 0, airtime);
493 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
494 struct ath_tx_status *ts, struct ath_buf *bf,
495 struct list_head *bf_head)
496 @@ -733,6 +803,7 @@ static void ath_tx_process_buffer(struct
498 ts->duration = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc,
500 + ath_tx_count_airtime(sc, txq, bf, ts);
502 hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
503 sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
504 @@ -1094,8 +1165,8 @@ finish:
505 * width - 0 for 20 MHz, 1 for 40 MHz
506 * half_gi - to use 4us v/s 3.6 us for symbol time
508 -static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen,
509 - int width, int half_gi, bool shortPreamble)
510 +u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen,
511 + int width, int half_gi, bool shortPreamble)
513 u32 nbits, nsymbits, duration, nsymbols;
515 @@ -1493,7 +1564,7 @@ ath_tx_form_burst(struct ath_softc *sc,
518 static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq,
519 - struct ath_atx_tid *tid, bool *stop)
520 + struct ath_atx_tid *tid)
523 struct ieee80211_tx_info *tx_info;
524 @@ -1515,7 +1586,6 @@ static bool ath_tx_sched_aggr(struct ath
525 if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) ||
526 (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) {
527 __skb_queue_tail(&tid->retry_q, bf->bf_mpdu);
532 @@ -1639,7 +1709,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
533 ath_txq_lock(sc, txq);
534 tid->clear_ps_filter = true;
535 if (ath_tid_has_buffered(tid)) {
536 - ath_tx_queue_tid(sc, txq, tid);
537 + ath_tx_queue_tid(sc, tid);
538 ath_txq_schedule(sc, txq);
540 ath_txq_unlock_complete(sc, txq);
541 @@ -1956,9 +2026,10 @@ void ath_tx_cleanupq(struct ath_softc *s
542 void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
544 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
545 - struct ath_atx_tid *tid, *last_tid;
546 + struct ath_atx_tid *tid;
547 struct list_head *tid_list;
549 + struct ath_acq *acq;
550 + bool active = AIRTIME_ACTIVE(sc->airtime_flags);
552 if (txq->mac80211_qnum < 0)
554 @@ -1967,48 +2038,55 @@ void ath_txq_schedule(struct ath_softc *
557 spin_lock_bh(&sc->chan_lock);
558 - tid_list = &sc->cur_chan->acq[txq->mac80211_qnum];
560 - if (list_empty(tid_list)) {
561 - spin_unlock_bh(&sc->chan_lock);
566 + acq = &sc->cur_chan->acq[txq->mac80211_qnum];
568 - last_tid = list_entry(tid_list->prev, struct ath_atx_tid, list);
569 - while (!list_empty(tid_list)) {
572 - if (sc->cur_chan->stopped)
575 - tid = list_first_entry(tid_list, struct ath_atx_tid, list);
576 - list_del_init(&tid->list);
577 + if (sc->cur_chan->stopped)
580 - if (ath_tx_sched_aggr(sc, txq, tid, &stop))
583 + tid_list = &acq->acq_new;
584 + if (list_empty(tid_list)) {
585 + tid_list = &acq->acq_old;
586 + if (list_empty(tid_list))
589 + tid = list_first_entry(tid_list, struct ath_atx_tid, list);
592 - * add tid to round-robin queue if more frames
593 - * are pending for the tid
595 - if (ath_tid_has_buffered(tid))
596 - ath_tx_queue_tid(sc, txq, tid);
597 + if (active && tid->an->airtime_deficit[txq->mac80211_qnum] <= 0) {
598 + spin_lock_bh(&acq->lock);
599 + tid->an->airtime_deficit[txq->mac80211_qnum] += ATH_AIRTIME_QUANTUM;
600 + list_move_tail(&tid->list, &acq->acq_old);
601 + spin_unlock_bh(&acq->lock);
607 + if (!ath_tid_has_buffered(tid)) {
608 + spin_lock_bh(&acq->lock);
609 + if ((tid_list == &acq->acq_new) && !list_empty(&acq->acq_old))
610 + list_move_tail(&tid->list, &acq->acq_old);
612 + list_del_init(&tid->list);
614 + spin_unlock_bh(&acq->lock);
618 - if (tid == last_tid) {
623 - last_tid = list_entry(tid_list->prev,
624 - struct ath_atx_tid, list);
626 + * If we succeed in scheduling something, immediately restart to make
627 + * sure we keep the HW busy.
629 + if(ath_tx_sched_aggr(sc, txq, tid)) {
631 + spin_lock_bh(&acq->lock);
632 + list_move_tail(&tid->list, &acq->acq_old);
633 + spin_unlock_bh(&acq->lock);
640 spin_unlock_bh(&sc->chan_lock);
642 @@ -2862,6 +2940,9 @@ void ath_tx_node_init(struct ath_softc *
643 struct ath_atx_tid *tid;
646 + for (acno = 0; acno < IEEE80211_NUM_ACS; acno++)
647 + an->airtime_deficit[acno] = ATH_AIRTIME_QUANTUM;
649 for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
650 tid = ath_node_to_tid(an, tidno);