[BUG]wifi断流问题总结

断流现象

据用户反馈的情况来看,有两种情况:

  • 灭屏待机一段时间后唤醒,wifi信号满格但是无法访问网络,重启wifi即可恢复正常。
  • 用户体验过程中出现wifi断开连接,然后又自动重连的现象。

日志分析

bugreport

    2020-04-16T15:49:06.780 - INVOKE onReachabilityLost(FAILURE: LOST_PROVISIONING, NeighborEvent{@81882701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]})
    2020-04-16T15:49:08.281 - [IpReachabilityMonitor] WARN ALERT neighbor went from: NeighborEvent{@81882701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]} to: NeighborEvent{@81884201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]}
    2020-04-16T15:49:08.282 - INVOKE onReachabilityLost(FAILURE: LOST_PROVISIONING, NeighborEvent{@81884201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]})
    2020-04-16T15:49:09.780 - [IpReachabilityMonitor] WARN ALERT neighbor went from: NeighborEvent{@81884201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]} to: NeighborEvent{@81885701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]}
    2020-04-16T15:49:09.782 - INVOKE onReachabilityLost(FAILURE: LOST_PROVISIONING, NeighborEvent{@81885701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]})
    2020-04-16T15:49:11.281 - [IpReachabilityMonitor] WARN ALERT neighbor went from: NeighborEvent{@81885701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]} to: NeighborEvent{@81887201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]}
    2020-04-16T15:49:11.282 - INVOKE onReachabilityLost(FAILURE: LOST_PROVISIONING, NeighborEvent{@81887201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]})
    2020-04-16T15:49:12.781 - [IpReachabilityMonitor] WARN ALERT neighbor went from: NeighborEvent{@81887201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]} to: NeighborEvent{@81888701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]}
    2020-04-16T15:49:12.782 - INVOKE onReachabilityLost(FAILURE: LOST_PROVISIONING, NeighborEvent{@81888701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]})
    2020-04-16T15:49:14.281 - [IpReachabilityMonitor] WARN ALERT neighbor went from: NeighborEvent{@81888701,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]} to: NeighborEvent{@81890201,RTM_NEWNEIGH,if=30,192.168.1.254,NUD_FAILED,[null]}

日志中出现大量的NUD_FAILED,此时网络已经出现异常。

wlan_logs

15:40:04.912728 [soft_irq][0x46dfa60c50][15:40:04.899479]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:06.803485 [soft_irq][0x46e1cfa088][15:40:06.789028]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:07.493957 [soft_irq][0x46e29cce2d][15:40:07.489370]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:08.300831 [soft_irq][0x46e3872d62][15:40:08.289360]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:08.586850 [soft_irq][0x46e3d964fc][15:40:08.569994]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:09.796496 [soft_irq][0x46e53edc99][15:40:09.790149]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:11.306431 [soft_irq][0x46e6f90dbd][15:40:11.299498]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
15:40:12.142117 [soft_irq][0x46e7ec3901][15:40:12.129515]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
12:21:45.155363 [soft_irq][0x2a47f59d11a][12:21:45.098801]wlan: [0:D:HDD] __hdd_nud_netevent_cb: 447: enter
12:21:45.155373 [soft_irq][0x2a47f59d1f9][12:21:45.098811]wlan: [0:D:HDD] hdd_nud_filter_netevent: 367: enter
12:21:45.155382 [soft_irq][0x2a47f59d36f][12:21:45.098831]wlan: [0:D:HDD] hdd_nud_filter_netevent: 422: NUD_FAILED [0x20]
12:21:45.155392 [soft_irq][0x2a47f59d3d8][12:21:45.098836]wlan: [0:D:HDD] hdd_nud_process_failure_event: 349: NUD FAILED -> Current State [0x0]
12:21:45.155402 [soft_irq][0x2a47f59d420][12:21:45.098840]wlan: [0:D:HDD] hdd_nud_filter_netevent: 430: exit
12:21:45.155411 [soft_irq][0x2a47f59d462][12:21:45.098844]wlan: [0:D:HDD] __hdd_nud_netevent_cb: 449: exit
12:21:45.155431 [soft_irq][0x2a47f6a3750][12:21:45.154777]wlan: [0:D:HDD] hdd_get_transmit_sta_id: 460: Received MC/BC packet for transmission
12:21:45.155442 [soft_irq][0x2a47f6a3cc5][12:21:45.154849]wlan: [0:D:QDF] DPT: 1910:255 ICMPv6: [0] [NS] SA: 20:f4:78:41:1d:32 --> DA: 33:33:ff:84:eb:9e
12:21:45.784847 [soft_irq][0x2a47f6a3ef3][12:21:45.154878]wlan: [0:D:QDF] DPT: 1911:255 TX:[949] 3333ff84eb9e 20f478411d32 86dd60000000 00203aff2a02 8109b6bf823c 41fad2e09df6 8fc5
12:21:45.784863 [soft_irq][0x2a47f6a6865][12:21:45.155431]wlan: [0:D:QDF] DPT: 1912:255 FREE: TX: PTR:[msdu id 949 status 0]
12:21:45.784870 [soft_irq][0x2a47f8bbdab][12:21:45.269208]wlan: [0:IH:DATA] __hdd_hard_start_xmit : ARP packet

从wlan_logs里看到arp收不到回复包。

tcpdump

sniffer

sniffer日志中我们可以看到是AP主动发Deauth帧给手机的。

根本原因

高通在进行漫游功能时存在一个bug,当AP收到Deauth帧时,不会立即断开而会去首先漫游。所以并没有将断开的event继续传到host driver层,而AP不会在发送任何帧给STA。此bug已经有了成熟的方案,需要合入CR#2437762CR#2613002

解决方案

1. 合入CR#2437762,2613002

2. enable_disconnect_roam_offload=1

要保证WCNSS_qcom_cfg.ini中的参数enable_disconnect_roam_offload=1

如果当前的版本中没有此参数需要合入AP端CR#2437762

此CRpatch 如下:

From cdf1df1ef1e4a25644527c1d74a410c8152044f3 Mon Sep 17 00:00:00 2001
From: liuqi <liuqi@longcheer.com>
Date: Fri, 14 Feb 2020 17:47:46 +0800
Subject: [PATCH] [M521][wifi][HTH-81388]: wifi drop and reconnect [root cause]: deauth/disassoc frame triggered emergency roaming implementation 
[solution]: merge CR#2437762 and add parameters in the INI file             enable_disconnect_roam_offload=1 
[sideeffect]:No 
[others]:No

Change-Id: I301b8afad892b61d7bea62d9eb05ef308023f698
---

diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 01aca7f..23ead97 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -2318,7 +2318,9 @@
  * WMI_ROAM_TRIGGER_REASON_BTM - 10
  * WMI_ROAM_TRIGGER_REASON_UNIT_TEST - 11
  * WMI_ROAM_TRIGGER_REASON_BSS_LOAD - 12
- * WMI_ROAM_TRIGGER_REASON_MAX - 13
+ * WMI_ROAM_TRIGGER_REASON_DEAUTH - 13
+ * WMI_ROAM_TRIGGER_REASON_IDLE - 14
+ * WMI_ROAM_TRIGGER_REASON_MAX - 15
  *
  * For Ex: 0xDA (PER, LOW_RSSI, HIGH_RSSI, MAWC, DENSE)
  *
@@ -16394,6 +16396,183 @@
 #define CFG_NAN_NDP_INACTIVITY_TIMEOUT_MIN     (0)

 /*
+ * <ini>
+ * enable_disconnect_roam_offload - Enable/Disable emergency roaming during
+ * deauth/disassoc
+ * @Min: 0 - Disabled
+ * @Max: 1 - Enabled
+ * @Default: 1
+ *
+ * When this ini is enabled firmware will trigger roam scan and roam to a new ap
+ * if candidate is found and it will not send the deauth/disassoc frame to
+ * the host driver.
+ * If roaming fails after this deauth, then firmware will send
+ * WMI_ROAM_REASON_DEAUTH event to the host. If roaming is successful, driver
+ * follows the normal roam synch event path.
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_ENABLE_DISCONNECT_ROAM      "enable_disconnect_roam_offload"
+#define CFG_LFR_ENABLE_DISCONNECT_ROAM_MIN     (false)
+#define CFG_LFR_ENABLE_DISCONNECT_ROAM_MAX     (true)
+#define CFG_LFR_ENABLE_DISCONNECT_ROAM_DEFAULT (true)
+
+/*
+ * <ini>
+ * enable_idle_roam - Enable/Disable idle roaming
+ * @Min: 0 - Disabled
+ * @Max: 1 - Enabled
+ * @Default: 0
+ *
+ * When this ini is enabled firmware will trigger roam scan and roam to a new
+ * ap if current connected AP rssi falls below the threshold. To consider the
+ * connection as idle, the following conditions should be met if this ini
+ * "enable_idle_roam" is enabled:
+ * 1. User space sends "SET SUSPENDMODE" command with value 0.
+ * 2. No TX/RX data for idle time configured via ini "idle_roam_inactive_time".
+ * 3. Connected AP rssi change doesn't exceed a specific delta value.
+ * (configured via ini idle_roam_rssi_delta)
+ * 4. Connected AP rssi falls below minimum rssi (configured via ini
+ * "idle_roam_min_rssi").
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_ENABLE_IDLE_ROAM    "enable_idle_roam"
+#define CFG_LFR_ENABLE_IDLE_ROAM_MIN     (false)
+#define CFG_LFR_ENABLE_IDLE_ROAM_MAX     (true)
+#define CFG_LFR_ENABLE_IDLE_ROAM_DEFAULT (false)
+
+/*
+ * <ini>
+ * idle_roam_rssi_delta - This threshold is the criteria to decide whether DUT
+ * is idle or moving. If rssi delta is more than configured thresold then its
+ * considered as not idle. RSSI delta is entered in dBm. Idle roaming can be
+ * triggered if the connected AP rssi change exceeds or falls below the
+ * rssi delta and if other criteria of ini "enable_idle_roam" is met
+ * @Min: 0
+ * @Max: 50
+ * @Default: 5
+ *
+ * Related: enable_idle_roam
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_IDLE_ROAM_RSSI_DELTA   "idle_roam_rssi_delta"
+#define CFG_LFR_IDLE_ROAM_RSSI_DELTA_MIN      (0)
+#define CFG_LFR_IDLE_ROAM_RSSI_DELTA_MAX      (50)
+#define CFG_LFR_IDLE_ROAM_RSSI_DELTA_DEFAULT  (5)
+
+/*
+ * <ini>
+ * idle_roam_inactive_time - Time duration in millseconds for which the
+ * connection is idle.
+ * @Min: 0
+ * @Max: 0xFFFFFFFF
+ * @Default: 10000
+ *
+ * This ini is used to configure the time in seconds for which the connection
+ * candidate is idle and after which idle roam scan can be triggered if
+ * other criteria of ini "enable_idle_roam" is met.
+ *
+ * Related: enable_idle_roam
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_IDLE_ROAM_INACTIVE_TIME   "idle_roam_inactive_time"
+#define CFG_LFR_IDLE_ROAM_INACTIVE_TIME_MIN        (0)
+#define CFG_LFR_IDLE_ROAM_INACTIVE_TIME_MAX      (0xFFFFFFFF)
+#define CFG_LFR_IDLE_ROAM_INACTIVE_TIME_DEFAULT  (10000)
+
+/*
+ * <ini>
+ * idle_data_packet_count - No of tx/rx packets above which the connection is
+ * not idle.
+ * @Min: 0
+ * @Max: 0xFFFFFFFF
+ * @Default: 10
+ *
+ * This ini is used to configure the acceptable number of tx/rx packets below
+ * which the connection is idle. Ex: If idle_data_packet_count is 10
+ * and if the tx/rx packet count is less than 10, the connection is
+ * idle. If there are more than 10 packets, the connection is active one.
+ *
+ * Related: enable_idle_roam
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_IDLE_ROAM_PACKET_COUNT       "idle_data_packet_count"
+#define CFG_LFR_IDLE_ROAM_PACKET_COUNT_MIN            (0)
+#define CFG_LFR_IDLE_ROAM_PACKET_COUNT_MAX        (0xFFFFFFFF)
+#define CFG_LFR_IDLE_ROAM_PACKET_COUNT_DEFAULT        (10)
+
+/*
+ * <ini>
+ * idle_roam_min_rssi - Minimum RSSI of connected AP, below which
+ * idle roam scan can be triggered if other criteria of ini "enable_idle_roam"
+ * is met.
+ * @Min: -96
+ * @Max: 0
+ * @Default: -65
+ *
+ * Related: enable_idle_roam
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_IDLE_ROAM_MIN_RSSI    "idle_roam_min_rssi"
+#define CFG_LFR_IDLE_ROAM_MIN_RSSI_MIN      (-96)
+#define CFG_LFR_IDLE_ROAM_MIN_RSSI_MAX       (0)
+#define CFG_LFR_IDLE_ROAM_MIN_RSSI_DEFAULT  (-65)
+
+/*
+ * <ini>
+ * idle_roam_band - Band on which idle roam scan will be
+ * enabled
+ * @Min: 0
+ * @Max: 2
+ * @Default: 0
+ *
+ * Value 0 - Allow idle roam on both bands
+ * Value 1 - Allow idle roam only on 2G band
+ * Value 2 - Allow idle roam only on 5G band
+ *
+ * Related: enable_idle_roam
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_LFR_IDLE_ROAM_BAND      "idle_roam_band"
+#define CFG_LFR_IDLE_ROAM_BAND_MIN      (0)
+#define CFG_LFR_IDLE_ROAM_BAND_MAX      (2)
+#define CFG_LFR_IDLE_ROAM_BAND_DEFAULT  (0)
+
+/*
  * Type declarations
  */

@@ -17334,6 +17513,13 @@
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
    uint32_t roam_preauth_retry_count;
    uint32_t roam_preauth_no_ack_timeout;
+   bool enable_disconnect_roam_offload;
+   bool enable_idle_roam;
+   uint32_t idle_roam_rssi_delta;
+   uint32_t idle_roam_inactive_time;
+   uint32_t idle_data_packet_count;
+   uint32_t idle_roam_band;
+   int32_t idle_roam_min_rssi;
 #endif
    uint32_t num_tx_chains_2g;
    uint32_t num_tx_chains_5g;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 2b39ebe..70d6607 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -5885,6 +5885,55 @@
             CFG_ROAM_PREAUTH_NO_ACK_TIMEOUT_DEFAULT,
             CFG_ROAM_PREAUTH_NO_ACK_TIMEOUT_MIN,
             CFG_ROAM_PREAUTH_NO_ACK_TIMEOUT_MAX),
+
+   REG_VARIABLE(CFG_LFR_ENABLE_DISCONNECT_ROAM, WLAN_PARAM_Integer,
+            struct hdd_config, enable_disconnect_roam_offload,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_ENABLE_DISCONNECT_ROAM_DEFAULT,
+            CFG_LFR_ENABLE_DISCONNECT_ROAM_MIN,
+            CFG_LFR_ENABLE_DISCONNECT_ROAM_MAX),
+
+   REG_VARIABLE(CFG_LFR_ENABLE_IDLE_ROAM, WLAN_PARAM_Integer,
+            struct hdd_config, enable_idle_roam,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_ENABLE_IDLE_ROAM_DEFAULT,
+            CFG_LFR_ENABLE_IDLE_ROAM_MIN,
+            CFG_LFR_ENABLE_IDLE_ROAM_MAX),
+
+   REG_VARIABLE(CFG_LFR_IDLE_ROAM_RSSI_DELTA, WLAN_PARAM_Integer,
+            struct hdd_config, idle_roam_rssi_delta,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_IDLE_ROAM_RSSI_DELTA_DEFAULT,
+            CFG_LFR_IDLE_ROAM_RSSI_DELTA_MIN,
+            CFG_LFR_IDLE_ROAM_RSSI_DELTA_MAX),
+
+   REG_VARIABLE(CFG_LFR_IDLE_ROAM_INACTIVE_TIME, WLAN_PARAM_Integer,
+            struct hdd_config, idle_roam_inactive_time,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_IDLE_ROAM_INACTIVE_TIME_DEFAULT,
+            CFG_LFR_IDLE_ROAM_INACTIVE_TIME_MIN,
+            CFG_LFR_IDLE_ROAM_INACTIVE_TIME_MAX),
+
+   REG_VARIABLE(CFG_LFR_IDLE_ROAM_PACKET_COUNT, WLAN_PARAM_Integer,
+            struct hdd_config, idle_data_packet_count,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_IDLE_ROAM_PACKET_COUNT_DEFAULT,
+            CFG_LFR_IDLE_ROAM_PACKET_COUNT_MIN,
+            CFG_LFR_IDLE_ROAM_PACKET_COUNT_MAX),
+
+   REG_VARIABLE(CFG_LFR_IDLE_ROAM_MIN_RSSI, WLAN_PARAM_SignedInteger,
+            struct hdd_config, idle_roam_min_rssi,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_IDLE_ROAM_MIN_RSSI_DEFAULT,
+            CFG_LFR_IDLE_ROAM_MIN_RSSI_MIN,
+            CFG_LFR_IDLE_ROAM_MIN_RSSI_MAX),
+
+   REG_VARIABLE(CFG_LFR_IDLE_ROAM_BAND, WLAN_PARAM_Integer,
+            struct hdd_config, idle_roam_band,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_LFR_IDLE_ROAM_BAND_DEFAULT,
+            CFG_LFR_IDLE_ROAM_BAND_MIN,
+            CFG_LFR_IDLE_ROAM_BAND_MAX),
 #endif

    REG_VARIABLE(CFG_ENABLE_MAC_PROVISION_NAME, WLAN_PARAM_Integer,
@@ -5979,11 +6028,12 @@
             CFG_BSS_LOAD_THRESHOLD_MAX),

    REG_VARIABLE(CFG_BSS_LOAD_SAMPLE_TIME, WLAN_PARAM_Integer,
-       struct hdd_config, bss_load_sample_time,
-       VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-       CFG_BSS_LOAD_SAMPLE_TIME_DEFAULT,
-       CFG_BSS_LOAD_SAMPLE_TIME_MIN,
-       CFG_BSS_LOAD_SAMPLE_TIME_MAX),
+            struct hdd_config, bss_load_sample_time,
+            VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+            CFG_BSS_LOAD_SAMPLE_TIME_DEFAULT,
+            CFG_BSS_LOAD_SAMPLE_TIME_MIN,
+            CFG_BSS_LOAD_SAMPLE_TIME_MAX),
+
    REG_VARIABLE(CFG_ENABLE_RTT_SUPPORT, WLAN_PARAM_Integer,
             struct hdd_config, enable_rtt_support,
             VAR_FLAGS_OPTIONAL,

剑气纵横三万里

“为什么要努力?” “想去的地方很远,想要的东西很贵,喜欢的人很优秀,父母的白发,朋友的约定,周围人的嘲笑,以及,天生傲骨。”

1 Comment

  • 嗯,有道理,Good

留下你的评论

*评论支持代码高亮<pre class="prettyprint linenums">代码</pre>

相关推荐

%d 博主赞过: