diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-11-10 14:46:21 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-11-10 14:49:50 +0100 |
commit | 615dbec2238c2ea513e72a6928272d7fdf4be3b4 (patch) | |
tree | ff5b821fc21bc65868c7688d3a064db44de2c7f6 /package/kernel/mac80211/patches/subsys/346-v6.0-wifi-mac80211-fix-mesh-airtime-link-metric-estimatin.patch | |
parent | a26f7e61e8a94c192735c71e30500809de21e31f (diff) | |
download | upstream-615dbec2238c2ea513e72a6928272d7fdf4be3b4.tar.gz upstream-615dbec2238c2ea513e72a6928272d7fdf4be3b4.tar.bz2 upstream-615dbec2238c2ea513e72a6928272d7fdf4be3b4.zip |
mac80211: fix mesh airtime link metric estimation
fix reading the per-packet rate on devices with firmware rate control
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 161b22d103decd82868e8e3c3fe09b88cf64724c)
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/346-v6.0-wifi-mac80211-fix-mesh-airtime-link-metric-estimatin.patch')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/346-v6.0-wifi-mac80211-fix-mesh-airtime-link-metric-estimatin.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/346-v6.0-wifi-mac80211-fix-mesh-airtime-link-metric-estimatin.patch b/package/kernel/mac80211/patches/subsys/346-v6.0-wifi-mac80211-fix-mesh-airtime-link-metric-estimatin.patch new file mode 100644 index 0000000000..7185a7fed6 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/346-v6.0-wifi-mac80211-fix-mesh-airtime-link-metric-estimatin.patch @@ -0,0 +1,36 @@ +From: Aditya Kumar Singh <quic_adisi@quicinc.com> +Date: Fri, 1 Jul 2022 19:06:11 +0530 +Subject: [PATCH] wifi: mac80211: fix mesh airtime link metric estimating + +ieee80211s_update_metric function uses sta_set_rate_info_tx +function to get struct rate_info data from ieee80211_tx_rate +struct, present in ieee80211_sta->deflink.tx_stats. However, +drivers can skip tx rate calculation by setting rate idx as +-1. Such drivers provides rate_info directly and hence +ieee80211s metric is updated incorrectly since ieee80211_tx_rate +has inconsistent data. + +Add fix to use rate_info directly if present instead of +sta_set_rate_info_tx for updating ieee80211s metric. + +Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> +Link: https://lore.kernel.org/r/20220701133611.544-1-quic_adisi@quicinc.com +Signed-off-by: Johannes Berg <johannes.berg@intel.com> +--- + +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -310,7 +310,12 @@ void ieee80211s_update_metric(struct iee + LINK_FAIL_THRESH) + mesh_plink_broken(sta); + +- sta_set_rate_info_tx(sta, &sta->tx_stats.last_rate, &rinfo); ++ /* use rate info set by the driver directly if present */ ++ if (st->rate) ++ rinfo = sta->tx_stats.last_rate_info; ++ else ++ sta_set_rate_info_tx(sta, &sta->tx_stats.last_rate, &rinfo); ++ + ewma_mesh_tx_rate_avg_add(&sta->mesh->tx_rate_avg, + cfg80211_calculate_bitrate(&rinfo)); + } |