From ec1e58cd439ae645ff4e5bf55f7961e359bf0e4c Mon Sep 17 00:00:00 2001 From: Mingguang Xu Date: Thu, 19 Sep 2019 00:29:40 -0700 Subject: =?UTF-8?q?Wifi=20usability:=C2=A0Change=20the=20unit=20of=20the?= =?UTF-8?q?=20threshold=20for=20tx/rx=20throughput=20from=20Mbps=20to=20Kb?= =?UTF-8?q?ps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Data stall event can be triggered if the tx/rx tput is consecutively below a threshold over multiple RSSI polls.   Changing the unit of the threshold from Mbps to Kbps allows us to configure a value below 1Mbps, e.g., 400Kbps. Bug: 141027476 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If0ca391b248c4248da8d2fee37c82d74fdb25ed2 Signed-off-by: Mingguang Xu Merged-In: I76d6338cd2d482d198fde1e5a2d1a0540c087ca6 --- .../com/android/server/wifi/DeviceConfigFacade.java | 20 ++++++++++---------- .../java/com/android/server/wifi/WifiDataStall.java | 20 ++++++++++---------- .../java/com/android/server/wifi/WifiMetrics.java | 16 ++++++++-------- 3 files changed, 28 insertions(+), 28 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/DeviceConfigFacade.java b/service/java/com/android/server/wifi/DeviceConfigFacade.java index a9889f424..947261b8a 100644 --- a/service/java/com/android/server/wifi/DeviceConfigFacade.java +++ b/service/java/com/android/server/wifi/DeviceConfigFacade.java @@ -31,10 +31,10 @@ public class DeviceConfigFacade { // Default duration for evaluating Wifi condition to trigger a data stall // measured in milliseconds public static final int DEFAULT_DATA_STALL_DURATION_MS = 1500; - // Default threshold of Tx throughput below which to trigger a data stall measured in Mbps - public static final int DEFAULT_DATA_STALL_TX_TPUT_THR_MBPS = 2; - // Default threshold of Rx throughput below which to trigger a data stall measured in Mbps - public static final int DEFAULT_DATA_STALL_RX_TPUT_THR_MBPS = 2; + // Default threshold of Tx throughput below which to trigger a data stall measured in Kbps + public static final int DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS = 2000; + // Default threshold of Rx throughput below which to trigger a data stall measured in Kbps + public static final int DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS = 2000; // Default threshold of Tx packet error rate above which to trigger a data stall in percentage public static final int DEFAULT_DATA_STALL_TX_PER_THR = 90; // Default threshold of CCA level above which to trigger a data stall in percentage @@ -77,17 +77,17 @@ public class DeviceConfigFacade { /** * Gets the threshold of Tx throughput below which to trigger a data stall. */ - public int getDataStallTxTputThrMbps() { - return DeviceConfig.getInt(NAMESPACE, "data_stall_tx_tput_thr_mbps", - DEFAULT_DATA_STALL_TX_TPUT_THR_MBPS); + public int getDataStallTxTputThrKbps() { + return DeviceConfig.getInt(NAMESPACE, "data_stall_tx_tput_thr_kbps", + DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS); } /** * Gets the threshold of Rx throughput below which to trigger a data stall. */ - public int getDataStallRxTputThrMbps() { - return DeviceConfig.getInt(NAMESPACE, "data_stall_rx_tput_thr_mbps", - DEFAULT_DATA_STALL_RX_TPUT_THR_MBPS); + public int getDataStallRxTputThrKbps() { + return DeviceConfig.getInt(NAMESPACE, "data_stall_rx_tput_thr_kbps", + DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS); } /** diff --git a/service/java/com/android/server/wifi/WifiDataStall.java b/service/java/com/android/server/wifi/WifiDataStall.java index 6eb3b41e5..a7931febe 100644 --- a/service/java/com/android/server/wifi/WifiDataStall.java +++ b/service/java/com/android/server/wifi/WifiDataStall.java @@ -52,8 +52,8 @@ public class WifiDataStall { private int mMinTxBad; private int mMinTxSuccessWithoutRx; private int mDataStallDurationMs; - private int mDataStallTxTputThrMbps; - private int mDataStallRxTputThrMbps; + private int mDataStallTxTputThrKbps; + private int mDataStallRxTputThrKbps; private int mDataStallTxPerThr; private int mDataStallCcaLevelThr; private int mLastFrequency = -1; @@ -156,12 +156,12 @@ public class WifiDataStall { boolean isTxTputLow = false; boolean isRxTputLow = false; if (txLinkSpeed > 0) { - int txTput = txLinkSpeed * (100 - txPer) * (100 - ccaLevel); - isTxTputLow = txTput < mDataStallTxTputThrMbps * 100 * 100; + int txTputKbps = txLinkSpeed * 1000 * (100 - txPer) * (100 - ccaLevel); + isTxTputLow = txTputKbps < mDataStallTxTputThrKbps * 100 * 100; } if (rxLinkSpeed > 0) { - int rxTput = rxLinkSpeed * (100 - ccaLevel); - isRxTputLow = rxTput < mDataStallRxTputThrMbps * 100; + int rxTputKbps = rxLinkSpeed * 1000 * (100 - ccaLevel); + isRxTputLow = rxTputKbps < mDataStallRxTputThrKbps * 100; } boolean dataStallTx = isTxTputLow || ccaLevel >= mDataStallCcaLevelThr @@ -255,14 +255,14 @@ public class WifiDataStall { private void updateUsabilityDataCollectionFlags() { mDataStallDurationMs = mDeviceConfigFacade.getDataStallDurationMs(); - mDataStallTxTputThrMbps = mDeviceConfigFacade.getDataStallTxTputThrMbps(); - mDataStallRxTputThrMbps = mDeviceConfigFacade.getDataStallRxTputThrMbps(); + mDataStallTxTputThrKbps = mDeviceConfigFacade.getDataStallTxTputThrKbps(); + mDataStallRxTputThrKbps = mDeviceConfigFacade.getDataStallRxTputThrKbps(); mDataStallTxPerThr = mDeviceConfigFacade.getDataStallTxPerThr(); mDataStallCcaLevelThr = mDeviceConfigFacade.getDataStallCcaLevelThr(); mWifiMetrics.setDataStallDurationMs(mDataStallDurationMs); - mWifiMetrics.setDataStallTxTputThrMbps(mDataStallTxTputThrMbps); - mWifiMetrics.setDataStallRxTputThrMbps(mDataStallRxTputThrMbps); + mWifiMetrics.setDataStallTxTputThrKbps(mDataStallTxTputThrKbps); + mWifiMetrics.setDataStallRxTputThrKbps(mDataStallRxTputThrKbps); mWifiMetrics.setDataStallTxPerThr(mDataStallTxPerThr); mWifiMetrics.setDataStallCcaLevelThr(mDataStallCcaLevelThr); } diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index 1b7e8cdb3..54a0be66d 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -2784,10 +2784,10 @@ public class WifiMetrics { + mExperimentValues.linkSpeedCountsLoggingEnabled); pw.println("mExperimentValues.dataStallDurationMs=" + mExperimentValues.dataStallDurationMs); - pw.println("mExperimentValues.dataStallTxTputThrMbps=" - + mExperimentValues.dataStallTxTputThrMbps); - pw.println("mExperimentValues.dataStallRxTputThrMbps=" - + mExperimentValues.dataStallRxTputThrMbps); + pw.println("mExperimentValues.dataStallTxTputThrKbps=" + + mExperimentValues.dataStallTxTputThrKbps); + pw.println("mExperimentValues.dataStallRxTputThrKbps=" + + mExperimentValues.dataStallRxTputThrKbps); pw.println("mExperimentValues.dataStallTxPerThr=" + mExperimentValues.dataStallTxPerThr); pw.println("mExperimentValues.dataStallCcaLevelThr=" @@ -5214,18 +5214,18 @@ public class WifiMetrics { /** * Sets the threshold of Tx throughput below which to trigger a data stall */ - public void setDataStallTxTputThrMbps(int txTputThr) { + public void setDataStallTxTputThrKbps(int txTputThr) { synchronized (mLock) { - mExperimentValues.dataStallTxTputThrMbps = txTputThr; + mExperimentValues.dataStallTxTputThrKbps = txTputThr; } } /** * Sets the threshold of Rx throughput below which to trigger a data stall */ - public void setDataStallRxTputThrMbps(int rxTputThr) { + public void setDataStallRxTputThrKbps(int rxTputThr) { synchronized (mLock) { - mExperimentValues.dataStallRxTputThrMbps = rxTputThr; + mExperimentValues.dataStallRxTputThrKbps = rxTputThr; } } -- cgit v1.2.3