11 Oct, 2019

2 commits

  • Reduces per-rate data structure size

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20191008171139.96476-3-nbd@nbd.name
    Signed-off-by: Johannes Berg

    Felix Fietkau
     
  • Rate success probability usually fluctuates a lot under normal conditions.
    With a simple EWMA, noise and fluctuation can be reduced by increasing the
    window length, but that comes at the cost of introducing lag on sudden
    changes.

    This change replaces the EWMA implementation with a moving average that's
    designed to significantly reduce lag while keeping a bigger window size
    by being better at filtering out noise.

    It is only slightly more expensive than the simple EWMA and still avoids
    divisions in its calculation.

    The algorithm is adapted from an implementation intended for a completely
    different field (stock market trading), where the tradeoff of lag vs
    noise filtering is equally important. It is based on the "smoothing filter"
    from http://www.stockspotter.com/files/PredictiveIndicators.pdf.

    I have adapted it to fixed-point math with some constants so that it uses
    only addition, bit shifts and multiplication

    To better make use of the filtering and bigger window size, the update
    interval time is cut in half.

    For testing, the algorithm can be reverted to the older one via debugfs

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20191008171139.96476-2-nbd@nbd.name
    Signed-off-by: Johannes Berg

    Felix Fietkau
     

21 Aug, 2019

1 commit

  • On some devices that only support static rate fallback tables sending rate
    control probing packets can be really expensive.
    Probing lower rates can already hurt throughput quite a bit. What hurts even
    more is the fact that on mt76x0/mt76x2, single probing packets can only be
    forced by directing packets at a different internal hardware queue, which
    causes some heavy reordering and extra latency.
    The reordering issue is mainly problematic while pushing lots of packets to
    a particular station. If there is little activity, the overhead of probing is
    neglegible.

    The static fallback behavior is designed to pretty much only handle rate
    control algorithms that use only a very limited set of rates on which the
    algorithm switches up/down based on packet error rate.

    In order to better support that kind of hardware, this patch implements a
    different approach to rate probing where it switches to a slightly higher rate,
    waits for tx status feedback, then updates the stats and switches back to
    the new max throughput rate. This only triggers above a packet rate of 100
    per stats interval (~50ms).
    For that kind of probing, the code has to reduce the set of probing rates
    a lot more compared to single packet probing, so it uses only one packet
    per MCS group which is either slightly faster, or as close as possible to
    the max throughput rate.
    This allows switching between similar rates with different numbers of
    streams. The algorithm assumes that the hardware will work its way lower
    within an MCS group in case of retransmissions, so that lower rates don't
    have to be probed by the high packets per second rate probing code.

    To further reduce the search space, it also does not probe rates with lower
    channel bandwidth than the max throughput rate.

    At the moment, these changes will only affect mt76x0/mt76x2.

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20190820095449.45255-4-nbd@nbd.name
    Signed-off-by: Johannes Berg

    Felix Fietkau
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

11 Oct, 2018

3 commits


15 Dec, 2016

5 commits


02 Apr, 2015

7 commits

  • This patch adds the statistical descriptor "standard deviation"
    to better describe the current properties of Minstrel and
    Minstrel-HTs success probability distribution. The standard
    deviation (SD) is calculated as exponential weighted moving
    standard deviation (EWMSD) and its current value is added as
    new column in all rc_stats (in debugfs).

    Signed-off-by: Thomas Huehn
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • This patch reduces the calculation costs of the EWMA macro from
    "2x multiplication and 1 addition" down to "1x multiplication and
    2x additions". This slightly improves performance depending on the
    CPU architecture.

    Signed-off-by: Thomas Huehn
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • This patch adds the new statistic "maximum possible lossless
    throughput" to Minstrels and Minstrel-HTs rc_stats (in debugfs). This
    enables comprehensive comparison between current per-rate throughput
    and max. achievable per-rate throughput.

    Signed-off-by: Thomas Huehn
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • This patch moves Minstrels and Minstrel-HTs per-rate throughput
    calculation (EWMA(thr)) into a dedicated function to be called.
    Therefore the variable "unsigned int cur_tp" within struct
    "minstrel_rate_stats" becomes obsolete. and is removed to free
    up its space.

    Signed-off-by: Thomas Huehn
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • This patch ensures a consistent usage of variable names for type
    "minstrel_rate_stats" to be used as "mrs" and from type minstrel_rate
    as "mr" across both Minstrel & Minstrel-HT. In addition some
    variable and function names got changed to more meaningful ones.

    Signed-off-by: Thomas Huehn
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • This patch unifies the calculation of Minstrels and Minstrel-HTs
    per-rate statistic. The new common function minstrel_calc_rate_stats()
    is called when a statistic update is performed.

    Signed-off-by: Thomas Huehn
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • This patch adds a new debugfs file "rc_stats_csv" to output Minstrels
    statistics in a common csv format that is easy to parse.

    Signed-off-by: Thomas Huehn
    Signed-off-by: Stefan Venz
    Acked-by: Felix Fietkau
    [remove printing current time of day]
    Signed-off-by: Johannes Berg

    Thomas Huehn
     

20 Dec, 2014

1 commit


11 Sep, 2014

1 commit


05 Feb, 2014

1 commit


22 Apr, 2013

1 commit


17 Apr, 2013

1 commit

  • Use powers of two in ewma of minstrel.
    This changes :
    - EWMA_DIV from 100 to 2^7
    - EWMA_LEVEL from 75 (/EWMA_DIV=100) to 2^6 + 2^5 (/EWMA_DIV=128)

    Note that this changes EWMA_DIV - EWMA_LEVEL from 25 to 2^5 and keeps
    EWMA_LEVEL / EWMA_DIV == 0.75.

    Signed-off-by: Karl Beldan
    Acked-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Karl Beldan
     

06 Mar, 2013

6 commits

  • This patch improves the way minstrel sorts rates according to throughput
    and success probability. 3 FOR-loops across the entire rate set in function
    minstrel_update_stats() which where used to determine the fastest, second
    fastest and most robust rate are reduced to 1 FOR-loop.

    The sorted list of rates according throughput is extended to the best four
    rates as we need them in upcoming joint rate and power control. The sorting
    is done via the new function minstrel_sort_best_tp_rates().

    The most robust rate selection is aligned with minstrel_ht's approach.
    Once any success probability is above 95% the one with the highest
    throughput is chosen as most robust rate. If success probabilities of all
    rates are below 95%, the rate with the highest succ. prob. is elected as
    most robust one

    Acked-by: Felix Fietkau
    Signed-off-by: Thomas Huehn
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • While minstrel bootstraps and fills the success probabilities of each
    rate the lowest rate has typically a very high success probability
    (often 100% in our tests).
    Its statistics are never updated but considered to setup the mrr chain.
    In our tests we see that especially the 3rd mrr stage (which is that
    rate providing highest success probability) is filled with the lowest rate
    because its initial high sucess probability is never updated. By design
    the 4th mrr stage is filled with the lowest rate so often 3rd and 4th
    mrr stage are equal.

    This patch follows minstrels general approach of assuming as little
    as possible about rate dependencies. Consequently we include the
    lowest rate into the random sampling table to get balanced up-to-date
    statistics of all rates and therefore balanced decisions.

    Acked-by: Felix Fietkau
    Signed-off-by: Thomas Huehn
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • Minstrel's decision which rate should be directly sampled within the
    1st mrr stage is limited to such rates faster than the current max
    throughput rate. All rates below the current max. throughput rate
    are indirectly sampled via the 2nd mrr stage.
    This approach leads to deprecated per rate statistics and therfore
    a deprecated mrr chain setup.

    This patch uses the sampling approach from minstrel_ht. A counter is
    added to sum all indirect sample attempts per rate. After 20 indirect
    sampling attempts the rate is directly sampled within the 1st mrr stage.
    Therefore more up-to-date statistics for all rates are maintained and
    used to setup the mrr chain.

    Acked-by: Felix Fietkau
    Signed-off-by: Thomas Huehn
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • Add documentation and more verbose variable names to minstrel's
    multi-rate-retry setup within function minstrel_get_rate() to
    increase the readability of the algorithm.

    Acked-by: Felix Fietkau
    Signed-off-by: Thomas Huehn
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • Both minstrel versions use individual ways to scale up integer values
    to perform calculations. Merge minstrel_ht's scaling macros into
    minstrels header file and use them in both minstrel versions.

    Acked-by: Felix Fietkau
    Signed-off-by: Thomas Huehn
    Signed-off-by: Johannes Berg

    Thomas Huehn
     
  • Both rate control algorithms (minstrel and minstrel_ht) calculate
    averages based on EWMA. Shift function minstrel_ewma() into
    rc80211_minstrel.h and make use of it in both minstrel version.
    Also shift the default EWMA level (75%) definition to the header file
    and clean up variable usage.

    Acked-by: Felix Fietkau
    Signed-off-by: Thomas Huehn
    Signed-off-by: Johannes Berg

    Thomas Huehn
     

13 Feb, 2013

1 commit

  • When MCS rates start to get bad in 2.4 GHz because of long range or
    strong interference, CCK rates can be a lot more robust.

    This patch adds a pseudo MCS group containing CCK rates (long preamble
    in the lower 4 slots, short preamble in the upper slots).

    Signed-off-by: Felix Fietkau
    [make minstrel_ht_get_stats static]
    Signed-off-by: Johannes Berg

    Felix Fietkau
     

02 Jun, 2011

1 commit


11 Mar, 2010

2 commits


29 Aug, 2009

1 commit


01 Nov, 2008

1 commit


07 Oct, 2008

1 commit