diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-12-29 18:23:29 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-01-03 12:56:40 +0100 |
commit | 3a12c6679eb184ca2a9a2b1266cc2d41f3f00bad (patch) | |
tree | 4c2a02dad4c0ebd8cbd90ad751841f3cedbdfd05 /package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch | |
parent | 55e23f2c02ae95e84613ed7d1cbf8aba557b8682 (diff) | |
download | upstream-3a12c6679eb184ca2a9a2b1266cc2d41f3f00bad.tar.gz upstream-3a12c6679eb184ca2a9a2b1266cc2d41f3f00bad.tar.bz2 upstream-3a12c6679eb184ca2a9a2b1266cc2d41f3f00bad.zip |
mac80211: replace legacy minstrel with minstrel_ht, improve rate selection
Legacy minstrel is essentially unmaintained and was showing poor performance
Replace it with minstrel_ht and improve rate selection and sampling behavior
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch b/package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch new file mode 100644 index 0000000000..f450ca9ca9 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch @@ -0,0 +1,67 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Sat, 26 Dec 2020 19:08:19 +0100 +Subject: [PATCH] mac80211: minstrel_ht: improve ampdu length estimation + +If the driver does not report A-MPDU length, estimate it based on the rate. + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/net/mac80211/rc80211_minstrel_ht.c ++++ b/net/mac80211/rc80211_minstrel_ht.c +@@ -382,13 +382,37 @@ minstrel_get_ratestats(struct minstrel_h + return &mi->groups[index / MCS_GROUP_RATES].rates[index % MCS_GROUP_RATES]; + } + ++static inline int ++minstrel_get_duration(int index) ++{ ++ const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES]; ++ unsigned int duration = group->duration[index % MCS_GROUP_RATES]; ++ return duration << group->shift; ++} ++ + static unsigned int + minstrel_ht_avg_ampdu_len(struct minstrel_ht_sta *mi) + { +- if (!mi->avg_ampdu_len) +- return AVG_AMPDU_SIZE; ++ int duration; + +- return MINSTREL_TRUNC(mi->avg_ampdu_len); ++ if (mi->avg_ampdu_len) ++ return MINSTREL_TRUNC(mi->avg_ampdu_len); ++ ++ if (minstrel_ht_is_legacy_group(mi->max_tp_rate[0] / MCS_GROUP_RATES)) ++ return 1; ++ ++ duration = minstrel_get_duration(mi->max_tp_rate[0]); ++ ++ if (duration > 400 * 1000) ++ return 2; ++ ++ if (duration > 250 * 1000) ++ return 4; ++ ++ if (duration > 150 * 1000) ++ return 8; ++ ++ return 16; + } + + /* +@@ -588,14 +612,6 @@ minstrel_ht_prob_rate_reduce_streams(str + } + } + +-static inline int +-minstrel_get_duration(int index) +-{ +- const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES]; +- unsigned int duration = group->duration[index % MCS_GROUP_RATES]; +- return duration << group->shift; +-} +- + static bool + minstrel_ht_probe_group(struct minstrel_ht_sta *mi, const struct mcs_group *tp_group, + int tp_idx, const struct mcs_group *group) |