wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/674-Mac80211-Initialize-EWMA-fail-avg-to-1.patch
John Crispin b9b03a6e38 ipq95xx: add Qualcomm wifi-7 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00

46 lines
1.5 KiB
Diff

From 99e8fdd077080b70901934f92b4dd8269f192f6c Mon Sep 17 00:00:00 2001
From: Karthik M <quic_karm@quicinc.com>
Date: Thu, 13 Oct 2022 15:17:16 +0530
Subject: [PATCH] Mac80211: Initialize EWMA fail avg to 1
In certain scenario with more number of pass frames,
ewma_fail_avg would reach 0(lowest value) and in ewma method
value with 0 is a tricky and that could give some higher value
even with single failure value and that triggers MPL broken logic.
Note that it is already initialized to 1 during the time of init
or new mesh path assignment.
Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
Signed-off-by: Karthik M <quic_karm@quicinc.com>
---
net/mac80211/mesh_hwmp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index a2f1920..648eb22 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -299,6 +299,7 @@ void ieee80211s_update_metric(struct ieee80211_local *local,
{
struct ieee80211_tx_info *txinfo = st->info;
int failed = 0;
+ u32 fail_avg;
struct rate_info rinfo;
failed = !(txinfo->flags & IEEE80211_TX_STAT_ACK);
@@ -316,6 +317,11 @@ void ieee80211s_update_metric(struct ieee80211_local *local,
sta->mesh->fail_cnt = 0;
}
+ fail_avg = ewma_mesh_fail_avg_read(&sta->mesh->fail_avg);
+ if (!fail_avg)
+ /* init it at a low value - 0 is tricky */
+ ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, 1);
+
/* moving average, scaled to 100.
* feed failure as 100 and success as 0
*/
--
2.17.1