[Make-wifi-fast] [PATCH RFC v5 3/4] mac80211: Add airtime accounting and scheduling to TXQs

Rajkumar Manoharan rmanohar at codeaurora.org
Fri Oct 12 03:38:48 EDT 2018


On 2018-10-11 03:38, Toke Høiland-Jørgensen wrote:
> Rajkumar Manoharan <rmanohar at codeaurora.org> writes:
> 
>> Hmm... mine is bit different. txqs are refilled only once for all 
>> txqs.
>> It will give more opportunity for non-served txqs. drv_wake_tx_queue
>> won't be
>> called from may_tx as the driver anyway will not push packets in
>> pull-mode.
> 
> So, as far as I can tell, this requires the hardware to "keep trying"?
> I.e., if it just stops scheduling a TXQ after may_transmit() returns
> false, there is no guarantee that that TXQ will ever get re-awoken
> unless a new packet arrives for it?
> 
That is true and even now ath10k operates the same way in pull mode. Not
just packet arrival, even napi poll routine tries to pushes the packets.
One more thing, fetch indication may pull ~4ms/8ms of packets from each 
tid.
This makes deficit too low and so refilling txqs by just airtime_weight 
becomes
cumbersome. In may_transmit, the deficit are incremented by 20 * 
airtime_weight.
In future this will be also replaced by station specific quantum. we can 
revisit
this once BQL in place. Performance issue is resolved by this approach.
Do you foresee any issues?


#define IEEE80211_TXQ_MAY_TX_QUANTUM  20
bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
                                 struct ieee80211_txq *txq)
{
         struct ieee80211_local *local = hw_to_local(hw);
         struct txq_info *txqi = to_txq_info(txq);
         struct sta_info *sta;
         u8 ac = txq->ac;

         lockdep_assert_held(&local->active_txq_lock[ac]);

         if (!txqi->txq.sta)
                 goto out;

         sta = container_of(txqi->txq.sta, struct sta_info, sta);
         if (sta->airtime[ac].deficit >= 0)
                 goto out;

         list_for_each_entry(txqi, &local->active_txqs[ac], 
schedule_order) {
                 if (!txqi->txq.sta)
                         continue;
                 sta = container_of(txqi->txq.sta, struct sta_info, sta);
                 sta->airtime[ac].deficit +=
                         (IEEE80211_TXQ_MAY_TX_QUANTUM * 
sta->airtime_weight);
         }

         return false;

  out:
         list_del_init(&txqi->schedule_order);
         return true;
}

-Rajkumar


More information about the Make-wifi-fast mailing list