mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-24 21:02:35 +00:00
46 lines
1.5 KiB
Diff
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
|
|
|