Jelajahi Sumber

qcacld-3.0: Enable detection of data stall events

Currently, data stall events are not detected individually.
Updated gEnableDataStallDetection ini provides control over
individual data stall events if bit 0 is not set.

Change-Id: Id4fd7f10f0806a39c5bdb7b8c097c26894dc5340
CRs-Fixed: 3159405
Ananya Gupta 3 tahun lalu
induk
melakukan
2f50109251

+ 2 - 1
core/dp/ol/inc/ol_cfg.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -112,7 +113,7 @@ struct txrx_pdev_cfg_t {
 	bool tso_enable;
 	bool lro_enable;
 	bool sg_enable;
-	bool enable_data_stall_detection;
+	uint32_t enable_data_stall_detection;
 	bool enable_flow_steering;
 	bool disable_intra_bss_fwd;
 	/* IPA Micro controller data path offload TX buffer size */

+ 16 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -5390,4 +5390,20 @@ static inline int hdd_set_suspend_mode(struct hdd_context *hdd_ctx)
  * schedule idle shutdown work queue when no interface open.
  */
 void hdd_shutdown_wlan_in_suspend(struct hdd_context *hdd_ctx);
+
+#define HDD_DATA_STALL_ENABLE      BIT(0)
+#define HDD_HOST_STA_TX_TIMEOUT    BIT(16)
+#define HDD_HOST_SAP_TX_TIMEOUT    BIT(17)
+#define HDD_HOST_NUD_FAILURE       BIT(18)
+#define HDD_TIMEOUT_WLM_MODE       BIT(31)
+#define FW_DATA_STALL_EVT_MASK     0x8000FFFF
+
+/**
+ * hdd_is_data_stall_event_enabled() - Check if data stall detection is enabled
+ * @evt: Data stall event to be checked
+ *
+ * Return: True if the data stall event is enabled
+ */
+bool hdd_is_data_stall_event_enabled(uint32_t evt);
+
 #endif /* end #if !defined(WLAN_HDD_MAIN_H) */

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -15586,7 +15586,7 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
 	pkt_type_bitmap = adapter->pkt_type_bitmap;
 
 	/* send NUD failure event only when ARP tracking is enabled. */
-	if (cdp_cfg_get(soc, cfg_dp_enable_data_stall) &&
+	if (hdd_is_data_stall_event_enabled(HDD_HOST_NUD_FAILURE) &&
 	    !hdd_ctx->config->enable_nud_tracking &&
 	    (pkt_type_bitmap & CONNECTIVITY_CHECK_SET_ARP)) {
 		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,

+ 17 - 2
core/hdd/src/wlan_hdd_main.c

@@ -14745,6 +14745,17 @@ static inline void hdd_cal_fail_send_event(uint8_t cal_type, uint8_t reason)
 }
 #endif
 
+bool hdd_is_data_stall_event_enabled(uint32_t evt)
+{
+	uint32_t bitmap = cdp_cfg_get(cds_get_context(QDF_MODULE_ID_SOC),
+				      cfg_dp_enable_data_stall);
+
+	if (bitmap & HDD_DATA_STALL_ENABLE || bitmap & evt)
+		return true;
+
+	return false;
+}
+
 /**
  * hdd_features_init() - Init features
  * @hdd_ctx:	HDD context
@@ -14762,6 +14773,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
 	bool b_cts2self, is_imps_enabled;
 	bool rf_test_mode;
 	bool conn_policy;
+	uint32_t fw_data_stall_evt;
 
 	hdd_enter();
 
@@ -14776,10 +14788,13 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
 	ucfg_mlme_is_imps_enabled(hdd_ctx->psoc, &is_imps_enabled);
 	hdd_set_idle_ps_config(hdd_ctx, is_imps_enabled);
 
+	fw_data_stall_evt = cdp_cfg_get(cds_get_context(QDF_MODULE_ID_SOC),
+					cfg_dp_enable_data_stall) &
+			    FW_DATA_STALL_EVT_MASK;
+
 	/* Send Enable/Disable data stall detection cmd to FW */
 	sme_cli_set_command(0, WMI_PDEV_PARAM_DATA_STALL_DETECT_ENABLE,
-	cdp_cfg_get(cds_get_context(QDF_MODULE_ID_SOC),
-		    cfg_dp_enable_data_stall), PDEV_CMD);
+			    fw_data_stall_evt, PDEV_CMD);
 
 	ucfg_mlme_get_go_cts2self_for_sta(hdd_ctx->psoc, &b_cts2self);
 	if (b_cts2self)

+ 1 - 1
core/hdd/src/wlan_hdd_nud_tracking.c

@@ -327,7 +327,7 @@ static void __hdd_nud_failure_work(struct hdd_adapter *adapter)
 		return;
 	}
 
-	if (soc && cdp_cfg_get(soc, cfg_dp_enable_data_stall)) {
+	if (soc && hdd_is_data_stall_event_enabled(HDD_HOST_NUD_FAILURE)) {
 		hdd_dp_err("Data stall due to NUD failure");
 		cdp_post_data_stall_event
 			(soc,

+ 1 - 1
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -870,7 +870,7 @@ static void __hdd_softap_tx_timeout(struct net_device *dev)
 			  "Detected data stall due to continuous TX timeouts");
 		adapter->hdd_stats.tx_rx_stats.cont_txtimeout_cnt = 0;
 
-		if (cdp_cfg_get(soc, cfg_dp_enable_data_stall))
+		if (hdd_is_data_stall_event_enabled(HDD_HOST_SAP_TX_TIMEOUT))
 			cdp_post_data_stall_event(soc,
 					  DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
 					  DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,

+ 1 - 1
core/hdd/src/wlan_hdd_tx_rx.c

@@ -1501,7 +1501,7 @@ static void __hdd_tx_timeout(struct net_device *dev)
 			  "Data stall due to continuous TX timeouts");
 		adapter->hdd_stats.tx_rx_stats.cont_txtimeout_cnt = 0;
 
-		if (cdp_cfg_get(soc, cfg_dp_enable_data_stall))
+		if (hdd_is_data_stall_event_enabled(HDD_HOST_STA_TX_TIMEOUT))
 			cdp_post_data_stall_event(soc,
 					  DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
 					  DATA_STALL_LOG_HOST_STA_TX_TIMEOUT,