Changeset 20153


Ignore:
Timestamp:
2010-03-11T23:08:06+01:00 (8 years ago)
Author:
nbd
Message:

minstrel_ht: make the ewma of the ampdu length more smooth by updating it on stats updates and reduce the frequency of aggregation checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/mac80211/patches/560-minstrel_ht.patch

    r20115 r20153  
    6969--- /dev/null 
    7070+++ b/net/mac80211/rc80211_minstrel_ht.c 
    71 @@ -0,0 +1,809 @@ 
     71@@ -0,0 +1,815 @@ 
    7272+/* 
    7373+ * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org> 
     
    263263+       int group, i, index; 
    264264+ 
     265+       if (mi->ampdu_packets > 0) { 
     266+               mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len, 
     267+                       MINSTREL_FRAC(mi->ampdu_len, mi->ampdu_packets), EWMA_LEVEL); 
     268+               mi->ampdu_len = 0; 
     269+               mi->ampdu_packets = 0; 
     270+       } 
     271+ 
    265272+       mi->sample_slow = 0; 
    266273+       mi->sample_count = 0; 
     
    416423+} 
    417424+ 
     425+static void 
     426+minstrel_aggr_check(struct minstrel_priv *mp, struct ieee80211_sta *pubsta, struct sk_buff *skb) 
     427+{ 
     428+       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 
     429+       struct sta_info *sta = container_of(pubsta, struct sta_info, sta); 
     430+       u16 tid; 
     431+ 
     432+       if (unlikely(!ieee80211_is_data_qos(hdr->frame_control))) 
     433+               return; 
     434+ 
     435+       if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) 
     436+               return; 
     437+ 
     438+       tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; 
     439+       if (likely(sta->ampdu_mlme.tid_state_tx[tid] != HT_AGG_STATE_IDLE)) 
     440+               return; 
     441+ 
     442+       ieee80211_start_tx_ba_session(pubsta, tid); 
     443+} 
    418444+ 
    419445+static void 
     
    445471+       } 
    446472+ 
    447 +       mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len, 
    448 +               MINSTREL_FRAC(info->status.ampdu_len, 1), 90); 
     473+       mi->ampdu_packets++; 
     474+       mi->ampdu_len += info->status.ampdu_len; 
    449475+ 
    450476+       if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) { 
     
    491517+               minstrel_downgrade_rate(mi, &mi->max_tp_rate2, false); 
    492518+ 
    493 +       if (time_after(jiffies, mi->stats_update + (mp->update_interval / 2 * HZ) / 1000)) 
     519+       if (time_after(jiffies, mi->stats_update + (mp->update_interval / 2 * HZ) / 1000)) { 
    494520+               minstrel_ht_update_stats(mp, mi); 
     521+               minstrel_aggr_check(mp, sta, skb); 
     522+       } 
    495523+} 
    496524+ 
     
    617645+ 
    618646+static void 
    619 +minstrel_aggr_check(struct minstrel_priv *mp, struct ieee80211_sta *pubsta, struct sk_buff *skb) 
    620 +{ 
    621 +       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 
    622 +       struct sta_info *sta = container_of(pubsta, struct sta_info, sta); 
    623 +       u16 tid; 
    624 + 
    625 +       if (unlikely(!ieee80211_is_data_qos(hdr->frame_control))) 
    626 +               return; 
    627 + 
    628 +       if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) 
    629 +               return; 
    630 + 
    631 +       tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; 
    632 +       if (likely(sta->ampdu_mlme.tid_state_tx[tid] != HT_AGG_STATE_IDLE)) 
    633 +               return; 
    634 + 
    635 +       ieee80211_start_tx_ba_session(pubsta, tid); 
    636 +} 
    637 + 
    638 +static void 
    639647+minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, 
    640648+                     struct ieee80211_tx_rate_control *txrc) 
     
    652660+       if (!msp->is_ht) 
    653661+               return mac80211_minstrel.get_rate(priv, sta, &msp->legacy, txrc); 
    654 + 
    655 +       minstrel_aggr_check(mp, sta, txrc->skb); 
    656662+ 
    657663+       sample_idx = minstrel_get_sample_rate(mp, mi); 
     
    881887--- /dev/null 
    882888+++ b/net/mac80211/rc80211_minstrel_ht.h 
    883 @@ -0,0 +1,121 @@ 
     889@@ -0,0 +1,125 @@ 
    884890+/* 
    885891+ * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org> 
     
    952958+ 
    953959+struct minstrel_ht_sta { 
    954 +       /* ampdu length average (EWMA) */ 
     960+       /* ampdu length (average, per sampling interval) */ 
     961+       unsigned int ampdu_len; 
     962+       unsigned int ampdu_packets; 
     963+ 
     964+       /* ampdu length (EWMA) */ 
    955965+       unsigned int avg_ampdu_len; 
    956966+ 
Note: See TracChangeset for help on using the changeset viewer.