From a97b0a7c2d96bd0123a3db107d847458be3d9c2d Mon Sep 17 00:00:00 2001 From: Debabrata Purohit Date: Mon, 18 Jun 2018 17:23:07 +0100 Subject: [PATCH] [9610] wlbt: traffic monitor - update hysteresis The transitions from high throughput to mid throughput and vice versa are too frequent. Add more hysteresis to transition from High to mid. Change-Id: I8662eaf21d52073acb34ec229933e649be73bcf6 SCSC-Bug-Id: SSB-41039 Signed-off-by: Debabrata Purohit --- drivers/net/wireless/scsc/traffic_monitor.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/scsc/traffic_monitor.c b/drivers/net/wireless/scsc/traffic_monitor.c index 7476ea9ff2e1..4648c453d9fb 100644 --- a/drivers/net/wireless/scsc/traffic_monitor.c +++ b/drivers/net/wireless/scsc/traffic_monitor.c @@ -43,13 +43,15 @@ static inline void traffic_mon_invoke_client_callback(struct slsi_dev *sdev, u32 traffic_client->traffic_mon_client_cb(traffic_client->client_ctx, TRAFFIC_MON_CLIENT_STATE_HIGH, tput_tx, tput_rx); } } else if ((traffic_client->mid_tput) && ((tput_tx + tput_rx) > traffic_client->mid_tput)) { - if (traffic_client->state != TRAFFIC_MON_CLIENT_STATE_MID && - (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_HIGH)) { - SLSI_DBG1(sdev, SLSI_HIP, "notify traffic event (tput:%u, state:%u --> MID)\n", (tput_tx + tput_rx), traffic_client->state); - traffic_client->hysteresis = 0; - traffic_client->state = TRAFFIC_MON_CLIENT_STATE_MID; - if (traffic_client->traffic_mon_client_cb) - traffic_client->traffic_mon_client_cb(traffic_client->client_ctx, TRAFFIC_MON_CLIENT_STATE_MID, tput_tx, tput_rx); + if (traffic_client->state != TRAFFIC_MON_CLIENT_STATE_MID) { + if ((traffic_client->state == TRAFFIC_MON_CLIENT_STATE_LOW && (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_HIGH)) || + (traffic_client->state == TRAFFIC_MON_CLIENT_STATE_HIGH && (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_LOW))) { + SLSI_DBG1(sdev, SLSI_HIP, "notify traffic event (tput:%u, state:%u --> MID)\n", (tput_tx + tput_rx), traffic_client->state); + traffic_client->hysteresis = 0; + traffic_client->state = TRAFFIC_MON_CLIENT_STATE_MID; + if (traffic_client->traffic_mon_client_cb) + traffic_client->traffic_mon_client_cb(traffic_client->client_ctx, TRAFFIC_MON_CLIENT_STATE_MID, tput_tx, tput_rx); + } } } else if (traffic_client->state != TRAFFIC_MON_CLIENT_STATE_LOW && (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_LOW)) { -- 2.20.1