This diff skips MiRA's event-based probing trigger if we're already at the minimum or maximum rate of our current rateset.
As of this commit on March 5: https://marc.info/?l=openbsd-cvs&m=158340898502913&w=2 if we're beginning a probe because of a throughput measurement change event we cancel the timeouts responsible for interval-based probing. Otherwise these timeouts could kick off another unncessary probe right after the event-based probe has finished. This change addresses a related problem where we get stuck at the lowest transmission rate of a rate set (e.g. MCS 0) for some time, due to small fluctuations in measured throughput at the lowest rate, which keep telling us to "probe down" (while we're already at the lowest rate there is no way to actually probe down). Each time this happens we cancel the probing timeouts, so the "probe-up" timeout doesn't get to run, and we may not try to probe to a higher rate for a relatively long time, and our throughput stays lower than it could perhaps be. For consistency this diff also addresses the inverse issue of "probing up" while we're already at the highest rate. diff 14a1ca7807811e518898c39a278a89782a0362d8 c3784c0ccfcd72ac91a3d2e413a283a25f088b56 blob - fbfd7148bd3e7d82eca9c0221203b64318d57d2f blob + 4fdace1c4e65b2b2ecaebfd5d0a03d3b345eeacb --- sys/net80211/ieee80211_mira.c +++ sys/net80211/ieee80211_mira.c @@ -1141,9 +1141,8 @@ ieee80211_mira_choose(struct ieee80211_mira_node *mn, { struct ieee80211_mira_goodput_stats *g = &mn->g[ni->ni_txmcs]; int s; -#ifdef MIRA_AGGRESSIVE_DOWNWARDS_PROBING int sgi = (ni->ni_flags & IEEE80211_NODE_HT_SGI20) ? 1 : 0; -#endif + const struct ieee80211_ht_rateset *rs; s = splnet(); @@ -1187,7 +1186,9 @@ ieee80211_mira_choose(struct ieee80211_mira_node *mn, } /* Check if event-based probing should be triggered. */ - if (g->measured < g->average - 2 * g->stddeviation) { + rs = ieee80211_mira_get_rateset(ni->ni_txmcs, sgi); + if (g->measured < g->average - 2 * g->stddeviation && + ni->ni_txmcs != rs->min_mcs) { /* Channel becomes bad. Probe downwards. */ DPRINTFN(2, ("channel becomes bad; probe downwards\n")); DPRINTFN(3, ("measured: %s Mbit/s\n", @@ -1208,7 +1209,8 @@ ieee80211_mira_choose(struct ieee80211_mira_node *mn, (1 << ieee80211_mira_next_lower_intra_rate(mn, ni)); #endif ieee80211_mira_cancel_timeouts(mn); - } else if (g->measured > g->average + 2 * g->stddeviation) { + } else if (g->measured > g->average + 2 * g->stddeviation && + ni->ni_txmcs != rs->max_mcs) { /* Channel becomes good. */ DPRINTFN(2, ("channel becomes good; probe upwards\n")); DPRINTFN(3, ("measured: %s Mbit/s\n",
