Browse Source

qcacld-3.0: Decrease tx drain wait time during del bss

wma_delete_bss is stuck for more than
400ms in failure scenario due to pending
tx packets to drain.

-Decrease the wait time to 20ms(2ms*max_wait_iterations)
to avoid the delete bss stuck issue.
-Tx drain wait feature added for LFR2.0
feature so moved the code under the LFR2.0
macro.

Change-Id: I33b56bb627ac914ca6fe96949de373b015853fc9
CRs-Fixed: 2097269
Sandeep Puligilla 7 years ago
parent
commit
f22263c8e0
1 changed files with 39 additions and 12 deletions
  1. 39 12
      core/wma/src/wma_dev_if.c

+ 39 - 12
core/wma/src/wma_dev_if.c

@@ -4928,6 +4928,44 @@ fail_del_bss_ho_fail:
 				   (void *)params, 0);
 }
 
+#ifdef WLAN_FEATURE_HOST_ROAM
+/**
+ * wma_wait_tx_complete() - Wait till tx packets are drained
+ * @wma: wma handle
+ * @session_id: vdev id
+ *
+ * Return: none
+ */
+static void wma_wait_tx_complete(tp_wma_handle wma,
+				uint32_t session_id)
+{
+	struct cdp_pdev *pdev;
+	uint8_t max_wait_iterations = 0;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+
+	if (!wma->interfaces[session_id].is_vdev_valid) {
+		WMA_LOGE("%s: Vdev is not valid: %d",
+			 __func__, session_id);
+		return;
+	}
+
+	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	max_wait_iterations =
+		wma->interfaces[session_id].delay_before_vdev_stop /
+		WMA_TX_Q_RECHECK_TIMER_WAIT;
+
+	while (cdp_get_tx_pending(soc, pdev) && max_wait_iterations) {
+		WMA_LOGW(FL("Waiting for outstanding packet to drain."));
+		qdf_wait_single_event(&wma->tx_queue_empty_event,
+				      WMA_TX_Q_RECHECK_TIMER_WAIT);
+		max_wait_iterations--;
+	}
+}
+#else
+static void wma_wait_tx_complete(tp_wma_handle wma)
+{
+}
+#endif
 /**
  * wma_delete_bss() - process delete bss request from upper layer
  * @wma: wma handle
@@ -4942,7 +4980,6 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 	struct wma_target_req *msg;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t peer_id;
-	uint8_t max_wait_iterations = 0;
 	struct cdp_vdev *txrx_vdev = NULL;
 	bool roam_synch_in_progress = false;
 	struct wma_txrx_node *iface;
@@ -5028,17 +5065,7 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 
 	WMA_LOGW(FL("Outstanding msdu packets: %d"),
 		 cdp_get_tx_pending(soc, pdev));
-
-	max_wait_iterations =
-		wma->interfaces[params->smesessionId].delay_before_vdev_stop /
-		WMA_TX_Q_RECHECK_TIMER_WAIT;
-
-	while (cdp_get_tx_pending(soc, pdev) && max_wait_iterations) {
-		WMA_LOGW(FL("Waiting for outstanding packet to drain."));
-		qdf_wait_single_event(&wma->tx_queue_empty_event,
-				      WMA_TX_Q_RECHECK_TIMER_MAX_WAIT);
-		max_wait_iterations--;
-	}
+	wma_wait_tx_complete(wma, params->smesessionId);
 
 	if (cdp_get_tx_pending(soc, pdev)) {
 		WMA_LOGW(FL("Outstanding msdu packets before VDEV_STOP : %d"),